Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

sp::physics::PhysXSimulator Class Reference

#include <spPhysXSimulator.hpp>

Inheritance diagram for sp::physics::PhysXSimulator:
sp::physics::PhysicsSimulator

List of all members.

Public Member Functions

 PhysXSimulator ()
virtual ~PhysXSimulator ()
virtual io::stringc getVersion () const
 Returns the version of the physics system.
virtual void updateSimulation (const f32 StepTime=1.0f/60.0f)
virtual PhysicsMaterialcreateMaterial (f32 StaticFriction=0.5f, f32 DynamicFriction=0.5f, f32 Restitution=0.3f)
virtual StaticPhysicsObjectcreateStaticObject (PhysicsMaterial *Material, scene::Mesh *MeshGeom)
virtual RigidBodycreateRigidBody (PhysicsMaterial *Material, const ERigidBodies Type, scene::SceneNode *RootNode, const SRigidBodyConstruction &Construct=SRigidBodyConstruction())
virtual RigidBodycreateRigidBody (PhysicsMaterial *Material, scene::Mesh *Mesh)
virtual PhysicsJointcreateJoint (const EPhysicsJoints Type, PhysicsBaseObject *Object, const SPhysicsJointConstruct &Construct)
 Creates a new physics joint (also called "constraint").
virtual PhysicsJointcreateJoint (const EPhysicsJoints Type, PhysicsBaseObject *ObjectA, PhysicsBaseObject *ObjectB, const SPhysicsJointConstruct &Construct)

Protected Member Functions

PxScene * createScene ()
template<typename T >
void releaseObject (T *&Object)
PxVec3 convert (const dim::vector3df &Vec) const

Static Protected Member Functions

static scene::Transformation convert (const PxTransform &Transform)

Protected Attributes

PxPhysics * PxDevice_
PxFoundation * PxFoundation_
PxProfileZoneManager * PxProfile_
PxCooking * PxCooking_
PxScene * PxScene_

Constructor & Destructor Documentation

sp::physics::PhysXSimulator::PhysXSimulator (  ) 
virtual sp::physics::PhysXSimulator::~PhysXSimulator (  )  [virtual]

Member Function Documentation

PxVec3 sp::physics::PhysXSimulator::convert ( const dim::vector3df Vec  )  const [inline, protected]
static scene::Transformation sp::physics::PhysXSimulator::convert ( const PxTransform &  Transform  )  [static, protected]
virtual PhysicsJoint* sp::physics::PhysXSimulator::createJoint ( const EPhysicsJoints  Type,
PhysicsBaseObject Object,
const SPhysicsJointConstruct Construct 
) [virtual]

Creates a new physics joint (also called "constraint").

Implements sp::physics::PhysicsSimulator.

virtual PhysicsJoint* sp::physics::PhysXSimulator::createJoint ( const EPhysicsJoints  Type,
PhysicsBaseObject ObjectA,
PhysicsBaseObject ObjectB,
const SPhysicsJointConstruct Construct 
) [virtual]

Adds a new joint connected child body to this rigid body.

Parameters:
Child,: Specifies the child rigid body which is to be added with a joint. If this parameter is 0 this rigid body is the child and will be appended to the physics world.
Type,: Specifies the type of the joint. E.g. when you want to have a physics door use the JOINT_HINGE type.
PivotPoint,: Specifies the global point where the joint is to be set.
Returns:
Pointer to the new BodyJoint object.

Implements sp::physics::PhysicsSimulator.

virtual PhysicsMaterial* sp::physics::PhysXSimulator::createMaterial ( f32  StaticFriction = 0.5f,
f32  DynamicFriction = 0.5f,
f32  Restitution = 0.3f 
) [virtual]
virtual RigidBody* sp::physics::PhysXSimulator::createRigidBody ( PhysicsMaterial Material,
const ERigidBodies  Type,
scene::SceneNode RootNode,
const SRigidBodyConstruction Construct = SRigidBodyConstruction() 
) [virtual]

Creates a new physics rigid body. This is an interactive physics object.

Parameters:
Material,: Specifies the physics material which is to be used for the rigid body.
RootNode,: Specifies the root scene node which is to be manipulated in its location and orientation.
Type,: Specifies the type of the body.
Construct,: Specifies the construction of the body. E.g. size, radius and/or height.

Implements sp::physics::PhysicsSimulator.

virtual RigidBody* sp::physics::PhysXSimulator::createRigidBody ( PhysicsMaterial Material,
scene::Mesh Mesh 
) [virtual]

Creates a new mesh physics rigid body. If you only want to use the mesh as the physics geometry you can change the root node by calling RigidBody::setRootNode".

Parameters:
Material,: Specifies the physics material which is to be used for the rigid body.
MeshGeom,: Specifies the root mesh node.
Note:
Don't use to large mesh geometries for rigid bodies. This kind of physics simulation is very time consuming!

Implements sp::physics::PhysicsSimulator.

PxScene* sp::physics::PhysXSimulator::createScene (  )  [protected]
virtual StaticPhysicsObject* sp::physics::PhysXSimulator::createStaticObject ( PhysicsMaterial Material,
scene::Mesh Mesh 
) [virtual]

Creates a new physics static body. This is a none interactive environment object. Those objects represents the physics world.

Implements sp::physics::PhysicsSimulator.

virtual io::stringc sp::physics::PhysXSimulator::getVersion (  )  const [virtual]

Returns the version of the physics system.

Implements sp::physics::PhysicsSimulator.

template<typename T >
void sp::physics::PhysXSimulator::releaseObject ( T *&  Object  )  [inline, protected]
virtual void sp::physics::PhysXSimulator::updateSimulation ( const f32  StepTime = 1.0f/60.0f  )  [virtual]

Updates the whole simulation. Call this in each frame of your game loop.

Parameters:
StepTime,: Specifies the speed of simulation for the current frame.

Implements sp::physics::PhysicsSimulator.


Member Data Documentation

PxFoundation* sp::physics::PhysXSimulator::PxFoundation_ [protected]
PxProfileZoneManager* sp::physics::PhysXSimulator::PxProfile_ [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines