#if !defined(SEQCTL_HPP) # define SEQCTL_HPP //##################### Forward Class Declarations ####################### class Mech; class JointSubsystem; //########################################################################## //###################### SequenceController ########################## //########################################################################## // // The BT keyframe-animation player embedded in the Mech as legAnimation and // bodyAnimation. It plays a gait clip: walks the clip's keyframes, // interpolates each animated joint's rotation, writes it through the joint // subsystem, and returns the root-translation distance advanced this step. // // Reconstructed from the shipped binary (ctor/Init @00427768, SelectSequence // @004277a8, Advance @0042790c, Reset @004283b8). Not in the surviving 4.10 // archive nor the RP engine. See SEQCTL.NOTES.md. // class SequenceController { public: // // One root-translation entry (per keyframe); ".stride" is the forward // (local Z) distance the gait reads. // struct Keyframe { Scalar x, y, stride; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Construction / Destruction // public: SequenceController(); ~SequenceController(); void Init(Mech *owner_mech); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Playback // public: void SelectSequence( int clip_id, void *finished_callback, unsigned callback_arg2, unsigned callback_arg3 ); Scalar Advance(Scalar time_slice, int move_joints); void Reset(int loop); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Clip data (parsed by SelectSequence; keyframe accessors read by the gait) // public: int keyframeCount; int jointCount; Scalar *footStepThreshold; int *jointIndices; Scalar *keyframeTimes; void *keyframeBase; void *keyframeCursor; Keyframe *keyframeData; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Runtime state / links // public: int currentFrame; Scalar currentTime; JointSubsystem *jointSubsystem; Mech *owner; void *clipResource; void *finishedCallback; unsigned callbackArg2; unsigned callbackArg3; }; #endif