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

#include <PhysicsUpdate.h>

Inherits UpdateModule, and CollideModuleInterface.

Inherited by RailroadBehavior.

Public Member Functions

 PhysicsBehavior (Thing *thing, const ModuleData *moduleData)
 
virtual void onObjectCreated ()
 
virtual CollideModuleInterfacegetCollide ()
 
virtual void onCollide (Object *other, const Coord3D *loc, const Coord3D *normal)
 
virtual Bool wouldLikeToCollideWith (const Object *other) const
 
virtual Bool isCarBombCrateCollide () const
 
virtual Bool isHijackedVehicleCrateCollide () const
 
virtual Bool isRailroad () const
 
virtual Bool isSalvageCrateCollide () const
 
virtual Bool isSabotageBuildingCrateCollide () const
 
virtual UpdateSleepTime update ()
 
virtual DisabledMaskType getDisabledTypesToProcess () const
 
void applyForce (const Coord3D *force)
 apply a force at the object's CG
 
void applyShock (const Coord3D *force)
 apply a shockwave force against the object's CG
 
void applyRandomRotation ()
 apply a random rotation at the object's CG
 
void addVelocityTo (const Coord3D *vel)
 
void applyMotiveForce (const Coord3D *force)
 
void clearAcceleration ()
 
void transferVelocityTo (PhysicsBehavior *that) const
 
void setAngles (Real yaw, Real pitch, Real roll)
 
Real getMass () const
 
void setMass (Real mass)
 
Real getCenterOfMassOffset () const
 
const Coord3DgetAcceleration () const
 get last frame's acceleration
 
const Coord3DgetVelocity () const
 get current velocity
 
Real getVelocityMagnitude () const
 return velocity magnitude (speed)
 
Real getForwardSpeed2D () const
 compute speed along object's 2d direction vector
 
Real getForwardSpeed3D () const
 compute speed along object's 3d direction vector
 
ObjectID getCurrentOverlap () const
 return object(s) being overlapped
 
ObjectID getPreviousOverlap () const
 return object(s) that were overlapped last frame
 
ObjectID getLastCollidee () const
 return object that was last collided with... can be quite old
 
Bool isCurrentlyOverlapped (Object *obj) const
 
Bool wasPreviouslyOverlapped (Object *obj) const
 
void addOverlap (Object *obj)
 
Bool isMotive () const
 
PhysicsTurningType getTurning (void) const
 0 = not turning, -1 = turn negative, 1 = turn positive.
 
void setTurning (PhysicsTurningType turning)
 
void scrubVelocity2D (Real desiredVelocity)
 
void scrubVelocityZ (Real desiredVelocity)
 
void setPitchRate (Real pitch)
 
void setRollRate (Real roll)
 
void setYawRate (Real yaw)
 
void setAllowToFall (Bool allow)
 
void setStickToGround (Bool allow)
 
void setAllowBouncing (Bool allow)
 
void setAllowCollideForce (Bool allow)
 
void setAllowAirborneFriction (Bool allow)
 
void setImmuneToFallingDamage (Bool allow)
 
void setStunned (Bool allow)
 
Bool getAllowToFall () const
 
void setIsInFreeFall (Bool allow)
 
Bool getIsInFreeFall () const
 
Bool getIsStunned () const
 
void setExtraBounciness (Real b)
 
void setExtraFriction (Real b)
 
void setBounceSound (const AudioEventRTS *bounceSound)
 
const AudioEventRTSgetBounceSound ()
 
void resetDynamicPhysics ()
 
void setIgnoreCollisionsWith (const Object *obj)
 
Bool isIgnoringCollisionsWith (ObjectID id) const
 
Bool getAllowCollideForce () 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 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 Member Functions

virtual SleepyUpdatePhase getUpdatePhase () const
 
Real getAerodynamicFriction () const
 
Real getForwardFriction () const
 
Real getLateralFriction () const
 
Real getZFriction () const
 
void applyGravitationalForces ()
 
void applyFrictionalForces ()
 
Bool handleBounce (Real oldZ, Real newZ, Real groundZ, Coord3D *bounceForce)
 
void applyYPRDamping (Real factor)
 
UpdateSleepTime calcSleepTime () const
 
void doBounceSound (const Coord3D &prevPos)
 
Bool checkForOverlapCollision (Object *other)
 
void testStunnedUnitForDestruction (void)
 
- Protected Member Functions inherited from UpdateModule
void setWakeFrame (Object *obj, UpdateSleepTime wakeDelay)
 
UpdateSleepTime getWakeFrame () 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

Simple rigid body physics update module

Definition at line 81 of file PhysicsUpdate.h.

Constructor & Destructor Documentation

◆ PhysicsBehavior()

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

Definition at line 206 of file PhysicsUpdate.cpp.

Member Function Documentation

◆ addOverlap()

void PhysicsBehavior::addOverlap ( Object * obj)

Definition at line 1058 of file PhysicsUpdate.cpp.

◆ addVelocityTo()

void PhysicsBehavior::addVelocityTo ( const Coord3D * vel)

Definition at line 1075 of file PhysicsUpdate.cpp.

◆ applyForce()

void PhysicsBehavior::applyForce ( const Coord3D * force)

apply a force at the object's CG

Apply a force at the object's CG

Definition at line 322 of file PhysicsUpdate.cpp.

◆ applyFrictionalForces()

void PhysicsBehavior::applyFrictionalForces ( )
protected

Definition at line 451 of file PhysicsUpdate.cpp.

◆ applyGravitationalForces()

void PhysicsBehavior::applyGravitationalForces ( )
protected

Definition at line 445 of file PhysicsUpdate.cpp.

◆ applyMotiveForce()

void PhysicsBehavior::applyMotiveForce ( const Coord3D * force)

identical to applyForce, except that no forward friction will be applied to the physics this frame. (lateral and z-friction will still be applied.)

Definition at line 419 of file PhysicsUpdate.cpp.

◆ applyRandomRotation()

void PhysicsBehavior::applyRandomRotation ( )

apply a random rotation at the object's CG

Apply a random rotation at the object's CG

Definition at line 379 of file PhysicsUpdate.cpp.

◆ applyShock()

void PhysicsBehavior::applyShock ( const Coord3D * force)

apply a shockwave force against the object's CG

Apply a shocwave force at the object's CG

Definition at line 366 of file PhysicsUpdate.cpp.

◆ applyYPRDamping()

void PhysicsBehavior::applyYPRDamping ( Real factor)
protected

Definition at line 592 of file PhysicsUpdate.cpp.

◆ calcSleepTime()

UpdateSleepTime PhysicsBehavior::calcSleepTime ( ) const
protected

Definition at line 927 of file PhysicsUpdate.cpp.

◆ checkForOverlapCollision()

Bool PhysicsBehavior::checkForOverlapCollision ( Object * other)
protected

Do the collision Cases:

  • The crusheeOther is !OVERLAPPABLE or !CRUSHABLE. Result: return false
  • The crusherMe is !CRUSHER. Result: return false
  • crusher is CRUSHER, crushee is CRUSHABLE but allied. Result: return false
  • crusher is CRUSHER, crushee is OVERLAPPABLE but not CRUSHABLE. Result: return false
  • crushee has no PhysicsBehavior. Result: return false
  • crusher is CRUSHER, crushee is CRUSHABLE, but is too hard. Result: return false
  • crusher is CRUSHER, crushee is CRUSHABLE, hardness ok. Result: crush, return true

Return true if we want to skip having physics push us apart // LORENZEN

Todo
GS To account for different sized crushers, this should be redone as a box or circle test, not a point

Definition at line 1448 of file PhysicsUpdate.cpp.

◆ clearAcceleration()

void PhysicsBehavior::clearAcceleration ( )
inline

This is a force clear for when objects are going out of bounds, so the locomotor can push them back into legal space.

Definition at line 126 of file PhysicsUpdate.h.

◆ doBounceSound()

void PhysicsBehavior::doBounceSound ( const Coord3D & prevPos)
protected

Definition at line 1113 of file PhysicsUpdate.cpp.

◆ getAcceleration()

const Coord3D * PhysicsBehavior::getAcceleration ( ) const
inline

get last frame's acceleration

Definition at line 141 of file PhysicsUpdate.h.

◆ getAerodynamicFriction()

Real PhysicsBehavior::getAerodynamicFriction ( ) const
protected

Definition at line 283 of file PhysicsUpdate.cpp.

◆ getAllowCollideForce()

Bool PhysicsBehavior::getAllowCollideForce ( ) const
inline

Definition at line 212 of file PhysicsUpdate.h.

◆ getAllowToFall()

Bool PhysicsBehavior::getAllowToFall ( ) const
inline

Definition at line 186 of file PhysicsUpdate.h.

◆ getBounceSound()

const AudioEventRTS * PhysicsBehavior::getBounceSound ( )
inline

Definition at line 197 of file PhysicsUpdate.h.

◆ getCenterOfMassOffset()

Real PhysicsBehavior::getCenterOfMassOffset ( ) const
inline

Definition at line 139 of file PhysicsUpdate.h.

◆ getCollide()

virtual CollideModuleInterface * PhysicsBehavior::getCollide ( )
inlinevirtual

Reimplemented from BehaviorModule.

Definition at line 97 of file PhysicsUpdate.h.

◆ getCurrentOverlap()

ObjectID PhysicsBehavior::getCurrentOverlap ( ) const
inline

return object(s) being overlapped

Definition at line 295 of file PhysicsUpdate.h.

◆ getDisabledTypesToProcess()

virtual DisabledMaskType PhysicsBehavior::getDisabledTypesToProcess ( ) const
inlinevirtual

Implements UpdateModuleInterface.

Definition at line 111 of file PhysicsUpdate.h.

◆ getForwardFriction()

Real PhysicsBehavior::getForwardFriction ( ) const
protected

Definition at line 292 of file PhysicsUpdate.cpp.

◆ getForwardSpeed2D()

Real PhysicsBehavior::getForwardSpeed2D ( ) const

compute speed along object's 2d direction vector

Return the current velocity magnitude in the forward direction.
If velocity is opposite facing vector, the returned value will be negative.

Definition at line 963 of file PhysicsUpdate.cpp.

◆ getForwardSpeed3D()

Real PhysicsBehavior::getForwardSpeed3D ( ) const

compute speed along object's 3d direction vector

Return the current velocity magnitude in the forward direction.
If velocity is opposite facing vector, the returned value will be negative.

Definition at line 988 of file PhysicsUpdate.cpp.

◆ getInterfaceMask()

static Int PhysicsBehavior::getInterfaceMask ( void )
inlinestatic

Definition at line 92 of file PhysicsUpdate.h.

◆ getIsInFreeFall()

Bool PhysicsBehavior::getIsInFreeFall ( ) const
inline

Definition at line 189 of file PhysicsUpdate.h.

◆ getIsStunned()

Bool PhysicsBehavior::getIsStunned ( ) const
inline

Definition at line 191 of file PhysicsUpdate.h.

◆ getLastCollidee()

ObjectID PhysicsBehavior::getLastCollidee ( ) const
inline

return object that was last collided with... can be quite old

Definition at line 306 of file PhysicsUpdate.h.

◆ getLateralFriction()

Real PhysicsBehavior::getLateralFriction ( ) const
protected

Definition at line 301 of file PhysicsUpdate.cpp.

◆ getMass()

Real PhysicsBehavior::getMass ( ) const

Definition at line 1097 of file PhysicsUpdate.cpp.

◆ getPreviousOverlap()

ObjectID PhysicsBehavior::getPreviousOverlap ( ) const
inline

return object(s) that were overlapped last frame

Definition at line 301 of file PhysicsUpdate.h.

◆ getTurning()

PhysicsTurningType PhysicsBehavior::getTurning ( void ) const
inline

0 = not turning, -1 = turn negative, 1 = turn positive.

Definition at line 156 of file PhysicsUpdate.h.

◆ getUpdatePhase()

virtual SleepyUpdatePhase PhysicsBehavior::getUpdatePhase ( ) const
inlineprotectedvirtual

Reimplemented from UpdateModule.

Definition at line 223 of file PhysicsUpdate.h.

◆ getVelocity()

const Coord3D * PhysicsBehavior::getVelocity ( ) const
inline

get current velocity

Definition at line 142 of file PhysicsUpdate.h.

◆ getVelocityMagnitude()

Real PhysicsBehavior::getVelocityMagnitude ( ) const

return velocity magnitude (speed)

Definition at line 949 of file PhysicsUpdate.cpp.

◆ getZFriction()

Real PhysicsBehavior::getZFriction ( ) const
protected

Definition at line 310 of file PhysicsUpdate.cpp.

◆ handleBounce()

Bool PhysicsBehavior::handleBounce ( Real oldZ,
Real newZ,
Real groundZ,
Coord3D * bounceForce )
protected

Definition at line 505 of file PhysicsUpdate.cpp.

◆ isCarBombCrateCollide()

virtual Bool PhysicsBehavior::isCarBombCrateCollide ( ) const
inlinevirtual

Implements CollideModuleInterface.

Definition at line 102 of file PhysicsUpdate.h.

◆ isCurrentlyOverlapped()

Bool PhysicsBehavior::isCurrentlyOverlapped ( Object * obj) const

Definition at line 1007 of file PhysicsUpdate.cpp.

◆ isHijackedVehicleCrateCollide()

virtual Bool PhysicsBehavior::isHijackedVehicleCrateCollide ( ) const
inlinevirtual

Implements CollideModuleInterface.

Definition at line 103 of file PhysicsUpdate.h.

◆ isIgnoringCollisionsWith()

Bool PhysicsBehavior::isIgnoringCollisionsWith ( ObjectID id) const

Definition at line 277 of file PhysicsUpdate.cpp.

◆ isMotive()

Bool PhysicsBehavior::isMotive ( ) const

Definition at line 413 of file PhysicsUpdate.cpp.

◆ isRailroad()

virtual Bool PhysicsBehavior::isRailroad ( ) const
inlinevirtual

Implements CollideModuleInterface.

Reimplemented in RailroadBehavior.

Definition at line 104 of file PhysicsUpdate.h.

◆ isSabotageBuildingCrateCollide()

virtual Bool PhysicsBehavior::isSabotageBuildingCrateCollide ( ) const
inlinevirtual

Implements CollideModuleInterface.

Definition at line 106 of file PhysicsUpdate.h.

◆ isSalvageCrateCollide()

virtual Bool PhysicsBehavior::isSalvageCrateCollide ( ) const
inlinevirtual

Implements CollideModuleInterface.

Definition at line 105 of file PhysicsUpdate.h.

◆ onCollide()

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

Resolve the collision between getObject() and other by computing the amount the objects have overlapd, and applying proportional forces to push them apart. Note that this call only applies forces to our object, not to "other". Since the forces should be equal and opposite, this could be optimized.

Todo

Make this work properly for non-cylindrical objects (MSB)

Physics collision resolution is 2D - should it be 3D? (MSB)

Todo
srj – ugh, an awful hack for paradrop problems. fix someday.
Todo
srj – what the hell is this code doing here? ack!

Implements CollideModuleInterface.

Reimplemented in RailroadBehavior.

Definition at line 1165 of file PhysicsUpdate.cpp.

◆ onObjectCreated()

void PhysicsBehavior::onObjectCreated ( void )
virtual

this is called after all the Modules for a given Thing are created; it allows Modules to resolve any inter-Module dependencies.

Reimplemented from Module.

Definition at line 255 of file PhysicsUpdate.cpp.

◆ resetDynamicPhysics()

void PhysicsBehavior::resetDynamicPhysics ( )

Reset all values (vel, accel, etc) to starting values. You should ALMOST NEVER use this; it's intended for cases where you need to nuke everything, like when an existing object goes off the map and you want to bring it back on with all-new values, and want to start with a clean slate. Rule of thumb: if the object was in existence on the map in the previous frame, don't call this... apply forces instead!

Definition at line 427 of file PhysicsUpdate.cpp.

◆ scrubVelocity2D()

void PhysicsBehavior::scrubVelocity2D ( Real desiredVelocity)

This is a force scrub for velocity when ai objects are colliding.

Definition at line 1036 of file PhysicsUpdate.cpp.

◆ scrubVelocityZ()

void PhysicsBehavior::scrubVelocityZ ( Real desiredVelocity)

Definition at line 1019 of file PhysicsUpdate.cpp.

◆ setAllowAirborneFriction()

void PhysicsBehavior::setAllowAirborneFriction ( Bool allow)
inline

Definition at line 182 of file PhysicsUpdate.h.

◆ setAllowBouncing()

void PhysicsBehavior::setAllowBouncing ( Bool allow)
inline

Definition at line 180 of file PhysicsUpdate.h.

◆ setAllowCollideForce()

void PhysicsBehavior::setAllowCollideForce ( Bool allow)
inline

Definition at line 181 of file PhysicsUpdate.h.

◆ setAllowToFall()

void PhysicsBehavior::setAllowToFall ( Bool allow)
inline

Definition at line 178 of file PhysicsUpdate.h.

◆ setAngles()

void PhysicsBehavior::setAngles ( Real yaw,
Real pitch,
Real roll )
Todo
Rotations should be handled by this system as well (MSB)

Definition at line 1082 of file PhysicsUpdate.cpp.

◆ setBounceSound()

void PhysicsBehavior::setBounceSound ( const AudioEventRTS * bounceSound)

Definition at line 601 of file PhysicsUpdate.cpp.

◆ setExtraBounciness()

void PhysicsBehavior::setExtraBounciness ( Real b)
inline

Definition at line 193 of file PhysicsUpdate.h.

◆ setExtraFriction()

void PhysicsBehavior::setExtraFriction ( Real b)
inline

Definition at line 194 of file PhysicsUpdate.h.

◆ setIgnoreCollisionsWith()

void PhysicsBehavior::setIgnoreCollisionsWith ( const Object * obj)

Definition at line 271 of file PhysicsUpdate.cpp.

◆ setImmuneToFallingDamage()

void PhysicsBehavior::setImmuneToFallingDamage ( Bool allow)
inline

Definition at line 183 of file PhysicsUpdate.h.

◆ setIsInFreeFall()

void PhysicsBehavior::setIsInFreeFall ( Bool allow)
inline

Definition at line 188 of file PhysicsUpdate.h.

◆ setMass()

void PhysicsBehavior::setMass ( Real mass)
inline

Definition at line 138 of file PhysicsUpdate.h.

◆ setPitchRate()

void PhysicsBehavior::setPitchRate ( Real pitch)

Definition at line 571 of file PhysicsUpdate.cpp.

◆ setRollRate()

void PhysicsBehavior::setRollRate ( Real roll)

Definition at line 578 of file PhysicsUpdate.cpp.

◆ setStickToGround()

void PhysicsBehavior::setStickToGround ( Bool allow)
inline

Definition at line 179 of file PhysicsUpdate.h.

◆ setStunned()

void PhysicsBehavior::setStunned ( Bool allow)
inline

Definition at line 184 of file PhysicsUpdate.h.

◆ setTurning()

void PhysicsBehavior::setTurning ( PhysicsTurningType turning)
inline

Definition at line 157 of file PhysicsUpdate.h.

◆ setYawRate()

void PhysicsBehavior::setYawRate ( Real yaw)

Definition at line 585 of file PhysicsUpdate.cpp.

◆ testStunnedUnitForDestruction()

void PhysicsBehavior::testStunnedUnitForDestruction ( void )
protected

Test whether unit needs to die because of being on illegal cell, upside down, outside legal bounds

Definition at line 1777 of file PhysicsUpdate.cpp.

◆ transferVelocityTo()

void PhysicsBehavior::transferVelocityTo ( PhysicsBehavior * that) const

add the velocity of 'this' to 'that'... useful when a unit disgorges another unit and you want to maintain relative velocities

Definition at line 1067 of file PhysicsUpdate.cpp.

◆ update()

UpdateSleepTime PhysicsBehavior::update ( void )
virtual

Basic rigid body physics using an Euler integrator.

Todo
Currently, only translations are integrated. Rotations should also be integrated. (MSB)
Todo
Rotation should use torques, and integrate just like forces (MSB)

Implements UpdateModule.

Reimplemented in RailroadBehavior.

Definition at line 627 of file PhysicsUpdate.cpp.

◆ wasPreviouslyOverlapped()

Bool PhysicsBehavior::wasPreviouslyOverlapped ( Object * obj) const

Definition at line 1013 of file PhysicsUpdate.cpp.

◆ wouldLikeToCollideWith()

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

Implements CollideModuleInterface.

Definition at line 101 of file PhysicsUpdate.h.


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