VR-Forces 4.1.1 Class Documentation
8.9 - Missile Kinematics Model

Table of Contents

VR-Forces includes a simple, kinematics-based model for motion of missiles.

Implemented in class: DtMissileManeuverActComponent

8.9.1 Inputs to the Model

The model accepts the following control inputs:

Other factors taken into consideration:

8.9.2 Resulting Behavior

The missile is maneuverable (respond to steering acceleration inputs) for the duration of the max-burn-time parameter, whereupon it will go into free fall. Missiles are typcially configured with high maximum speeds, making them sensitive to low frame rates.

8.9.3 Model Details

The model must be ticked periodically. Each tick, the length of time of the previous tick, dT, is available as a parameter in the current tick. Below is an outline of what the model does each tick:

  1. If the missile has been destroyed, it calls myMissileControlPortGroup->dataReceived() to release control of the port group, and returns.

  2. If this is the first time the tick has been called, and the missile is not destroyed, it computes the maximum burn time for the missile, and saves it in the member variable myMaxBurnTime. The engine burns fuel for a duration defined by the missile's range divided by the maximum speed. After that point, the missile goes into free fall. Maneuver acceleration inputs are ignored, and the only acceleration affecting missile motion is that due to gravity.

  3. If the current burn time has exceeded myMaxBurnTime, it sets an acceleration vector for the missile in local coordinates, for example:

    DtVector localAcceleration;
    localAcceleration[0] = 0;
    localAcceleration[1] = 0;
    localAcceleration[2] = -9.8; // due to gravity, in meters/seconds squared<br>

    Otherwise, it initializes the local acceleration from the inputs provided on the missile maneuver port:

    localAcceleration[0] = myMissileManeuvPortIntf-&gt;maneuverAccelXPort()-&gt; value();
    localAcceleration[1] = myMissileManeuvPortIntf-&gt;maneuverAccelYPort()-&gt; value();
    localAcceleration[2] = myMissileManeuvPortIntf-&gt;maneuverAccelZPort()-&gt; value();

  4. It computes the local velocity vector due to the maneuver acceleration by scaling the acceleration by dT, the duration of the frame. The resulting vector is added to the missile's current velocity.

    DtVector localVelocity;
    DtVecScale(localAcceleration, dT, localVelocity);
    DtVecAdd(localVelocity, myMissileState-&gt;localVelocity(), localVelocity);

  5. The local velocity is scaled to the maximum velocity of the missile.

    DtVector normalizedVelocity;
    DtVecNormalize(localVelocity, normalizedVelocity);
    DtVecScale(normalizedVelocity, myMissileState-&gt;maxSpeed(), localVelocity);

  6. The new local location of the missile is determined by adding the change in position over the duration of the frame dT, to the current position.

    DtVector newPosition;
    DtVector deltaPosition;
    DtVecScale(localVelocity, dT, deltaPosition);
    DtVecAdd(missileState-&gt;localPosition(), deltaPosition, newPosition);

  7. The orientation of the missile is computed from the missile’s velocity vector.

    double heading = atan2(localVelocity[0], localVelocity[1]);
    double pitch = atan2(localVelocity[2], sqrt(localVelocity[0] *
    localVelocity[0] + localVelocity[1] * localVelocity[1]));

  8. At the end of the tick, updateRepository() is called, with the new values for local position, velocity, acceleration, and orientation of the missile. It frees control of the missile-control port group, and returns.

[<< Human Kinematics Model] [Home] [Top of Page] [Missiles Dynamics System >>]


Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)