Third party library extension: "Newton Game Dynamics" (v.2.0) physics simulation engine. More...
#include <spNewtonSimulator.hpp>
Public Member Functions | |
NewtonSimulator () | |
virtual | ~NewtonSimulator () |
virtual io::stringc | getVersion () const |
Returns the version of the physics system. | |
virtual void | updateSimulation (const f32 StepTime=1.0f/60.0f) |
virtual void | setGravity (const dim::vector3df &Gravity) |
virtual PhysicsMaterial * | createMaterial (f32 StaticFriction=0.5f, f32 DynamicFriction=0.5f, f32 Restitution=1.0f) |
virtual StaticPhysicsObject * | createStaticObject (PhysicsMaterial *Material, scene::Mesh *MeshGeom) |
virtual RigidBody * | createRigidBody (PhysicsMaterial *Material, const ERigidBodies Type, scene::SceneNode *RootNode, const SRigidBodyConstruction &Construct=SRigidBodyConstruction()) |
virtual RigidBody * | createRigidBody (PhysicsMaterial *Material, scene::Mesh *Mesh) |
virtual PhysicsJoint * | createJoint (const EPhysicsJoints Type, PhysicsBaseObject *Object, const SPhysicsJointConstruct &Construct) |
Creates a new physics joint (also called "constraint"). | |
virtual PhysicsJoint * | createJoint (const EPhysicsJoints Type, PhysicsBaseObject *ObjectA, PhysicsBaseObject *ObjectB, const SPhysicsJointConstruct &Construct) |
virtual void | setThreadCount (s32 Count) |
Sets the count of threads used for physics computations. | |
virtual s32 | getThreadCount () const |
Returns the count of threads. | |
virtual void | setSolverModel (s32 Model) |
Static Public Member Functions | |
static void | setContactCallback (const PhysicsContactCallback &Callback) |
Sets the contact callback. This callback procedure will be called when a collision contact occured. | |
static NewtonWorld * | getNewtonWorld () |
Returns a pointer to the current NewtonWorld opject. | |
Protected Member Functions | |
virtual RigidBody * | allocRigidBody (const ERigidBodies Type, const SRigidBodyConstruction &Construct) |
virtual RigidBody * | allocRigidBody (scene::Mesh *MeshGeom) |
Static Protected Attributes | |
static NewtonWorld * | NtWorld_ |
Third party library extension: "Newton Game Dynamics" (v.2.0) physics simulation engine.
sp::physics::NewtonSimulator::NewtonSimulator | ( | ) |
virtual sp::physics::NewtonSimulator::~NewtonSimulator | ( | ) | [virtual] |
virtual RigidBody* sp::physics::NewtonSimulator::allocRigidBody | ( | const ERigidBodies | Type, | |
const SRigidBodyConstruction & | Construct | |||
) | [protected, virtual] |
virtual RigidBody* sp::physics::NewtonSimulator::allocRigidBody | ( | scene::Mesh * | MeshGeom | ) | [protected, virtual] |
virtual PhysicsJoint* sp::physics::NewtonSimulator::createJoint | ( | const EPhysicsJoints | Type, | |
PhysicsBaseObject * | ObjectA, | |||
PhysicsBaseObject * | ObjectB, | |||
const SPhysicsJointConstruct & | Construct | |||
) | [virtual] |
Adds a new joint connected child body to this rigid body.
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. |
Implements sp::physics::PhysicsSimulator.
virtual PhysicsJoint* sp::physics::NewtonSimulator::createJoint | ( | const EPhysicsJoints | Type, | |
PhysicsBaseObject * | Object, | |||
const SPhysicsJointConstruct & | Construct | |||
) | [virtual] |
Creates a new physics joint (also called "constraint").
Implements sp::physics::PhysicsSimulator.
virtual PhysicsMaterial* sp::physics::NewtonSimulator::createMaterial | ( | f32 | StaticFriction = 0.5f , |
|
f32 | DynamicFriction = 0.5f , |
|||
f32 | Restitution = 1.0f | |||
) | [virtual] |
Implements sp::physics::PhysicsSimulator.
virtual RigidBody* sp::physics::NewtonSimulator::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".
Material,: | Specifies the physics material which is to be used for the rigid body. | |
MeshGeom,: | Specifies the root mesh node. |
Implements sp::physics::PhysicsSimulator.
virtual RigidBody* sp::physics::NewtonSimulator::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.
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 StaticPhysicsObject* sp::physics::NewtonSimulator::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.
static NewtonWorld* sp::physics::NewtonSimulator::getNewtonWorld | ( | ) | [static] |
Returns a pointer to the current NewtonWorld opject.
virtual s32 sp::physics::NewtonSimulator::getThreadCount | ( | ) | const [virtual] |
Returns the count of threads.
Reimplemented from sp::physics::PhysicsSimulator.
virtual io::stringc sp::physics::NewtonSimulator::getVersion | ( | ) | const [virtual] |
Returns the version of the physics system.
Implements sp::physics::PhysicsSimulator.
static void sp::physics::NewtonSimulator::setContactCallback | ( | const PhysicsContactCallback & | Callback | ) | [static] |
Sets the contact callback. This callback procedure will be called when a collision contact occured.
Reimplemented from sp::physics::PhysicsSimulator.
virtual void sp::physics::NewtonSimulator::setGravity | ( | const dim::vector3df & | Gravity | ) | [virtual] |
Sets the gravity for each object. You can also set the gravity individually for each rigid body.
Gravity,: | Specifies the gravity vector which is to be set. By default (0 | -9.81 | 0). |
Reimplemented from sp::physics::PhysicsSimulator.
virtual void sp::physics::NewtonSimulator::setSolverModel | ( | s32 | Model | ) | [virtual] |
Sets the solver model. Use higher values if speed is more important than accuracy.
Model,: | If 0 the accuracy is exact. If greater than 0 you can configure the accuracy if speed is more important. |
Reimplemented from sp::physics::PhysicsSimulator.
virtual void sp::physics::NewtonSimulator::setThreadCount | ( | s32 | Count | ) | [virtual] |
Sets the count of threads used for physics computations.
Reimplemented from sp::physics::PhysicsSimulator.
virtual void sp::physics::NewtonSimulator::updateSimulation | ( | const f32 | StepTime = 1.0f/60.0f |
) | [virtual] |
Updates the whole simulation. Call this in each frame of your game loop.
StepTime,: | Specifies the speed of simulation for the current frame. |
Implements sp::physics::PhysicsSimulator.
NewtonWorld* sp::physics::NewtonSimulator::NtWorld_ [static, protected] |