IMS2
Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
|
Public Member Functions | |
IMS_Animation_Base (ANIMATIONDATA *_data) | |
virtual void | AddAnimationToVessel (IMS2 *_vessel, int _meshindex, MATRIX3 moduleorientation, VECTOR3 modulelocalpos) |
Adds the animation to the vessel using the orbiter API. More... | |
virtual void | RemoveAnimationFromVessel () |
Removes the animation from the vessel. More... | |
virtual void | InitStateFromScenario (vector< string > &line) |
Initialises the animation state from a scenario line. More... | |
virtual AnimationEvent_Base * | PropagateAnimation (double simdt)=0 |
propagates the animation and returns an AnimationFinishedEvent if the animation stoped. More... | |
virtual AnimationEvent_Base * | StartAnimation (StartAnimationEvent *startevent) |
Starts the animation. More... | |
virtual void | ModifyAnimation (ModifyAnimationEvent *modifyevent) |
Modifies an animation, usually its speed and direction. More... | |
virtual void | StopAnimation () |
Stops the animation. More... | |
bool | IsRunning () |
virtual string | GetScenarioLine () |
virtual void | DisableAnimation () |
Disables updating of the animation state in orbiter. More... | |
virtual void | EnableAnimation () |
Enables updating of the animation state in orbiter. More... | |
double | GetState () |
void | GetDependencies (vector< ANIMATIONDEPENDENCY > &OUT_dependencies) |
Fills the passed reference with the dependencies of this animation. | |
Protected Member Functions | |
MGROUP_ROTATE * | createRotationComponent (ANIMCOMPONENTDATA *comp, VECTOR3 modulelocalpos, MATRIX3 moduleorientation) |
Creates a rotation animation component that can be added to the animation on the vessel. More... | |
MGROUP_TRANSLATE * | createTranslationComponent (ANIMCOMPONENTDATA *comp, VECTOR3 modulelocalpos, MATRIX3 moduleorientation) |
Creates a translation animation component that can be added to the animation on the vessel. More... | |
MGROUP_SCALE * | createScaleComponent (ANIMCOMPONENTDATA *comp, VECTOR3 modulelocalpos, MATRIX3 moduleorientation) |
Creates a scale animation component that can be added to the animation on the vessel. More... | |
Protected Attributes | |
IMS2 * | vessel |
The vessel this animation is currently a part of. | |
ANIMATIONDATA * | data |
Pointer to the data defining this animation. | |
double | speed = 0.0 |
The current speed/direction of the animation. | |
int | orbiterid |
The orbiter-generated identifier for this animation. | |
double | state = 0.0 |
The current state of the animation (>= 0.0 <= 1.0) | |
int | meshindex = 0 |
The orbiter generated index of the mesh this animation acts on. | |
double | maxspeed = 1e12 |
The maximum speed the animation can have. Effects not yet implemented. | |
vector< UINT * > | animationgroups |
List meshgroup indices this animation acts on. | |
vector< ANIMATIONCOMPONENT_HANDLE > | animationcomponents |
List of orbiter-internal components this animation consists of. | |
bool | enabled = false |
An animation is disabled when the vessel visual doesn't exist. state still gets propagated, but the animation state on the vessel doesn't get updated. | |
Abstract base class for animations
IMS_Animation_Base::IMS_Animation_Base | ( | ANIMATIONDATA * | _data | ) |
_data | Pointer to the data that describes the animation |
|
virtual |
Adds the animation to the vessel using the orbiter API.
_vessel | The vessel to add the animation to |
_meshindex | The index of the mesh that is influenced by this animation |
moduleorientation | Matrix to transform from module-relative to vessel-relative coordinates |
modulelocalpos | Vessel-relative position of the module containing this animation |
Reimplemented in IMS_Animation_Tracking.
|
protected |
Creates a rotation animation component that can be added to the animation on the vessel.
comp | The data to create the component from |
modulelocalpos | The vessel-relative position of the module this animation is part of |
moduleorientation | Transformation matrix from vessel-relative to module-relative orientation |
|
protected |
Creates a scale animation component that can be added to the animation on the vessel.
comp | The data to create the component from |
modulelocalpos | The vessel-relative position of the module this animation is part of |
moduleorientation | Transformation matrix from vessel-relative to module-relative orientation |
|
protected |
Creates a translation animation component that can be added to the animation on the vessel.
comp | The data to create the component from |
modulelocalpos | The vessel-relative position of the module this animation is part of |
moduleorientation | Transformation matrix from vessel-relative to module-relative orientation |
|
virtual |
Disables updating of the animation state in orbiter.
Animations should be disabled when a vessel visual does not exist (not close enough to camera) or if the whole vessel doesn't exist. The animation state will still propagate even if disabled, so when the vessel are created it will be as if the animation never stoped
Reimplemented in IMS_Animation_Tracking.
|
virtual |
Enables updating of the animation state in orbiter.
Reimplemented in IMS_Animation_Tracking.
|
virtual |
Reimplemented in IMS_Animation_Tracking, and IMS_Animation_Continuous.
|
inline |
|
virtual |
Initialises the animation state from a scenario line.
line | A list of strings, representing the scenario line cut by " " |
Reimplemented in IMS_Animation_Tracking, and IMS_Animation_Continuous.
bool IMS_Animation_Base::IsRunning | ( | ) |
|
virtual |
Modifies an animation, usually its speed and direction.
modifyevent | The event that modifies the animation |
Reimplemented in IMS_Animation_Tracking.
|
pure virtual |
propagates the animation and returns an AnimationFinishedEvent if the animation stoped.
propagation behavior has to be implemented by child classes.
simdt | The time elapsed since the last frame |
Implemented in IMS_Animation_Tracking, IMS_Animation_Continuous, and IMS_Animation_Sequential.
|
virtual |
|
virtual |
Starts the animation.
startevent | The StartAnimationEvent that triggers the start of the animation |
Reimplemented in IMS_Animation_Tracking.
|
virtual |
Stops the animation.
Reimplemented in IMS_Animation_Tracking, and IMS_Animation_Continuous.