mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
scale deltatime in accordance to acctime. Change velocity so that it isnt always pointing out the nose. Dont scale Acmd as much
This commit is contained in:
parent
46abb93cb8
commit
fca022a401
@ -31,7 +31,6 @@ PREP(attackProfile_JAV_TOP);
|
||||
|
||||
// Navigation Profiles
|
||||
PREP(navigationType_proNav);
|
||||
PREP(navigationType_simpleProNav);
|
||||
PREP(navigationType_lineOfSight);
|
||||
|
||||
// Seeker search functions
|
||||
@ -49,5 +48,4 @@ PREP(ahr_onFired);
|
||||
|
||||
// Navigation OnFired
|
||||
PREP(proNav_onFired);
|
||||
PREP(simpleProNav_onFired);
|
||||
|
||||
|
@ -18,8 +18,6 @@
|
||||
|
||||
BEGIN_COUNTER(guidancePFH);
|
||||
|
||||
#define TIMESTEP_FACTOR diag_deltaTime
|
||||
|
||||
params ["_args", "_pfID"];
|
||||
_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"];
|
||||
_firedEH params ["_shooter","","","","_ammo","","_projectile"];
|
||||
@ -31,6 +29,8 @@ if (!alive _projectile || isNull _projectile || isNull _shooter) exitWith {
|
||||
END_COUNTER(guidancePFH);
|
||||
};
|
||||
|
||||
private _timestep = diag_deltaTime * accTime;
|
||||
|
||||
_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"];
|
||||
|
||||
// Run seeker function:
|
||||
@ -45,7 +45,7 @@ private _projectilePos = getPosASLVisual _projectile;
|
||||
// If there is no deflection on the missile, this cannot change and therefore is redundant. Avoid calculations for missiles without any deflection
|
||||
if ((_pitchRate != 0 || {_yawRate != 0}) && {_profileAdjustedTargetPos isNotEqualTo [0,0,0]}) then {
|
||||
private _navigationFunction = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "functionName");
|
||||
private _commandedAcceleration = [_args, TIMESTEP_FACTOR, _seekerTargetPos, _profileAdjustedTargetPos] call (missionNamespace getVariable _navigationFunction);
|
||||
private _commandedAcceleration = [_args, _timestep, _seekerTargetPos, _profileAdjustedTargetPos] call (missionNamespace getVariable _navigationFunction);
|
||||
|
||||
#ifdef DRAW_GUIDANCE_INFO
|
||||
private _projectilePosAGL = ASLToAGL _projectilePos;
|
||||
@ -81,13 +81,12 @@ if ((_pitchRate != 0 || {_yawRate != 0}) && {_profileAdjustedTargetPos isNotEqua
|
||||
|
||||
TRACE_9("pitch/yaw/roll",_pitch,_yaw,_roll,_yawChange,_pitchChange,_pitchRate,_yawRate,_clampedPitch,_clampedYaw);
|
||||
|
||||
_pitch = _pitch + _clampedPitch * TIMESTEP_FACTOR;
|
||||
_yaw = _yaw + _clampedYaw * TIMESTEP_FACTOR;
|
||||
_pitch = _pitch + _clampedPitch * _timestep;
|
||||
_yaw = _yaw + _clampedYaw * _timestep;
|
||||
|
||||
TRACE_3("new pitch/yaw/roll",_pitch,_yaw,_roll);
|
||||
|
||||
[_projectile, _pitch, _yaw, 0] call FUNC(changeMissileDirection);
|
||||
_projectile setVelocityModelSpace [0, vectorMagnitude velocity _projectile, 0];
|
||||
|
||||
_guidanceParameters set [0, _yaw];
|
||||
_guidanceParameters set [2, _pitch];
|
||||
|
@ -25,8 +25,10 @@ _lastMissileFrame params ["_lastTargetPosition", "_lastTargetVelocity", "_lastLi
|
||||
private _projectileVelocity = velocity _projectile;
|
||||
|
||||
// integrate target velocity for realistic inference of velocity
|
||||
private _targetVelocity = (_seekerTargetPos vectorDiff _lastTargetPosition) vectorMultiply (1 / _timestep);
|
||||
private _targetAcceleration = (_targetVelocity vectorDiff _lastTargetVelocity) vectorMultiply (1 / _timestep);
|
||||
private _targetVelocity = _lastTargetVelocity;
|
||||
if (_timestep != 0) then {
|
||||
_targetVelocity = (_seekerTargetPos vectorDiff _lastTargetPosition) vectorMultiply (1 / _timestep);
|
||||
};
|
||||
|
||||
private _closingVelocity = _targetVelocity vectorDiff _projectileVelocity;
|
||||
|
||||
@ -35,7 +37,11 @@ private _lineOfSight = vectorNormalized (_profileAdjustedTargetPos vectorDiff ge
|
||||
// the los rate is tiny, so we multiply by a constant of a power of ten to get more aggressive acceleration
|
||||
// this is just due to how we measure our LOS delta, the vectors involved are _tiny_
|
||||
private _losDelta = _lineOfSight vectorDiff _lastLineOfSight;
|
||||
private _losRate = 1000 * (vectorMagnitude _losDelta) / _timestep;
|
||||
private _losRate = if (_timestep == 0) then {
|
||||
0
|
||||
} else {
|
||||
10 * (vectorMagnitude _losDelta) / _timestep;
|
||||
};
|
||||
|
||||
private _lateralAcceleration = (_navigationGain * _losRate);
|
||||
private _commandedAcceleration = _closingVelocity vectorMultiply _lateralAcceleration;
|
||||
|
@ -28,3 +28,7 @@ Navigation Types:
|
||||
|
||||
Navigation States:
|
||||
Todo
|
||||
|
||||
General To-Do:
|
||||
Add more weapons
|
||||
Fix GBU drag
|
||||
|
Loading…
Reference in New Issue
Block a user