|
0.45.0
|
#include <iPhysicsBody.h>
Public Member Functions | |
| void | setMatrix (const iaMatrixd &matrix) |
| void | getMatrix (iaMatrixd &matrix) |
| void | getTransformNodeMatrix (iaMatrixd &matrix) const |
| void | setMass (float64 mass) |
| float64 | getMass () |
| void | setAngularDamping (const iaVector3d &damping) |
| const iaVector3d & | getAngularDamping () const |
| void | setLinearDamping (float64 damping) |
| float64 | getLinearDamping () const |
| const iaVector3d & | getForce () const |
| void | setForce (const iaVector3d &force) |
| void | setUserData (const std::any &userData) |
| std::any | getUserData () const |
| const iaVector3d & | getTorque () const |
| void | setTorque (const iaVector3d &torque) |
| iaVector3d | getVelocity () const |
| const iaVector3d & | getOmega () const |
| uint32 | getTransformNodeID () const |
| void | setMaterial (int64 id) |
| int64 | getMaterial () const |
| iPhysicsBodyID | getID () |
| void * | getNewtonBody () |
| void | registerForceAndTorqueDelegate (iApplyForceAndTorqueDelegate applyForceAndTorqueDelegate) |
| void | unregisterForceAndTorqueDelegate (iApplyForceAndTorqueDelegate applyForceAndTorqueDelegate) |
Static Public Attributes | |
| static const uint64 | INVALID_PHYSICSBODY_ID = 0 |
Protected Member Functions | |
| void | setTransformNodeMatrix (const iaMatrixd &matrix) |
| void | setOmega (const iaVector3d &omega) |
| void | applyForceAndTorque (float64 timeStep) |
| iPhysicsBody (void *newtonBody) | |
| ~iPhysicsBody () | |
Protected Attributes | |
| int64 | _materialID = iPhysicsMaterial::INVALID_PHYSICSMATERIAL_ID |
| iPhysicsBodyID | _id = INVALID_PHYSICSBODY_ID |
| std::any | _userData |
| float64 | _mass = 0 |
| iaVector3d | _angularDamping |
| float64 | _linearDamping |
| iaVector3d | _force |
| iaVector3d | _torque |
| iaVector3d | _velocity |
| iaVector3d | _omega |
| void * | _newtonBody = nullptr |
| uint32 | _transformNodeID = iNode::INVALID_NODE_ID |
Static Protected Attributes | |
| static iaIDGenerator64 | _idGenerator |
Friends | |
| class | iPhysics |
| void | PhysicsNodeDestructor (const void *body) |
| void | PhysicsApplyForceAndTorque (const void *body, float64 timestep, int threadIndex) |
| void | PhysicsNodeSetTransform (const void *body, const float *matrix, int threadIndex) |
wrapper for the NewtonBody handle
|
protected |
initializes newton body handle
| newtonBody | handle to newton body |
|
protected |
dtor
releases newton collision
|
protected |
triggers callback for user implementation of applyForceAndTorque
called by iPhysics
| timeStep | delta of time since last update |
| const iaVector3d & igor::iPhysicsBody::getAngularDamping | ( | ) | const |
| const iaVector3d & igor::iPhysicsBody::getForce | ( | ) | const |
| uint64 igor::iPhysicsBody::getID | ( | ) |
| float64 igor::iPhysicsBody::getLinearDamping | ( | ) | const |
| float64 igor::iPhysicsBody::getMass | ( | ) |
| int64 igor::iPhysicsBody::getMaterial | ( | ) | const |
| void igor::iPhysicsBody::getMatrix | ( | iaMatrixd & | matrix | ) |
returns current body matrix
| [out] | matrix | current body matrix |
| void * igor::iPhysicsBody::getNewtonBody | ( | ) |
| const iaVector3d & igor::iPhysicsBody::getOmega | ( | ) | const |
| const iaVector3d & igor::iPhysicsBody::getTorque | ( | ) | const |
| uint32 igor::iPhysicsBody::getTransformNodeID | ( | ) | const |
returns zero if body is not bound to a transform node
| void igor::iPhysicsBody::getTransformNodeMatrix | ( | iaMatrixd & | matrix | ) | const |
returns the transform node materix
the transform node matrix is affected by the bodys movement within the physics context (see setTransformNodeMatrix) returns identity materix if body is not bound to a transform node
| matrix[out] | destination to put the matrix in |
| std::any igor::iPhysicsBody::getUserData | ( | ) | const |
| iaVector3d igor::iPhysicsBody::getVelocity | ( | ) | const |
| void igor::iPhysicsBody::registerForceAndTorqueDelegate | ( | iApplyForceAndTorqueDelegate | applyForceAndTorqueDelegate | ) |
registers to apply force and tourque event
| applyForceAndTorqueDelegate | the delegate to register |
| void igor::iPhysicsBody::setAngularDamping | ( | const iaVector3d & | damping | ) |
sets angular damping
| damping | damping values for all 3 axis |
| void igor::iPhysicsBody::setForce | ( | const iaVector3d & | force | ) |
sets force
| force | the force that affect thos body |
| void igor::iPhysicsBody::setLinearDamping | ( | float64 | damping | ) |
sets linear damping
| damping | damping value for all 3 dimensions |
| void igor::iPhysicsBody::setMass | ( | float64 | mass | ) |
changes the mass of the newton body
| mass | the mass of the newton body (if zero the body is considered to be a non moveable object). |
| void igor::iPhysicsBody::setMaterial | ( | int64 | id | ) |
sets material id
| id | physics material id |
| void igor::iPhysicsBody::setMatrix | ( | const iaMatrixd & | matrix | ) |
sets matrix of newton body
| matrix | the matrix for the newton body |
|
protected |
updates the omega by physics event
is called by iPhysics after the body changed it's position
| omega | the omega to set |
| void igor::iPhysicsBody::setTorque | ( | const iaVector3d & | torque | ) |
sets torque of the body
| torque | the torque to set |
|
protected |
updates the transform node matrix by physics event
is called by iPhysics after the body changed it's position
| matrix | matrix to be set |
| void igor::iPhysicsBody::setUserData | ( | const std::any & | userData | ) |
sets user data
| userData | pointer to user data |
| void igor::iPhysicsBody::unregisterForceAndTorqueDelegate | ( | iApplyForceAndTorqueDelegate | applyForceAndTorqueDelegate | ) |
unregisters from apply force and tourque event
| applyForceAndTorqueDelegate | the delegate to unregister |
|
friend |
|
friend |
redirects all apply force and torque calls to igor physics bodies
| body | the newton body |
| timestep | time delta |
| threadIndex | ??? |
|
friend |
callback for physics body destruction
| body | pointer to body that got destroyed |
|
friend |
|
protected |
current angular damping
|
protected |
current force
|
protected |
body id
|
staticprotected |
next body id
|
protected |
current linear damping
|
protected |
the mass of this body
|
protected |
material id of body
|
protected |
handle to newton body
|
protected |
current omega or angular speed
|
protected |
current torque
|
protected |
bound transform node
|
protected |
user data
|
protected |
current velocity
|
static |
defines the invalid body id