0.44.0
|
#include <iPhysics.h>
Inherits igor::iModule< iPhysics >.
Friends | |
class | iModule< iPhysics > |
class | iPhysicsCollision |
class | iTaskPhysics |
class | iPhysicsBody |
class | iPhysicsMaterialCombo |
class | iPhysicsCollisionConfig |
class | iApplication |
void | PhysicsNodeDestructor (const void *body) |
void | PhysicsNodeSetTransform (const void *body, const float64 *matrix, int threadIndex) |
void | GenericContactProcessCompatible (const void *const newtonContactJoint, float64 timestep, int threadIndex) |
Additional Inherited Members | |
Static Public Member Functions inherited from igor::iModule< iPhysics > | |
static IGOR_INLINE iPhysics & | getInstance () |
static IGOR_INLINE bool | isInstantiated () |
static void | create () |
static void | destroy () |
Protected Member Functions inherited from igor::iModule< iPhysics > | |
iModule ()=default | |
virtual | ~iModule ()=default |
wrapper for newton game dynamics
void igor::iPhysics::bindTransformNode | ( | iPhysicsBody * | body, |
iNodeTransform * | transformNode, | ||
bool | sync = true |
||
) |
binds transform node to newton body
body | handle to newton body |
transformNode | transform node to bind |
sync | if true the bodys matrix will be updated with the transform node one |
void igor::iPhysics::convexCast | ( | const iaMatrixd & | matrix, |
const iaVector3d & | target, | ||
iPhysicsCollision * | collisionVolume, | ||
iRayPreFilterDelegate | preFilterDelegate, | ||
void * | userData, | ||
std::vector< iConvexCastReturnInfo > & | result, | ||
int32 | maxContactCount = 10 |
||
) |
iPhysicsBody * igor::iPhysics::createBody | ( | iPhysicsCollision * | collisionVolume | ) |
creates a newton body and connects it with a newton collision
body | the collision to connect with |
iPhysicsCollision * igor::iPhysics::createBox | ( | float64 | width, |
float64 | height, | ||
float64 | depth, | ||
const iaMatrixd & | offset | ||
) |
creates newton collision in shape of a box
width | width of box |
height | height of box |
depth | depth of box |
offset | matrix as offset to origin |
iPhysicsCollision * igor::iPhysics::createCapsule | ( | float64 | radius0, |
float64 | radius1, | ||
float64 | height, | ||
const iaMatrixd & | offset | ||
) |
creates newton collision in shape of a capsule
radius | radius of capsule |
height | height of capsule |
offset | matrix as offset to origin |
iPhysicsCollisionConfig * igor::iPhysics::createCollisionConfig | ( | ) |
creates a collision configuration
iPhysicsCollision * igor::iPhysics::createCompound | ( | std::vector< iPhysicsCollision * > & | collisions | ) |
creates a collision compound from multiple collisions
collisions | list od collisions |
iPhysicsCollision * igor::iPhysics::createCone | ( | float64 | radius, |
float64 | height, | ||
const iaMatrixd & | offset | ||
) |
creates newton collision in shape of a cone
radius | radius of cone |
height | height of cone |
offset | matrix as offset to origin |
iPhysicsCollision * igor::iPhysics::createCylinder | ( | float64 | radius0, |
float64 | radius1, | ||
float64 | height, | ||
const iaMatrixd & | offset | ||
) |
creates newton collision in shape of a cylinder
radius | radius of cylinder |
height | height of cylinder |
offset | matrix as offset to origin |
iPhysicsJoint * igor::iPhysics::createJoint | ( | iPhysicsBody * | body0, |
iPhysicsBody * | body1 = nullptr , |
||
int | maxDOF = 6 |
||
) |
creates a joint
iPhysicsMaterial * igor::iPhysics::createMaterial | ( | const iaString & | name | ) |
creates a material
iPhysicsCollision * igor::iPhysics::createMesh | ( | iMeshPtr | mesh, |
int64 | faceAttribute, | ||
const iaMatrixd & | offset | ||
) |
creates a collision shape based on a mesh
mesh | the mesh |
faceAttribute | an integer attribute associated with the faces |
offset | local offset matrix |
iPhysicsCollision * igor::iPhysics::createSphere | ( | float64 | radius, |
const iaMatrixd & | offset | ||
) |
creates newton collision in shape of a sphere
radius | radius of sphere |
offset | matrix as offset to origin |
iPhysicsWorld * igor::iPhysics::createWorld | ( | ) |
creates a world
void igor::iPhysics::destroyBody | ( | iPhysicsBody * | body | ) |
destroy physics body
body | the body to destroy |
void igor::iPhysics::destroyBody | ( | uint64 | bodyID | ) |
destrox body by ID
bodyID | the ID of the body to be destroyed |
void igor::iPhysics::destroyBodyAsync | ( | iPhysicsBody * | body | ) |
destroy physics body (asynchronous)
body | the body to destroy |
void igor::iPhysics::destroyCollision | ( | iPhysicsCollision * | collision | ) |
destroys physics collision
collision | the collision to destroy |
void igor::iPhysics::destroyCollision | ( | uint64 | collisionID | ) |
destroys collision by id
collisionID | the collisions id |
void igor::iPhysics::destroyCollisionConfig | ( | iPhysicsCollisionConfig * | physicsCollisionConfig | ) |
destroy collision configuration
physicsCollisionConfig | the collision configuration to destroy |
void igor::iPhysics::destroyCollisionConfig | ( | uint64 | collisionConfigID | ) |
destroy collision configuration by id
collisionConfigID | collision configuration id |
void igor::iPhysics::destroyWorld | ( | iPhysicsWorld * | world | ) |
destroy world
world | the world to destroy |
void igor::iPhysics::destroyWorld | ( | uint64 | id | ) |
destroy world by id
id | world id |
iPhysicsBody * igor::iPhysics::getBody | ( | uint64 | bodyID | ) |
\pram bodyID the body's ID
iPhysicsCollision * igor::iPhysics::getCollision | ( | uint64 | collisionID | ) |
collisionID | the collision id |
iPhysicsCollisionConfig * igor::iPhysics::getCollisionConfig | ( | uint64 | collisionConfigID | ) |
collisionConfigID | collision configuration id |
int64 igor::iPhysics::getDefaultMaterialID | ( | ) |
iPhysicsMaterial * igor::iPhysics::getDefaultShader | ( | ) |
uint64 igor::iPhysics::getDefaultWorldID | ( | ) |
iPhysicsJoint * igor::iPhysics::getJoint | ( | uint64 | jointID | ) |
jointID | the joint id |
void igor::iPhysics::getMassMatrix | ( | void * | newtonBody, |
float64 & | mass, | ||
float64 & | Ixx, | ||
float64 & | Iyy, | ||
float64 & | Izz | ||
) |
returns the mass matrix from given body
newtonBody | the newton body |
mass | the returned mass |
Ixx | ??? |
Iyy | ??? |
Izz | ??? |
iPhysicsMaterial * igor::iPhysics::getMaterial | ( | int64 | id | ) |
id | the id of the physics material |
name | the name of the material |
float64 igor::iPhysics::getSimulationRate | ( | ) |
iPhysicsWorld * igor::iPhysics::getWorld | ( | uint64 | id | ) |
id | world id |
bool igor::iPhysics::isBody | ( | uint64 | bodyID | ) |
bool igor::iPhysics::isCollisionConfig | ( | uint64 | collisionConfigID | ) |
collisionConfigID | id of collision configuration |
bool igor::iPhysics::isJoint | ( | uint64 | jointID | ) |
jointID | the joint id |
bool igor::iPhysics::isWorld | ( | uint64 | id | ) |
id | id of world |
void igor::iPhysics::setMassMatrix | ( | void * | newtonBody, |
float64 | mass, | ||
float64 | Ixx, | ||
float64 | Iyy, | ||
float64 | Izz | ||
) |
the mass matrix of newton body
newtonBody | handle to newton body |
mass | mass of newton body |
Ixx | ??? |
Iyy | ??? |
Izz | ??? |
void igor::iPhysics::setMaterial | ( | iPhysicsBody * | body, |
int64 | materialID | ||
) |
configures material for body
body | the body to configure the material |
materialID | the material's id to set |
void igor::iPhysics::setSimulationRate | ( | float64 | simulationRate | ) |
set's the simulation rate in Hz
default is 120Hz
simulationRate | simulation rate in Hz |
void igor::iPhysics::setUserJointAddAngularRow | ( | iPhysicsJoint * | joint, |
float64 | relativeAngleError, | ||
const iaVector3d & | pin | ||
) |
void igor::iPhysics::setUserJointSetRowMaximumFriction | ( | iPhysicsJoint * | joint, |
float64 | friction | ||
) |
void igor::iPhysics::setUserJointSetRowMinimumFriction | ( | iPhysicsJoint * | joint, |
float64 | friction | ||
) |
void igor::iPhysics::start | ( | ) |
registers handle to application handle event
void igor::iPhysics::stop | ( | ) |
unregisters handle from application handle event
|
friend |
generic handle to handle contacts between two bodies
newtonContactJoint | the contact joint |
timestep | time delta |
threadIndex | thread index |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
callback for physics body destruction
body | pointer to body that got destroyed |
|
friend |