Imports the current Win32 source for the pod-racing game 'Red Planet', built on the MUNGA engine and its L4 (Win32/DirectX) platform layer: - MUNGA / MUNGA_L4: cross-platform engine core and Win32 backend - RP / RP_L4: Red Planet game logic and Win32 application - DivLoader, Setup1: asset loader and installer project - lib, MUNGA_L4/openal, MUNGA_L4/sos: third-party audio dependencies Removed stale Subversion metadata and added .gitignore/.gitattributes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
144 lines
3.3 KiB
C++
144 lines
3.3 KiB
C++
#pragma once
|
|
|
|
#include "vtvsub.h"
|
|
|
|
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 *GetClassDerivations();
|
|
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
|
|
static AttributeIndexSet& GetAttributeIndex();
|
|
|
|
//
|
|
// 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;
|
|
};
|