//===========================================================================// // File: torso.cpp // // Project: BattleTech Brick: Mech subsystems // // Contents: Torso -- torso twist / weapon elevation // //---------------------------------------------------------------------------// // Copyright (C) 1995, Virtual World Entertainment, Inc. // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// #include #pragma hdrstop #if !defined(TORSO_HPP) # include #endif #if !defined(MECH_HPP) # include #endif Derivation Torso::ClassDerivations( PowerWatcher::ClassDerivations, "Torso" ); Torso::SharedData Torso::DefaultData( Torso::ClassDerivations, Subsystem::MessageHandlers, Subsystem::AttributeIndex, Subsystem::StateCount ); Torso::Torso( Mech *owner, int subsystem_ID, SubsystemResource *r, SharedData &shared_data ): PowerWatcher(owner, subsystem_ID, r, shared_data) { Check(owner); Check_Pointer(r); isDamagedCopy = (owner->GetInstance() == Entity::ReplicantInstance); statusFlags = 0; buttonAccelerationPerSecond = r->buttonAccelerationPerSecond; buttonAccelerationStart = r->buttonAccelerationStartValue; baseTwistRate = r->horizontalRotationPerSecond * RAD_PER_DEG; baseElevationRate = r->verticalRotationPerSecond * RAD_PER_DEG; horizontalLimitRight= r->horizontalLimitRight * RAD_PER_DEG; horizontalLimitLeft = r->horizontalLimitLeft * RAD_PER_DEG; verticalLimitTop = r->verticalLimitTop * RAD_PER_DEG; verticalLimitBottom = r->verticalLimitBottom * RAD_PER_DEG; twistCenterHigh = verticalLimitTop; twistCenterLow = verticalLimitBottom; elevationCenter = verticalLimitTop; elevationHalfBottom = verticalLimitBottom * 0.5f; buttonRampActive = 0; buttonRamp = 0.0f; horizontalEnabled = r->torsoHorizontalEnabled; // // The named skeleton joints are resolved once the Mech skeleton link is // live (per-frame sim / phase-4 wiring); leave the handles null here. // horizontalJointNode = NULL; horizontalShadowJointNode = NULL; currentTwist = 0.0f; currentElevation = 0.0f; for (int i = 0; i < 24; ++i) { dynamicsState[i] = 0.0f; } Check_Fpu(); } Torso::~Torso() { } Logical Torso::TestClass(Mech &) { return True; } Logical Torso::TestInstance() const { return IsDerivedFrom(ClassDerivations); } // // Per-frame torso twist / elevation integration. Not yet reconstructed. // void Torso::TorsoSimulation(Scalar) { Fail("Torso::TorsoSimulation -- torso.cpp not yet reconstructed"); } void Torso::TorsoCopySimulation(Scalar) { Fail("Torso::TorsoCopySimulation -- torso.cpp not yet reconstructed"); }