Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
ToppleUpdate Class Reference

#include <ToppleUpdate.h>

Inherits UpdateModule, and CollideModuleInterface.

Public Member Functions

 ToppleUpdate (Thing *thing, const ModuleData *moduleData)
 
virtual CollideModuleInterfacegetCollide ()
 
void applyTopplingForce (const Coord3D *toppleDirection, Real toppleSpeed, UnsignedInt options)
 < Start the toppling process by giving a force vector
 
Bool isAbleToBeToppled () const
 < Ask if this module is able to be toppled
 
virtual UpdateSleepTime update ()
 < Keep track of rotational fall distance, bounce and/or stop when needed.
 
virtual void onCollide (Object *other, const Coord3D *loc, const Coord3D *normal)
 
virtual Bool wouldLikeToCollideWith (const Object *other) const
 this is used for things like pilots, to determine if they can "enter" something
 
virtual Bool isHijackedVehicleCrateCollide () const
 
virtual Bool isCarBombCrateCollide () const
 
virtual Bool isRailroad () const
 
virtual Bool isSalvageCrateCollide () const
 
virtual Bool isSabotageBuildingCrateCollide () const
 
- Public Member Functions inherited from UpdateModule
 UpdateModule (Thing *thing, const ModuleData *moduleData)
 
virtual UpdateModuleInterfacegetUpdate ()
 
DisabledMaskType getDisabledTypesToProcess () const
 
UPDATEMODULE_FRIEND_DECLARATOR UnsignedInt friend_getPriority () const
 
UPDATEMODULE_FRIEND_DECLARATOR UnsignedInt friend_getNextCallFrame () const
 
UPDATEMODULE_FRIEND_DECLARATOR SleepyUpdatePhase friend_getNextCallPhase () const
 
UPDATEMODULE_FRIEND_DECLARATOR void friend_setNextCallFrame (UnsignedInt frame)
 
UPDATEMODULE_FRIEND_DECLARATOR Int friend_getIndexInLogic () const
 
UPDATEMODULE_FRIEND_DECLARATOR void friend_setIndexInLogic (Int i)
 
UPDATEMODULE_FRIEND_DECLARATOR const Objectfriend_getObject () const
 
- Public Member Functions inherited from BehaviorModule
 BehaviorModule (Thing *thing, const ModuleData *moduleData)
 
virtual BodyModuleInterfacegetBody ()
 
virtual ContainModuleInterfacegetContain ()
 
virtual CreateModuleInterfacegetCreate ()
 
virtual DamageModuleInterfacegetDamage ()
 
virtual DestroyModuleInterfacegetDestroy ()
 
virtual DieModuleInterfacegetDie ()
 
virtual SpecialPowerModuleInterfacegetSpecialPower ()
 
virtual UpgradeModuleInterfacegetUpgrade ()
 
virtual StealthUpdategetStealth ()
 
virtual SpyVisionUpdategetSpyVisionUpdate ()
 
virtual ParkingPlaceBehaviorInterfacegetParkingPlaceBehaviorInterface ()
 
virtual RebuildHoleBehaviorInterfacegetRebuildHoleBehaviorInterface ()
 
virtual BridgeBehaviorInterfacegetBridgeBehaviorInterface ()
 
virtual BridgeTowerBehaviorInterfacegetBridgeTowerBehaviorInterface ()
 
virtual BridgeScaffoldBehaviorInterfacegetBridgeScaffoldBehaviorInterface ()
 
virtual OverchargeBehaviorInterfacegetOverchargeBehaviorInterface ()
 
virtual TransportPassengerInterfacegetTransportPassengerInterface ()
 
virtual CaveInterfacegetCaveInterface ()
 
virtual LandMineInterfacegetLandMineInterface ()
 
virtual DieModuleInterfacegetEjectPilotDieInterface ()
 
virtual ProjectileUpdateInterfacegetProjectileUpdateInterface ()
 
virtual AIUpdateInterfacegetAIUpdateInterface ()
 
virtual ExitInterfacegetUpdateExitInterface ()
 
virtual DockUpdateInterfacegetDockUpdateInterface ()
 
virtual RailedTransportDockUpdateInterfacegetRailedTransportDockUpdateInterface (void)
 
virtual SlowDeathBehaviorInterfacegetSlowDeathBehaviorInterface ()
 
virtual SpecialPowerUpdateInterfacegetSpecialPowerUpdateInterface ()
 
virtual SlavedUpdateInterfacegetSlavedUpdateInterface ()
 
virtual ProductionUpdateInterfacegetProductionUpdateInterface ()
 
virtual HordeUpdateInterfacegetHordeUpdateInterface ()
 
virtual PowerPlantUpdateInterfacegetPowerPlantUpdateInterface ()
 
virtual SpawnBehaviorInterfacegetSpawnBehaviorInterface ()
 
virtual CountermeasuresBehaviorInterfacegetCountermeasuresBehaviorInterface ()
 
virtual const CountermeasuresBehaviorInterfacegetCountermeasuresBehaviorInterface () const
 
- Public Member Functions inherited from ObjectModule
 ObjectModule (Thing *thing, const ModuleData *moduleData)
 < this abstract class needs memory pool hooks
 
virtual void onCapture (Player *oldOwner, Player *newOwner)
 
virtual void onDisabledEdge (Bool nowDisabled)
 
- Public Member Functions inherited from Module
 Module (const ModuleData *moduleData)
 < this abstract class needs memory pool hooks
 
virtual NameKeyType getModuleNameKey () const =0
 
NameKeyType getModuleTagNameKey () const
 
virtual void onObjectCreated ()
 
virtual void onDrawableBoundToObject ()
 
virtual void preloadAssets (TimeOfDay timeOfDay)
 preload any assets we might have for this time of day
 
virtual void onDelete (void)
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Static Public Member Functions

static Int getInterfaceMask ()
 
- Static Public Member Functions inherited from UpdateModule
static Int getInterfaceMask ()
 
- Static Public Member Functions inherited from BehaviorModule
static Int getInterfaceMask ()
 
static ModuleType getModuleType ()
 
- Static Public Member Functions inherited from Module
static ModuleDatafriend_newModuleData (INI *ini)
 

Protected Types

enum  ToppleState { TOPPLE_UPRIGHT = 0 , TOPPLE_FALLING , TOPPLE_DOWN }
 

Protected Attributes

Real m_angularVelocity
 Velocity in degrees per frame (or is it radians per frame?)
 
Real m_angularAcceleration
 Acceleration angularVelocity is increasing.
 
Coord3D m_toppleDirection
 Z-less direction we are toppling.
 
ToppleState m_toppleState
 Stage this module is in.
 
Real m_angularAccumulation
 How much have I rotated so I know when to bounce.
 
Real m_angleDeltaX
 how much to modify x angle each frame
 
Int m_numAngleDeltaX
 how many frames to tweak x angle
 
Bool m_doBounceFX
 do the bounce FX if we do bounce
 
UnsignedInt m_options
 topple options
 
ObjectID m_stumpID
 stump generated, if any
 

Additional Inherited Members

- Protected Member Functions inherited from UpdateModule
void setWakeFrame (Object *obj, UpdateSleepTime wakeDelay)
 
UpdateSleepTime getWakeFrame () const
 
virtual SleepyUpdatePhase getUpdatePhase () const
 
UpdateSleepTime frameToSleepTime (UnsignedInt frame1, UnsignedInt frame2=FOREVER, UnsignedInt frame3=FOREVER, UnsignedInt frame4=FOREVER)
 
- Protected Member Functions inherited from BehaviorModule
virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
- Protected Member Functions inherited from ObjectModule
ObjectgetObject ()
 
const ObjectgetObject () const
 
- Protected Member Functions inherited from Module
const ModuleDatagetModuleData () const
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Detailed Description

Definition at line 77 of file ToppleUpdate.h.

Member Enumeration Documentation

◆ ToppleState

enum ToppleUpdate::ToppleState
protected
Enumerator
TOPPLE_UPRIGHT 
TOPPLE_FALLING 
TOPPLE_DOWN 

Definition at line 112 of file ToppleUpdate.h.

Constructor & Destructor Documentation

◆ ToppleUpdate()

ToppleUpdate::ToppleUpdate ( Thing * thing,
const ModuleData * moduleData )

Definition at line 105 of file ToppleUpdate.cpp.

Member Function Documentation

◆ applyTopplingForce()

void ToppleUpdate::applyTopplingForce ( const Coord3D * toppleDirection,
Real toppleSpeed,
UnsignedInt options )

< Start the toppling process by giving a force vector

Definition at line 142 of file ToppleUpdate.cpp.

◆ getCollide()

virtual CollideModuleInterface * ToppleUpdate::getCollide ( )
inlinevirtual

Reimplemented from BehaviorModule.

Definition at line 92 of file ToppleUpdate.h.

◆ getInterfaceMask()

static Int ToppleUpdate::getInterfaceMask ( void )
inlinestatic

Definition at line 89 of file ToppleUpdate.h.

◆ isAbleToBeToppled()

Bool ToppleUpdate::isAbleToBeToppled ( ) const

< Ask if this module is able to be toppled

Definition at line 246 of file ToppleUpdate.cpp.

◆ isCarBombCrateCollide()

virtual Bool ToppleUpdate::isCarBombCrateCollide ( ) const
inlinevirtual

Implements CollideModuleInterface.

Definition at line 105 of file ToppleUpdate.h.

◆ isHijackedVehicleCrateCollide()

virtual Bool ToppleUpdate::isHijackedVehicleCrateCollide ( ) const
inlinevirtual

Implements CollideModuleInterface.

Definition at line 104 of file ToppleUpdate.h.

◆ isRailroad()

virtual Bool ToppleUpdate::isRailroad ( ) const
inlinevirtual

Implements CollideModuleInterface.

Definition at line 106 of file ToppleUpdate.h.

◆ isSabotageBuildingCrateCollide()

virtual Bool ToppleUpdate::isSabotageBuildingCrateCollide ( ) const
inlinevirtual

Implements CollideModuleInterface.

Definition at line 108 of file ToppleUpdate.h.

◆ isSalvageCrateCollide()

virtual Bool ToppleUpdate::isSalvageCrateCollide ( ) const
inlinevirtual

Implements CollideModuleInterface.

Definition at line 107 of file ToppleUpdate.h.

◆ onCollide()

void ToppleUpdate::onCollide ( Object * other,
const Coord3D * loc,
const Coord3D * normal )
virtual

Do the collision

Implements CollideModuleInterface.

Definition at line 366 of file ToppleUpdate.cpp.

◆ update()

UpdateSleepTime ToppleUpdate::update ( void )
virtual

< Keep track of rotational fall distance, bounce and/or stop when needed.

Implements UpdateModule.

Definition at line 268 of file ToppleUpdate.cpp.

◆ wouldLikeToCollideWith()

virtual Bool ToppleUpdate::wouldLikeToCollideWith ( const Object * other) const
inlinevirtual

this is used for things like pilots, to determine if they can "enter" something

Implements CollideModuleInterface.

Definition at line 103 of file ToppleUpdate.h.

Member Data Documentation

◆ m_angleDeltaX

Real ToppleUpdate::m_angleDeltaX
protected

how much to modify x angle each frame

Definition at line 124 of file ToppleUpdate.h.

◆ m_angularAcceleration

Real ToppleUpdate::m_angularAcceleration
protected

Acceleration angularVelocity is increasing.

Definition at line 120 of file ToppleUpdate.h.

◆ m_angularAccumulation

Real ToppleUpdate::m_angularAccumulation
protected

How much have I rotated so I know when to bounce.

Definition at line 123 of file ToppleUpdate.h.

◆ m_angularVelocity

Real ToppleUpdate::m_angularVelocity
protected

Velocity in degrees per frame (or is it radians per frame?)

Definition at line 119 of file ToppleUpdate.h.

◆ m_doBounceFX

Bool ToppleUpdate::m_doBounceFX
protected

do the bounce FX if we do bounce

Definition at line 126 of file ToppleUpdate.h.

◆ m_numAngleDeltaX

Int ToppleUpdate::m_numAngleDeltaX
protected

how many frames to tweak x angle

Definition at line 125 of file ToppleUpdate.h.

◆ m_options

UnsignedInt ToppleUpdate::m_options
protected

topple options

Definition at line 127 of file ToppleUpdate.h.

◆ m_stumpID

ObjectID ToppleUpdate::m_stumpID
protected

stump generated, if any

Definition at line 128 of file ToppleUpdate.h.

◆ m_toppleDirection

Coord3D ToppleUpdate::m_toppleDirection
protected

Z-less direction we are toppling.

Definition at line 121 of file ToppleUpdate.h.

◆ m_toppleState

ToppleState ToppleUpdate::m_toppleState
protected

Stage this module is in.

Definition at line 122 of file ToppleUpdate.h.


The documentation for this class was generated from the following files: