Files
TeslaRel410/CODE/RP/RP/THRUSTER.HPP
T
CydandClaude Fable 5 fdd9ac9d97 Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)
Archival snapshot of the Virtual World Entertainment Tesla cockpit
software, 1994-1996: MUNGA engine and L4 pod layer source (Borland
C++ 5.0), BT/RP game code, and game content (models, audio, maps,
gauges, Division renderer data). Includes third-party libraries:
Division dVS/DPL graphics, HMI SOS audio, WATTCP networking.

Files are preserved byte-for-byte (.gitattributes disables all
line-ending conversion). README.md documents the layout, target
hardware, and toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 13:21:58 -05:00

162 lines
4.6 KiB
C++

//===========================================================================//
// File: vtvpwr.hh //
// Project: Red Planet //
// Contents: Interface specification for vectored thrust vehicles //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/23/95 JMA Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(THRUSTER_HPP)
# define THRUSTER_HPP
# if !defined(VTVSUB_HPP)
# include <vtvsub.hpp>
# endif
class Joint;
//##########################################################################
//################## Thruster::SubsystemResource #####################
//##########################################################################
struct Thruster__SubsystemResource:
public Subsystem::SubsystemResource
{
int jointIndex;
Scalar maxThrusterRotationRate;
Logical primeThruster;
};
//##########################################################################
//################### Thruster::UpdateRecord ####################
//##########################################################################
struct Thruster__UpdateRecord :
public VTVSubsystem::UpdateRecord
{
Scalar
thrusterRotation;
};
//##########################################################################
//############################ Thruster ##############################
//##########################################################################
class Thruster:
public Subsystem
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Message Support
//
#if 0
private:
static const HandlerEntry MessageHandlerEntries[];
protected:
static MessageHandlerSet MessageHandlers;
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute Support
//
public:
enum {
ThrusterOffsetAttributeID = Subsystem::NextAttributeID,
ThrusterPositionAttributeID,
CurrentAccelerationAttributeID,
CurrentHeightAttributeID,
MaxThrusterRotationRateAttributeID,
MomentArmAttributeID,
MomentArmLengthAttributeID,
NextAttributeID
};
private:
static const IndexEntry AttributePointers[];
protected:
static AttributeIndexSet AttributeIndex;
//
// public attribute declarations go here
//
public:
Point3D thrusterOffset;
Joint *thrusterPosition;
Scalar
currentAcceleration,
currentHeight,
maxThrusterRotationRate,
powerScale,
momentArmLength;
Vector3D
momentArm;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Model Support
//
public:
typedef void
(Thruster::*Performance)(Scalar time_slice);
typedef Thruster__UpdateRecord UpdateRecord;
void
PrimeThruster(Scalar time_slice);
void
SlaveThruster(Scalar time_slice);
void
PrimeDeadReckon(Scalar time_slice);
void
SlaveDeadReckon(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
VTV*
GetEntity()
{Check(this); return Cast_Object(VTV*, Subsystem::GetEntity());}
protected:
void
WriteUpdateRecord(Simulation::UpdateRecord *message, int update_model);
void
ReadUpdateRecord(Simulation::UpdateRecord *message);
Scalar
updatedPosition;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction
//
public:
typedef Thruster__SubsystemResource SubsystemResource;
Thruster(
VTV *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource
);
~Thruster();
Logical
TestInstance() const;
};
#endif