#include <PhysicsUpdate.h>
Inherits UpdateModule, and CollideModuleInterface.
Inherited by RailroadBehavior.
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 ModuleData * | friend_newModuleData (INI *ini) |
Simple rigid body physics update module
Definition at line 81 of file PhysicsUpdate.h.
| PhysicsBehavior::PhysicsBehavior | ( | Thing * | thing, |
| const ModuleData * | moduleData ) |
Definition at line 206 of file PhysicsUpdate.cpp.
| void PhysicsBehavior::addOverlap | ( | Object * | obj | ) |
Definition at line 1058 of file PhysicsUpdate.cpp.
| void PhysicsBehavior::addVelocityTo | ( | const Coord3D * | vel | ) |
Definition at line 1075 of file PhysicsUpdate.cpp.
| 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.
|
protected |
Definition at line 451 of file PhysicsUpdate.cpp.
|
protected |
Definition at line 445 of file PhysicsUpdate.cpp.
| 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.
| 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.
| 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.
|
protected |
Definition at line 592 of file PhysicsUpdate.cpp.
|
protected |
Definition at line 927 of file PhysicsUpdate.cpp.
Do the collision Cases:
Return true if we want to skip having physics push us apart // LORENZEN
Definition at line 1448 of file PhysicsUpdate.cpp.
|
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.
|
protected |
Definition at line 1113 of file PhysicsUpdate.cpp.
|
inline |
get last frame's acceleration
Definition at line 141 of file PhysicsUpdate.h.
|
protected |
Definition at line 283 of file PhysicsUpdate.cpp.
|
inline |
Definition at line 212 of file PhysicsUpdate.h.
|
inline |
Definition at line 186 of file PhysicsUpdate.h.
|
inline |
Definition at line 197 of file PhysicsUpdate.h.
|
inline |
Definition at line 139 of file PhysicsUpdate.h.
|
inlinevirtual |
Reimplemented from BehaviorModule.
Definition at line 97 of file PhysicsUpdate.h.
|
inline |
return object(s) being overlapped
Definition at line 295 of file PhysicsUpdate.h.
|
inlinevirtual |
Implements UpdateModuleInterface.
Definition at line 111 of file PhysicsUpdate.h.
|
protected |
Definition at line 292 of file PhysicsUpdate.cpp.
| 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.
| 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.
|
inlinestatic |
Definition at line 92 of file PhysicsUpdate.h.
|
inline |
Definition at line 189 of file PhysicsUpdate.h.
|
inline |
Definition at line 191 of file PhysicsUpdate.h.
|
inline |
return object that was last collided with... can be quite old
Definition at line 306 of file PhysicsUpdate.h.
|
protected |
Definition at line 301 of file PhysicsUpdate.cpp.
| Real PhysicsBehavior::getMass | ( | ) | const |
Definition at line 1097 of file PhysicsUpdate.cpp.
|
inline |
return object(s) that were overlapped last frame
Definition at line 301 of file PhysicsUpdate.h.
|
inline |
0 = not turning, -1 = turn negative, 1 = turn positive.
Definition at line 156 of file PhysicsUpdate.h.
|
inlineprotectedvirtual |
Reimplemented from UpdateModule.
Definition at line 223 of file PhysicsUpdate.h.
|
inline |
get current velocity
Definition at line 142 of file PhysicsUpdate.h.
| Real PhysicsBehavior::getVelocityMagnitude | ( | ) | const |
return velocity magnitude (speed)
Definition at line 949 of file PhysicsUpdate.cpp.
|
protected |
Definition at line 310 of file PhysicsUpdate.cpp.
|
protected |
Definition at line 505 of file PhysicsUpdate.cpp.
|
inlinevirtual |
Implements CollideModuleInterface.
Definition at line 102 of file PhysicsUpdate.h.
Definition at line 1007 of file PhysicsUpdate.cpp.
|
inlinevirtual |
Implements CollideModuleInterface.
Definition at line 103 of file PhysicsUpdate.h.
Definition at line 277 of file PhysicsUpdate.cpp.
| Bool PhysicsBehavior::isMotive | ( | ) | const |
Definition at line 413 of file PhysicsUpdate.cpp.
|
inlinevirtual |
Implements CollideModuleInterface.
Reimplemented in RailroadBehavior.
Definition at line 104 of file PhysicsUpdate.h.
|
inlinevirtual |
Implements CollideModuleInterface.
Definition at line 106 of file PhysicsUpdate.h.
|
inlinevirtual |
Implements CollideModuleInterface.
Definition at line 105 of file PhysicsUpdate.h.
|
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.
Make this work properly for non-cylindrical objects (MSB)
Physics collision resolution is 2D - should it be 3D? (MSB)
Implements CollideModuleInterface.
Reimplemented in RailroadBehavior.
Definition at line 1165 of file PhysicsUpdate.cpp.
|
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.
| 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.
| 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.
| void PhysicsBehavior::scrubVelocityZ | ( | Real | desiredVelocity | ) |
Definition at line 1019 of file PhysicsUpdate.cpp.
|
inline |
Definition at line 182 of file PhysicsUpdate.h.
|
inline |
Definition at line 180 of file PhysicsUpdate.h.
|
inline |
Definition at line 181 of file PhysicsUpdate.h.
|
inline |
Definition at line 178 of file PhysicsUpdate.h.
Definition at line 1082 of file PhysicsUpdate.cpp.
| void PhysicsBehavior::setBounceSound | ( | const AudioEventRTS * | bounceSound | ) |
Definition at line 601 of file PhysicsUpdate.cpp.
|
inline |
Definition at line 193 of file PhysicsUpdate.h.
|
inline |
Definition at line 194 of file PhysicsUpdate.h.
| void PhysicsBehavior::setIgnoreCollisionsWith | ( | const Object * | obj | ) |
Definition at line 271 of file PhysicsUpdate.cpp.
|
inline |
Definition at line 183 of file PhysicsUpdate.h.
|
inline |
Definition at line 188 of file PhysicsUpdate.h.
|
inline |
Definition at line 138 of file PhysicsUpdate.h.
| void PhysicsBehavior::setPitchRate | ( | Real | pitch | ) |
Definition at line 571 of file PhysicsUpdate.cpp.
| void PhysicsBehavior::setRollRate | ( | Real | roll | ) |
Definition at line 578 of file PhysicsUpdate.cpp.
|
inline |
Definition at line 179 of file PhysicsUpdate.h.
|
inline |
Definition at line 184 of file PhysicsUpdate.h.
|
inline |
Definition at line 157 of file PhysicsUpdate.h.
| void PhysicsBehavior::setYawRate | ( | Real | yaw | ) |
Definition at line 585 of file PhysicsUpdate.cpp.
|
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.
| 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.
|
virtual |
Basic rigid body physics using an Euler integrator.
Implements UpdateModule.
Reimplemented in RailroadBehavior.
Definition at line 627 of file PhysicsUpdate.cpp.
Definition at line 1013 of file PhysicsUpdate.cpp.
Implements CollideModuleInterface.
Definition at line 101 of file PhysicsUpdate.h.