#include <rigidbody.h>
Inheritance diagram for RigidBody:
Public Types | |
Public Member Functions | |
RigidBody () | |
virtual | ~RigidBody () |
virtual SceneNode * | Duplicate () |
const Vector3d & | ApplyForce (const Vector3d &rkForce, const Vector3d &rkPos, bool bLocal=false) |
void | ApplyImpulse (const Vector3d &rkImpulse, const Vector3d &rkPos, bool bLocal=false) |
void | ResetTorque () |
void | ResetForceAndTorque () |
virtual void | Update (float fDeltaTime) |
virtual void | SetAngularVelocity (const Vector3d &rkVelocity) |
Vector3d | GetPointVelocity (const Vector3d &rkPoint, bool bLocal=false) |
const Vector3d & | GetAngularVelocity () const |
void | SetMassiveBlock (const Vector3d &rkDim, float fMass) |
void | SetInvBodyInertiaTensor (const Matrix &rkInvBodyInertiaTensor) |
const Matrix & | GetInvInertiaTensor () const |
void | SetRestitution (float fCoeff) |
float | GetRestitution () const |
void | SetFriction (float fCoeff) |
float | GetFriction () const |
virtual void | PushState () |
virtual void | PopState (bool bSet=true) |
virtual void | ClearState () |
void | SetMass (float fMass) |
float | GetMass () const |
float | GetInvMass () const |
const Vector3d & | ApplyForce (const Vector3d &rkForce) |
void | ApplyImpulse (const Vector3d &rkImpulse) |
void | ResetForce () |
const Vector3d & | GetForce () const |
void | SetVelocity (const Vector3d &rkVelocity) |
const Vector3d & | GetVelocity () const |
virtual void | NotifyUpdate (bool bRecurse=true) |
virtual void | NotifyVolumeUpdate (bool bRecurse=true) |
virtual bool | Render (Frustum *pkFrustum=0, bool bForce=false) |
BoundingVolume * | GetBoundingVolume () |
void | SetBoundingVolume (BoundingVolume *pkVolume) |
SceneEntity * | GetEntity () |
void | SetEntity (SceneEntity *pkEntity, bool bDeleteOld=true) |
void | PrintHierarchy (unsigned int uiLevel=0) |
virtual void | TraverseNode (BaseVisitor &rkVisitor) |
virtual bool | Intersection (BoundingVolume *pkObj, ContactSet *pkContactSet=0) |
virtual bool | Intersection (const Ray &rkRay, ContactSet *pkContactSet=0) |
bool | IsActive () const |
virtual void | Activate () |
virtual void | Deactivate () |
bool | Toggle () |
virtual void | SetTranslation (const Vector3d &rkTranslation, bool bNotifyUpdate=true) |
virtual void | SetRotation (const Quaternion &rkRotation, bool bNotifyUpdate=true) |
virtual void | SetScaling (float fScaling, bool bNotifyUpdate=true) |
void | SetName (const HashString &rstrName) |
const HashString & | GetName () const |
SceneNode * | GetParent () |
virtual int | AttachNode (SceneNode *pkNode, bool bKeepWorldSRT=false) |
virtual int | DetachNode (SceneNode *pkNode) |
void | DetachFromParent () |
const Vector3d & | GetWorldTranslation () |
const Quaternion & | GetWorldRotation () |
float | GetWorldScaling () |
const Matrix & | GetWorldTransform () |
const Matrix & | GetInverseWorldTransform () |
const std::vector< SceneNode * > & | GetChildren () |
SceneNode * | GetByName (const HashString &rstrName, NODESEARCHMODE eMode=BREADTH_FIRST, bool bInitSearch=true) |
virtual void | Traverse (BaseVisitor &rkVisitor, NODESEARCHMODE eMode=DEPTH_FIRST, int iDirection=1, bool bInitSearch=true) |
virtual void | Accept (BaseVisitor &rkVisitor)=0 |
const Vector3d & | GetTranslation () const |
const Quaternion & | GetRotation () const |
float | GetScaling () const |
void | Translate (const Vector3d &rkTranslation, bool bNotifyUpdate=true) |
void | TranslateWorld (const Vector3d &rkTranslation, bool bNotifyUpdate=true) |
void | Rotate (const Quaternion &rkRotation, bool bNotifyUpdate=true) |
void | RotateWorld (const Quaternion &rkRotation, bool bNotifyUpdate=true) |
void | Scale (float fScaling, bool bNotifyUpdate=true) |
Public Attributes | |
bool | m_bManaged |
Room * | m_pkRoom |
bool | m_bIgnoreVolume |
unsigned int | m_uiLastFrame |
Static Public Attributes | |
unsigned int | s_uiFrameCount |
Protected Member Functions | |
virtual bool | UpdateWorld () |
virtual bool | UpdateVolume () |
virtual SceneNode * | Get () |
Static Protected Member Functions | |
template<class NodeType> void | AcceptImpl (NodeType &rkVisited, BaseVisitor &rkVisitor) |
Protected Attributes | |
Vector3d | m_kAngularVelocity |
Vector3d | m_kTorque |
Matrix | m_kInvBodyInertiaTensor |
Matrix | m_kInvInertiaTensor |
Matrix | m_kRotationMatrix |
float | m_fRestitutionCoeff |
float | m_fFrictionCoeff |
Vector3d | m_kForce |
float | m_fMass |
float | m_fInvMass |
Vector3d | m_kVelocity |
SceneEntity * | m_pkEntity |
BoundingVolume * | m_pkBoundingVolume |
bool | m_bNeedVolumeUpdate |
bool | m_bIgnoreVolumeUpdate |
bool | m_bActive |
bool | m_bWorldUpdate |
float | m_fWorldScaling |
Quaternion | m_kWorldRotation |
Vector3d | m_kWorldTranslation |
std::vector< SceneNode * > | m_vpkChildren |
SceneNode * | m_pkParent |
HashString | m_strName |
Matrix | m_kWorldTransform |
Matrix | m_kInverseWorldTransform |
float | m_fScaling |
Quaternion | m_kRotation |
Vector3d | m_kTranslation |
Private Attributes | |
std::vector< RigidBodyState > | m_vkStateStack |
|
|
|
|
|
Duplicate node
Reimplemented from MassParticle. |
|
Apply force to object
|
|
Apply impulse to object
|
|
Reset torque acting on body |
|
Reset both force and torque acting on body |
|
Update by integrating the equations for laws of motion
Reimplemented from MassParticle. |
|
Set angular velocity
|
|
Get velocity of point relative center of rigidbody
|
|
|
|
Set body as massive block
|
|
Set inverse inertia tensor (in local body space)
|
|
|
|
Set coefficient of restitution
|
|
|
|
Set coefficient of friction
|
|
|
|
Push current state to stack Reimplemented from MassParticle. |
|
Restore state from stack
Reimplemented from MassParticle. |
|
Clear state stack Reimplemented from MassParticle. |
|
Set mass of particle
|
|
|
|
|
|
Apply force to this particle
|
|
Apply impulse to this particle
|
|
Reset force acting on particle |
|
Get current force acting on object |
|
Set velocity
|
|
|
|
Updates world SRT data cache
Reimplemented from HierarchyNode< SceneNode >. |
|
Updates bounding volume for subtree rooted at this node
|
|
Used to get this as correct type
Reimplemented from HierarchyNode< SceneNode >. |
|
Set world udpate flag. If flag is set, a call to any of the GetWorldScaling, GetWorldRotation, GetWorldTranslation will cause world cache data to be updated. Optionally recurses on all child nodes (default).
Reimplemented from HierarchyNode< SceneNode >. |
|
Set bounding volume udpate flag. If flag is set, a call to any of the GetBoundingVolume will cause volume to be remerged from child nodes and entity. Optionally recurses on parent (default).
|
|
If node is active, render entity (if any) and any child nodes.
Reimplemented from RenderEntity. |
|
Get bounding volume
|
|
Set bounding volume object. Bounding volume transformation should be in world coordinate system
|
|
Get scene entity attached to this node
|
|
Attach new scene entity to this node. If flag set, Will delete previous entity (if any)
|
|
Debug output. Print hierarchy of nodes
|
|
Also traverse the entitiy
Reimplemented from HierarchyNode< SceneNode >. |
|
Intersection test with unknown object type
|
|
Intersection test with ray
|
|
Query state of object
|
|
Activate object |
|
Deactivate object |
|
Toggle active state. This method does not need to be overloaded, it is only a wrapper to Activate and Deactivate
|
|
Set position relative parent node. Will set flag to update world cache data, and optionally recurse and flag child nodes to update data
Reimplemented from SRTNode. |
|
Set rotation relative parent node. Will set flag to update world cache data, and optionally recurse and flag child nodes to update data
Reimplemented from SRTNode. |
|
Set uniform scaling relative parent node. Will set flag to update world cache data, and optionally recurse and flag child nodes to update data
Reimplemented from SRTNode. |
|
Set name
|
|
|
|
|
|
Attach node. If the node is attached to a parent, detach it first. This will cause the node to get it's world SRT data as local SRT data. If bKeepWorldSRT is set, node will be updated with inverse of this (new parent) node's SRT data, effectively keeping it intact in world space. If flag not set, node will effectivaly get new parent world SRT data added to own (used in initialization phase, for example).
Reimplemented in Room. |
|
Detach node. The node will store world SRT data in local SRT data.
Reimplemented in Room. |
|
Detach this node from parent, if any. Will store world SRT data (and update first if needed) in local SRT data to remain in same world position and orientation. |
|
Get position relative world coordinate system origo. The world SRT data is the combined hierarchial data of any parent nodes and this node.
|
|
Get rotation relative world unrotated coordinate system. The world SRT data is the combined hierarchial data of any parent nodes and this node.
|
|
Get total unform scaling factor relative world scale. The world SRT data is the combined hierarchial data of any parent nodes and this node.
|
|
Get total transform matrix relative world coordinate system origo. The world SRT data is the combined hierarchial data of any parent nodes and this node.
|
|
Get inverse total transform matrix relative world coordinate system origo. The world SRT data is the combined hierarchial data of any parent nodes and this node.
|
|
Get all child nodes
|
|
Search hierarchy for named node, including this node. Will return first node found along selected search mode.
|
|
Traverse the hierarchy applying the visitor to the nodes.
|
|
Accept visitors if implementation available
|
|
Accept a visitor
|
|
|
|
|
|
|
|
Translate node from current position, in local (along current rotated axes) coordinate system. Will call SetTranslation() for setting new translation of node, derived classes do not need to overload this method directly. Not affected by current scaling.
|
|
Translate node from current position, in world (along unrotated axes) coordinate system. Will call SetTranslation() for setting new translation of node, derived classes do not need to overload this method directly. Not affected by current scaling.
|
|
Rotate node in local (current rotation) coordinate system. Will call SetRotation() for setting new rotation of node, derived classes do not need to overload this method directly. Not affected by current scaling.
|
|
Rotate node in world (unrotated) coordinate system. Will call SetRotation() for setting new rotation of node, derived classes do not need to overload this method directly. Not affected by current scaling.
|
|
Scale node by uniform factor. Will use SetScaling for setting new scaling of node, derived classes do not need to overload this method directly. Must be >0, where a value of 1.0f indicates no scaling
|
|
State stack Reimplemented from MassParticle. |
|
Angular velocity |
|
Torque |
|
Inverted body space inertia tensor |
|
Inverted inertia tensor |
|
Rotation as matrix |
|
Coefficient of restitution |
|
Coefficient of friction |
|
Flag indicating if this node is managed by physics simulator, if set will force Update method to not integrate equations |
|
Applied force |
|
Mass of particle |
|
Inverted mass, precalculated |
|
Velocity |
|
Scene entity contained in this node |
|
Bounding volume for subtree rooted at this node |
|
Flag indicating bounding volume needs remerging |
|
Internal flag for indicating we should ignore requests for volume update |
|
Room we are attached to Reimplemented in Camera, and ParticleSystem. |
|
Flag indicating parent node should ignore this node when calculating bounding volume |
|
Active flag |
|
Frame counter (at 500 frames per second, can be active ~100 days continously before loop, and then it will just skip one frame -> safe enough) |
|
Last frame count we were rendered |
|
Flag indicating we need to update world relative SRT information |
|
Total scaling relative world (cached) |
|
Total rotation relative world (cached) |
|
Total translation relative world (cached) |
|
Child nodes |
|
Parent node |
|
Name |
|
Total transformation matrix relative world (cached) |
|
Total inverse transformation matrix relative world (cached) |
|
Uniform scaling factor (must be >0, default 1) |
|
Rotation |
|
Translation |