irrDynamics
 All Classes Functions
Static Public Member Functions | List of all members
irrDynamics Class Reference

Static Public Member Functions

static irrDynamicsgetInstance ()
 
static void simStep (const irr::u32 &curTimeStamp)
 
static void shutdown ()
 
static void addTerrain (irr::scene::ITerrainSceneNode *terrain, irr::u32 lodLevel=2)
 
static class btRigidBody * addSphericalObject (irr::scene::ISceneNode *node, irr::f32 radius, irr::f32 mass)
 Add a scene node that is represented as spherical behavior. More...
 
static class btRigidBody * addBoxObject (irr::scene::ISceneNode *node, irr::f32 mass)
 Add a scene node that is represented as a sturdy box. More...
 
static class btRigidBody * addFloor (const irr::core::vector3df &normal=irr::core::vector3df(0.f, 1.f, 0.f), const irr::core::vector3df &offset=irr::core::vector3df(0.f, 0.f, 0.f))
 Add an infinite floor plane to the scene. More...
 
static bool createHingeConstraint (irr::scene::ISceneNode *nodeA, irr::scene::ISceneNode *nodeB, const irr::core::vector3df &pivotInA, const irr::core::vector3df &pivotInB, const irr::core::vector3df &axisInA, const irr::core::vector3df &axisInB)
 Create a hinge relation between two objects. More...
 
static bool createPoint2PointConstraint (irr::scene::ISceneNode *nodeA, irr::scene::ISceneNode *nodeB, const irr::core::vector3df &pivotInA, const irr::core::vector3df &pivotInB)
 Create a point-to-point relation between two objects. More...
 
static void removeObject (irr::scene::ISceneNode *node)
 Remove an object from the physics. More...
 
static void applyCentralForce (irr::scene::ISceneNode *node, const irr::core::vector3df &force)
 Applies a pushing force to the object. More...
 
static void setDamping (irr::scene::ISceneNode *node, irr::f32 linearDamping, irr::f32 angularDamping)
 
static void setPosition (irr::scene::ISceneNode *node, const irr::core::vector3df &newPos)
 
static void debugDraw ()
 

Member Function Documentation

static class btRigidBody* irrDynamics::addBoxObject ( irr::scene::ISceneNode *  node,
irr::f32  mass 
)
static

Add a scene node that is represented as a sturdy box.

This method adds an object with block-like behavior to the physics, such as a CubeSceneNode. Its dimensions are calculated using the current axis-aligned bounding box.

Parameters
nodeThe scene node to be animated by Bullet.
massThe mass in units assigned to the object.
Returns
The corresponding btRigidBody, if addidional parameters are desired to be set.
static class btRigidBody* irrDynamics::addFloor ( const irr::core::vector3df &  normal = irr::core::vector3df(0.f, 1.f, 0.f),
const irr::core::vector3df &  offset = irr::core::vector3df(0.f, 0.f, 0.f) 
)
static

Add an infinite floor plane to the scene.

Whenever an infinite floor catching all your objects is needed, use this method

Parameters
normalThe normal vector of the floor plane. Default lays the plane along x- and z-axis (y up).
offsetThe offset from the origin. If normal is default, only the y-value matters here (vert offset).
Returns
The corresponding btRigidBody, if addidional parameters are desired to be set.
static class btRigidBody* irrDynamics::addSphericalObject ( irr::scene::ISceneNode *  node,
irr::f32  radius,
irr::f32  mass 
)
static

Add a scene node that is represented as spherical behavior.

This method adds an object with ball-like behavior to the physics, such as a SphereSceneNode.

Parameters
nodeThe scene node to be animated by Bullet.
radiusThe radius of the sphere in irrlicht units.
massThe mass in units assigned to the object.
Returns
The corresponding btRigidBody, if addidional parameters are desired to be set.
static void irrDynamics::applyCentralForce ( irr::scene::ISceneNode *  node,
const irr::core::vector3df &  force 
)
static

Applies a pushing force to the object.

To move an object in a physics engine you do not set its position but you push it towards that place. Use this method to apply such a push represented as a 3D vector. As expected, the 'longer' the vector, the more powerful the push will be.

Parameters
nodeThe scene node the force should be applied to.
forceThe force to apply, the vector represents its direction, the vector length its power.
static bool irrDynamics::createHingeConstraint ( irr::scene::ISceneNode *  nodeA,
irr::scene::ISceneNode *  nodeB,
const irr::core::vector3df &  pivotInA,
const irr::core::vector3df &  pivotInB,
const irr::core::vector3df &  axisInA,
const irr::core::vector3df &  axisInB 
)
static

Create a hinge relation between two objects.

This method physically attaches one scene node to the other in a hinge-like (swinging) relation.

Note
Both scene nodes have to be already added to the sim.
Parameters
nodeAThe "parent" node the swinging one is attached to.
nodeBThe child element that will be animated by that relation.
pivotInAA position relative to nodeA where the hinge relation will be placed.
pivotInBA position relative to nodeB where the hinge relation will be placed.
axisInAThe axis in nodeA the hinge rotates around.
axisInBThe axis in nodeB the hinge rotates around.
Returns
True, when both nodes were found in the physics representation and the relation was created.
static bool irrDynamics::createPoint2PointConstraint ( irr::scene::ISceneNode *  nodeA,
irr::scene::ISceneNode *  nodeB,
const irr::core::vector3df &  pivotInA,
const irr::core::vector3df &  pivotInB 
)
static

Create a point-to-point relation between two objects.

More general than a hinge relation, the p2p can freely swing around all axis.

Note
Both scene nodes have to be already added to the sim.
Parameters
nodeAThe "parent" node the swinging one is attached to.
nodeBThe child element that will be animated by that relation.
pivotInAA position relative to nodeA where the hinge relation will be placed.
pivotInBA position relative to nodeB where the hinge relation will be placed.
Returns
True, when both nodes were found in the physics representation and the relation was created.
static void irrDynamics::removeObject ( irr::scene::ISceneNode *  node)
static

Remove an object from the physics.

Call this whenever you either remove the corresponding scene node from the ISceneManager or you don't want to have it animated by the physics anymore.

Parameters
nodeThe scene node to be removed from the physics.

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