PixelLightAPI
.
|
Abstract PL physics world (also called 'simulator') base class. More...
#include <World.h>
Public Types | |
enum | EBodyPairFlags { Ignore = 1<<0 } |
Body pair flags. More... | |
Public Member Functions | |
pl_class (PLPHYSICS_RTTI_EXPORT, World,"PLPhysics", PLCore::Object,"Abstract PL physics world (also called 'simulator') base class") pl_signal_1(SignalContact | |
virtual PLPHYSICS_API | ~World () |
Destructor. | |
virtual Body * | CreateBodyBox (const PLMath::Vector3 &vDimension, bool bStatic=false)=0 |
Creates a physics box body. | |
virtual Body * | CreateBodySphere (float fRadius, bool bStatic=false)=0 |
Creates a physics sphere body. | |
virtual Body * | CreateBodyEllipsoid (const PLMath::Vector3 &vRadius, bool bStatic=false)=0 |
Creates a physics ellipsoid body. | |
virtual Body * | CreateBodyConvexHull (PLMesh::MeshManager &cMeshManager, const PLCore::String &sMesh, const PLMath::Vector3 &vMeshScale=PLMath::Vector3::One, bool bStatic=false)=0 |
Creates a physics convex hull body. | |
virtual Body * | CreateBodyMesh (PLMesh::MeshManager &cMeshManager, const PLCore::String &sMesh, const PLMath::Vector3 &vMeshScale=PLMath::Vector3::One, bool bOptimize=false)=0 |
Creates a physics mesh body. | |
virtual Body * | CreateBodyTerrain (PLCore::uint32 nWidth, PLCore::uint32 nHeight, const float fTerrain[], const PLMath::Vector3 &vBoxMin, const PLMath::Vector3 &vBoxMax, const PLMath::Vector3 &vScale)=0 |
Creates a physics terrain body. | |
virtual Body * | CreateBodyCylinder (float fRadius, float fHeight, bool bStatic=false)=0 |
Creates a physics cylinder body. | |
virtual Body * | CreateBodyCone (float fRadius, float fHeight, bool bStatic=false)=0 |
Creates a physics cone body. | |
virtual Body * | CreateBodyCapsule (float fRadius, float fHeight, bool bStatic=false)=0 |
Creates a physics capsule body. | |
virtual Body * | CreateBodyChamferCylinder (float fRadius, float fHeight, bool bStatic=false)=0 |
Creates a physics chamfer cylinder body. | |
virtual Joint * | CreateJointBall (Body *pParentBody, Body *pChildBody, const PLMath::Vector3 &vPivotPoint, const PLMath::Vector3 &vPinDir)=0 |
Creates a physics ball and socket joint. | |
virtual Joint * | CreateJointSlider (Body *pParentBody, Body *pChildBody, const PLMath::Vector3 &vPivotPoint, const PLMath::Vector3 &vPinDir)=0 |
Creates a physics slider joint. | |
virtual Joint * | CreateJointHinge (Body *pParentBody, Body *pChildBody, const PLMath::Vector3 &vPivotPoint, const PLMath::Vector3 &vPinDir)=0 |
Creates a physics hinge joint. | |
virtual Joint * | CreateJointUniversal (Body *pParentBody, Body *pChildBody, const PLMath::Vector3 &vPivotPoint, const PLMath::Vector3 &vPinDir1, const PLMath::Vector3 &vPinDir2)=0 |
Creates a physics universal joint. | |
virtual Joint * | CreateJointCorkscrew (Body *pParentBody, Body *pChildBody, const PLMath::Vector3 &vPivotPoint, const PLMath::Vector3 &vPinDir)=0 |
Creates a physics corkscrew joint. | |
virtual Joint * | CreateJointUpVector (Body &cParentBody, const PLMath::Vector3 &vPinDir)=0 |
Creates a physics up vector joint. | |
virtual Sensor * | CreateSensorRaycast (const PLMath::Vector3 &vStart=PLMath::Vector3::Zero, const PLMath::Vector3 &vEnd=PLMath::Vector3::Zero, PLCore::uint32 nFlags=0)=0 |
Creates a physics ray cast sensor. | |
virtual Sensor * | CreateSensorAABoundingBox (const PLMath::Vector3 &vMin=PLMath::Vector3::Zero, const PLMath::Vector3 &vMax=PLMath::Vector3::Zero, PLCore::uint32 nFlags=0)=0 |
Creates a physics axis aligned bounding box sensor. | |
virtual void | GetWorldSize (PLMath::Vector3 &vMin, PLMath::Vector3 &vMax) const =0 |
Returns the world size. | |
virtual void | SetWorldSize (const PLMath::Vector3 &vMin=PLMath::Vector3(-10000.0f,-10000.0f,-10000.0f), const PLMath::Vector3 &vMax=PLMath::Vector3(10000.0f, 10000.0f, 10000.0f))=0 |
Sets the world size. | |
virtual bool | IsSimulationActive () const =0 |
Returns whether the simulation is currently active or not. | |
virtual void | SetSimulationActive (bool bActive=true)=0 |
Sets whether the simulation is currently active or not. | |
virtual float | GetSimulationSpeed () const =0 |
Returns the simulation speed. | |
virtual bool | SetSimulationSpeed (float fSpeed=1.0f)=0 |
Sets the simulation speed. | |
virtual float | GetSimulationQuality () const =0 |
Returns the simulation quality. | |
virtual bool | SetSimulationQuality (float fQuality=1.0f)=0 |
Sets the simulation quality. | |
virtual float | GetFrameRate () const =0 |
Returns the frame rate the simulation runs on. | |
virtual bool | SetFrameRate (float fFrameRate=60.0f)=0 |
Sets the frame rate the simulation runs on. | |
virtual void | GetGravity (PLMath::Vector3 &vGravity) const =0 |
Returns the gravity vector. | |
virtual void | SetGravity (const PLMath::Vector3 &vGravity=PLMath::Vector3(0.0f,-9.81f, 0.0f))=0 |
Sets the gravity vector. | |
virtual bool | GetGroupCollision (PLCore::uint8 nGroup1, PLCore::uint8 nGroup2) const =0 |
Returns whether collision is active between the two given collision groups or not. | |
virtual void | SetGroupCollision (PLCore::uint8 nGroup1, PLCore::uint8 nGroup2, bool bActive=true)=0 |
Sets whether collision is active between the two given collision groups or not. | |
virtual PLCore::uint8 | GetBodyPairFlags (const Body &cBody1, const Body &cBody2) const =0 |
Returns body pair flags. | |
virtual void | SetBodyPairFlags (const Body &cBody1, const Body &cBody2, PLCore::uint8 nFlags=0)=0 |
Sets the body pair flags. | |
virtual bool | IsBuoyancyActive () const =0 |
Returns whether buoyancy force is used. | |
virtual void | SetBuoyancyActive (bool bActive=false)=0 |
Sets whether buoyancy force is used. | |
virtual float | GetBuoyancyPlaneY () const =0 |
Returns the y position of the buoyancy plane. | |
virtual void | SetBuoyancyPlaneY (float fY=0.0f)=0 |
Sets the y position of the buoyancy plane. | |
virtual void | UpdateSimulation ()=0 |
Updates the simulation. | |
virtual bool | IsAlwaysStatic () const =0 |
Returns whether the bodies are always static or not. | |
Public Attributes | |
ContactInformation A contact between two bodies was detected by the physics Contact information as | parameter |
Protected Member Functions | |
PLPHYSICS_API | World () |
Constructor. |
Abstract PL physics world (also called 'simulator') base class.
Body pair flags.
virtual PLPHYSICS_API PLPhysics::World::~World | ( | ) | [virtual] |
Destructor.
PLPHYSICS_API PLPhysics::World::World | ( | ) | [protected] |
Constructor.
PLPhysics::World::pl_class | ( | PLPHYSICS_RTTI_EXPORT | , |
World | , | ||
"PLPhysics" | , | ||
PLCore::Object | , | ||
"Abstract PL physics world (also called 'simulator') base class" | |||
) |
virtual Body* PLPhysics::World::CreateBodyBox | ( | const PLMath::Vector3 & | vDimension, |
bool | bStatic = false |
||
) | [pure virtual] |
Creates a physics box body.
[in] | vDimension | Box dimension |
[in] | bStatic | Is this physics body static? |
virtual Body* PLPhysics::World::CreateBodySphere | ( | float | fRadius, |
bool | bStatic = false |
||
) | [pure virtual] |
Creates a physics sphere body.
[in] | fRadius | Sphere radius |
[in] | bStatic | Is this physics body static? |
virtual Body* PLPhysics::World::CreateBodyEllipsoid | ( | const PLMath::Vector3 & | vRadius, |
bool | bStatic = false |
||
) | [pure virtual] |
Creates a physics ellipsoid body.
[in] | vRadius | Ellipsoid radius along each axis |
[in] | bStatic | Is this physics body static? |
virtual Body* PLPhysics::World::CreateBodyConvexHull | ( | PLMesh::MeshManager & | cMeshManager, |
const PLCore::String & | sMesh, | ||
const PLMath::Vector3 & | vMeshScale = PLMath::Vector3::One , |
||
bool | bStatic = false |
||
) | [pure virtual] |
Creates a physics convex hull body.
[in] | cMeshManager | Mesh manager to use |
[in] | sMesh | Collision mesh |
[in] | vMeshScale | Mesh scale |
[in] | bStatic | Is this physics body static? |
virtual Body* PLPhysics::World::CreateBodyMesh | ( | PLMesh::MeshManager & | cMeshManager, |
const PLCore::String & | sMesh, | ||
const PLMath::Vector3 & | vMeshScale = PLMath::Vector3::One , |
||
bool | bOptimize = false |
||
) | [pure virtual] |
Creates a physics mesh body.
[in] | cMeshManager | Mesh manager to use |
[in] | sMesh | Collision mesh |
[in] | vMeshScale | Mesh scale |
[in] | bOptimize | Allow the physics API to optimize the mesh? (if supported) |
virtual Body* PLPhysics::World::CreateBodyTerrain | ( | PLCore::uint32 | nWidth, |
PLCore::uint32 | nHeight, | ||
const float | fTerrain[], | ||
const PLMath::Vector3 & | vBoxMin, | ||
const PLMath::Vector3 & | vBoxMax, | ||
const PLMath::Vector3 & | vScale | ||
) | [pure virtual] |
Creates a physics terrain body.
[in] | nWidth | Terrain data width |
[in] | nHeight | Terrain data height |
[in] | fTerrain | Terrain data |
[in] | vBoxMin | Bounding box minimum |
[in] | vBoxMax | Bounding box maximum |
[in] | vScale | Scale |
virtual Body* PLPhysics::World::CreateBodyCylinder | ( | float | fRadius, |
float | fHeight, | ||
bool | bStatic = false |
||
) | [pure virtual] |
Creates a physics cylinder body.
[in] | fRadius | Cylinder radius at the base |
[in] | fHeight | Cylinder height along the x local axis from base to top |
[in] | bStatic | Is this physics body static? |
virtual Body* PLPhysics::World::CreateBodyCone | ( | float | fRadius, |
float | fHeight, | ||
bool | bStatic = false |
||
) | [pure virtual] |
Creates a physics cone body.
[in] | fRadius | Cone radius at the base |
[in] | fHeight | Cone height along the x local axis from base to top |
[in] | bStatic | Is this physics body static? |
virtual Body* PLPhysics::World::CreateBodyCapsule | ( | float | fRadius, |
float | fHeight, | ||
bool | bStatic = false |
||
) | [pure virtual] |
Creates a physics capsule body.
[in] | fRadius | Capsule radius at the base |
[in] | fHeight | Capsule height along the x local axis from base to top |
[in] | bStatic | Is this physics body static? |
virtual Body* PLPhysics::World::CreateBodyChamferCylinder | ( | float | fRadius, |
float | fHeight, | ||
bool | bStatic = false |
||
) | [pure virtual] |
Creates a physics chamfer cylinder body.
[in] | fRadius | Chamfer cylinder radius at the base |
[in] | fHeight | Chamfer cylinder height along the x local axis from base to top |
[in] | bStatic | Is this physics body static? |
virtual Joint* PLPhysics::World::CreateJointBall | ( | Body * | pParentBody, |
Body * | pChildBody, | ||
const PLMath::Vector3 & | vPivotPoint, | ||
const PLMath::Vector3 & | vPinDir | ||
) | [pure virtual] |
Creates a physics ball and socket joint.
[in] | pParentBody | Pointer to the parent rigid body, can be a null pointer |
[in] | pChildBody | Pointer to the attached rigid body, can be a null pointer |
[in] | vPivotPoint | Origin of the ball and socket in world space |
[in] | vPinDir | Vector defining the cone axis in world space |
virtual Joint* PLPhysics::World::CreateJointSlider | ( | Body * | pParentBody, |
Body * | pChildBody, | ||
const PLMath::Vector3 & | vPivotPoint, | ||
const PLMath::Vector3 & | vPinDir | ||
) | [pure virtual] |
Creates a physics slider joint.
[in] | pParentBody | Pointer to the parent rigid body, can be a null pointer |
[in] | pChildBody | Pointer to the attached rigid body, can be a null pointer |
[in] | vPivotPoint | Origin of the slider in world space |
[in] | vPinDir | The line of action of the slider in world space |
virtual Joint* PLPhysics::World::CreateJointHinge | ( | Body * | pParentBody, |
Body * | pChildBody, | ||
const PLMath::Vector3 & | vPivotPoint, | ||
const PLMath::Vector3 & | vPinDir | ||
) | [pure virtual] |
Creates a physics hinge joint.
[in] | pParentBody | Pointer to the parent rigid body, can be a null pointer |
[in] | pChildBody | Pointer to the attached rigid body, can be a null pointer |
[in] | vPivotPoint | Origin of the hinge in world space |
[in] | vPinDir | The line of action of the hinge in world space |
virtual Joint* PLPhysics::World::CreateJointUniversal | ( | Body * | pParentBody, |
Body * | pChildBody, | ||
const PLMath::Vector3 & | vPivotPoint, | ||
const PLMath::Vector3 & | vPinDir1, | ||
const PLMath::Vector3 & | vPinDir2 | ||
) | [pure virtual] |
Creates a physics universal joint.
[in] | pParentBody | Pointer to the parent rigid body, can be a null pointer |
[in] | pChildBody | Pointer to the attached rigid body, can be a null pointer |
[in] | vPivotPoint | Origin of the universal in world space |
[in] | vPinDir1 | First axis of rotation fixed on THIS body and perpendicular to 'PinDir2' in world space |
[in] | vPinDir2 | Second axis of rotation fixed on 'Parent' body and perpendicular to 'PinDir1' in world space |
virtual Joint* PLPhysics::World::CreateJointCorkscrew | ( | Body * | pParentBody, |
Body * | pChildBody, | ||
const PLMath::Vector3 & | vPivotPoint, | ||
const PLMath::Vector3 & | vPinDir | ||
) | [pure virtual] |
Creates a physics corkscrew joint.
[in] | pParentBody | Pointer to the parent rigid body, can be a null pointer |
[in] | pChildBody | Pointer to the attached rigid body, can be a null pointer |
[in] | vPivotPoint | Origin of the corkscrew in world space |
[in] | vPinDir | The line of action of the corkscrew in world space |
virtual Joint* PLPhysics::World::CreateJointUpVector | ( | Body & | cParentBody, |
const PLMath::Vector3 & | vPinDir | ||
) | [pure virtual] |
Creates a physics up vector joint.
[in] | cParentBody | Reference to the parent rigid body |
[in] | vPinDir | The aligning vector in world space |
virtual Sensor* PLPhysics::World::CreateSensorRaycast | ( | const PLMath::Vector3 & | vStart = PLMath::Vector3::Zero , |
const PLMath::Vector3 & | vEnd = PLMath::Vector3::Zero , |
||
PLCore::uint32 | nFlags = 0 |
||
) | [pure virtual] |
Creates a physics ray cast sensor.
[in] | vStart | Beginning of the ray in global space |
[in] | vEnd | End of the ray in global space |
[in] | nFlags | Flags (see Sensor::EFlags) |
virtual Sensor* PLPhysics::World::CreateSensorAABoundingBox | ( | const PLMath::Vector3 & | vMin = PLMath::Vector3::Zero , |
const PLMath::Vector3 & | vMax = PLMath::Vector3::Zero , |
||
PLCore::uint32 | nFlags = 0 |
||
) | [pure virtual] |
Creates a physics axis aligned bounding box sensor.
[in] | vMin | Minimum of the axis aligned bounding box in global space |
[in] | vMax | Maximum of the axis aligned bounding box in global space |
[in] | nFlags | Flags (see Sensor::EFlags) |
virtual void PLPhysics::World::GetWorldSize | ( | PLMath::Vector3 & | vMin, |
PLMath::Vector3 & | vMax | ||
) | const [pure virtual] |
Returns the world size.
[out] | vMin | Receives the minimum world position |
[out] | vMax | Receives the maximum world position |
virtual void PLPhysics::World::SetWorldSize | ( | const PLMath::Vector3 & | vMin = PLMath::Vector3(-10000.0f,-10000.0f,-10000.0f) , |
const PLMath::Vector3 & | vMax = PLMath::Vector3(10000.0f, 10000.0f, 10000.0f) |
||
) | [pure virtual] |
Sets the world size.
[in] | vMin | Minimum world position |
[in] | vMax | Maximum world position |
virtual bool PLPhysics::World::IsSimulationActive | ( | ) | const [pure virtual] |
Returns whether the simulation is currently active or not.
virtual void PLPhysics::World::SetSimulationActive | ( | bool | bActive = true | ) | [pure virtual] |
Sets whether the simulation is currently active or not.
[in] | bActive | 'true' if the simulation is currently active, else 'false' |
virtual float PLPhysics::World::GetSimulationSpeed | ( | ) | const [pure virtual] |
Returns the simulation speed.
virtual bool PLPhysics::World::SetSimulationSpeed | ( | float | fSpeed = 1.0f | ) | [pure virtual] |
Sets the simulation speed.
[in] | fSpeed | The simulation speed, a speed of <= 0 is NOT allowed! |
virtual float PLPhysics::World::GetSimulationQuality | ( | ) | const [pure virtual] |
Returns the simulation quality.
virtual bool PLPhysics::World::SetSimulationQuality | ( | float | fQuality = 1.0f | ) | [pure virtual] |
Sets the simulation quality.
[in] | fQuality | The simulation quality, 1 means best realistic behavior, 0 for the fastest possible configuration |
virtual float PLPhysics::World::GetFrameRate | ( | ) | const [pure virtual] |
Returns the frame rate the simulation runs on.
virtual bool PLPhysics::World::SetFrameRate | ( | float | fFrameRate = 60.0f | ) | [pure virtual] |
Sets the frame rate the simulation runs on.
[in] | fFrameRate | The frame rate the simulation runs on (>=60.0 and <=1000.0) (smaller=more performance, larger=more accurate simulation) |
virtual void PLPhysics::World::GetGravity | ( | PLMath::Vector3 & | vGravity | ) | const [pure virtual] |
Returns the gravity vector.
[out] | vGravity | Will receive the current gravity vector |
virtual void PLPhysics::World::SetGravity | ( | const PLMath::Vector3 & | vGravity = PLMath::Vector3(0.0f,-9.81f, 0.0f) | ) | [pure virtual] |
Sets the gravity vector.
[in] | vGravity | New gravity vector |
virtual bool PLPhysics::World::GetGroupCollision | ( | PLCore::uint8 | nGroup1, |
PLCore::uint8 | nGroup2 | ||
) | const [pure virtual] |
Returns whether collision is active between the two given collision groups or not.
[in] | nGroup1 | First collision group(0-31) |
[in] | nGroup2 | Second collision group(0-31) |
virtual void PLPhysics::World::SetGroupCollision | ( | PLCore::uint8 | nGroup1, |
PLCore::uint8 | nGroup2, | ||
bool | bActive = true |
||
) | [pure virtual] |
Sets whether collision is active between the two given collision groups or not.
[in] | nGroup1 | First collision group(0-31) |
[in] | nGroup2 | Second collision group(0-31) |
[in] | bActive | 'true' if the collision between the two given collision groups is active, else 'false' |
virtual PLCore::uint8 PLPhysics::World::GetBodyPairFlags | ( | const Body & | cBody1, |
const Body & | cBody2 | ||
) | const [pure virtual] |
Returns body pair flags.
[in] | cBody1 | The first body |
[in] | cBody2 | The second body |
virtual void PLPhysics::World::SetBodyPairFlags | ( | const Body & | cBody1, |
const Body & | cBody2, | ||
PLCore::uint8 | nFlags = 0 |
||
) | [pure virtual] |
Sets the body pair flags.
[in] | cBody1 | The first body |
[in] | cBody2 | The second body |
[in] | nFlags | Body pair flags (see EBodyPairFlags) |
virtual bool PLPhysics::World::IsBuoyancyActive | ( | ) | const [pure virtual] |
Returns whether buoyancy force is used.
virtual void PLPhysics::World::SetBuoyancyActive | ( | bool | bActive = false | ) | [pure virtual] |
Sets whether buoyancy force is used.
[in] | bActive | 'true' if buoyancy force is used, else 'false' |
virtual float PLPhysics::World::GetBuoyancyPlaneY | ( | ) | const [pure virtual] |
Returns the y position of the buoyancy plane.
virtual void PLPhysics::World::SetBuoyancyPlaneY | ( | float | fY = 0.0f | ) | [pure virtual] |
Sets the y position of the buoyancy plane.
[in] | fY | New y position of the buoyancy plane |
virtual void PLPhysics::World::UpdateSimulation | ( | ) | [pure virtual] |
Updates the simulation.
virtual bool PLPhysics::World::IsAlwaysStatic | ( | ) | const [pure virtual] |
Returns whether the bodies are always static or not.
ContactInformation A contact between two bodies was detected by the physics Contact information as PLPhysics::World::parameter |
|