The BT keyframe-animation player embedded in the Mech as legAnimation/ bodyAnimation. Struct field layout (from BT411's binary-offset map), default ctor, dtor, and Init(Mech*) reconstructed and compile-verified; Init is ctor-time (Mech ctor calls legAnimation.Init(this)/bodyAnimation.Init(this)) so it's real (binds owner + caches owner->GetJointSubsystem()). The per-frame gait engine (SelectSequence/Advance/Reset) is staged with Fail bodies -- it fires only once the mech is ticking, past the current ctor frontier. BT stage 23 ok; full tree still links clean. Evidence + real/staged split in SEQCTL.NOTES.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
98 lines
3.0 KiB
C++
98 lines
3.0 KiB
C++
//===========================================================================//
|
|
// File: seqctl.cpp //
|
|
// Project: BattleTech Brick: Mech animation //
|
|
// Contents: The Mech keyframe-animation player (leg / body gait clips) //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#include <bt.hpp>
|
|
#pragma hdrstop
|
|
|
|
#if !defined(SEQCTL_HPP)
|
|
# include <seqctl.hpp>
|
|
#endif
|
|
|
|
#if !defined(MECH_HPP)
|
|
# include <mech.hpp>
|
|
#endif
|
|
|
|
//
|
|
//#############################################################################
|
|
//#############################################################################
|
|
//
|
|
SequenceController::SequenceController()
|
|
{
|
|
keyframeCount = 0;
|
|
jointCount = 0;
|
|
footStepThreshold = NULL;
|
|
jointIndices = NULL;
|
|
keyframeTimes = NULL;
|
|
keyframeBase = NULL;
|
|
keyframeCursor = NULL;
|
|
keyframeData = NULL;
|
|
currentFrame = 0;
|
|
currentTime = 0.0f;
|
|
jointSubsystem = NULL;
|
|
owner = NULL;
|
|
clipResource = NULL;
|
|
finishedCallback = NULL;
|
|
callbackArg2 = 0;
|
|
callbackArg3 = 0;
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
// Init Bind the player to its owning mech and cache the joint subsystem the
|
|
// gait writes through. Called from the Mech ctor for legAnimation/bodyAnimation.
|
|
//#############################################################################
|
|
//
|
|
void
|
|
SequenceController::Init(Mech *owner_mech)
|
|
{
|
|
Check(owner_mech);
|
|
owner = owner_mech;
|
|
jointSubsystem = owner_mech->GetJointSubsystem();
|
|
clipResource = NULL;
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
//#############################################################################
|
|
//
|
|
SequenceController::~SequenceController()
|
|
{
|
|
//
|
|
// Releases the locked clip resource when reconstructed; nothing is locked
|
|
// while SelectSequence is staged.
|
|
//
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
// Playback -- the per-frame gait engine (clip parse, keyframe interpolation,
|
|
// joint writes). Exercised only once the mech is ticking; not yet
|
|
// reconstructed. See SEQCTL.NOTES.md.
|
|
//#############################################################################
|
|
//
|
|
void
|
|
SequenceController::SelectSequence(int, void *, unsigned, unsigned)
|
|
{
|
|
Fail("SequenceController::SelectSequence -- seqctl.cpp not yet reconstructed");
|
|
}
|
|
|
|
Scalar
|
|
SequenceController::Advance(Scalar, int)
|
|
{
|
|
Fail("SequenceController::Advance -- seqctl.cpp not yet reconstructed");
|
|
return 0.0f;
|
|
}
|
|
|
|
void
|
|
SequenceController::Reset(int)
|
|
{
|
|
Fail("SequenceController::Reset -- seqctl.cpp not yet reconstructed");
|
|
}
|