7#include <ext/reactphysics3d/src/body/Body.h>
8#include <ext/reactphysics3d/src/body/CollisionBody.h>
9#include <ext/reactphysics3d/src/body/RigidBody.h>
10#include <ext/reactphysics3d/src/collision/ProxyShape.h>
93 Body(
World*
world,
const string&
id,
int type,
bool enabled, uint16_t
collisionTypeId,
const Transformations&
transformations,
float restitution,
float friction,
float mass,
const Vector3&
inertiaTensor,
const vector<BoundingVolume*>
boundingVolumes);
151 const string&
getId();
Dynamic rigid/static rigid/collision body class.
vector< BoundingVolume * > boundingVolumes
uint16_t getCollisionTypeIds()
void setCloned(bool cloned)
Set cloned.
vector< CollisionListener * > collisionListener
void addTorque(const Vector3 &torque)
Add torque.
reactphysics3d::RigidBody * rigidBody
void fireOnCollisionBegin(Body *other, CollisionResponse &collisionResponse)
Fire on collision begin.
void setMass(float mass)
Set up mass.
void resetProxyShapes()
Reset proxy shapes.
void setAngularVelocity(const Vector3 &angularVelocity)
Set angular velocity.
vector< BoundingVolume * > & getBoundingVolumes()
Transformations transformations
static constexpr uint16_t TYPEID_DYNAMIC
BoundingBox computeBoundingBoxTransformed()
Compute bounding box transformed.
void setEnabled(bool enabled)
Set up if rigid body is enabled.
static Matrix4x4 computeInverseInertiaMatrix(BoundingBox *boundingBox, float mass, float scaleXAxis, float scaleYAxis, float scaleZAxis)
Computes the inverse inertia matrix.
void setLinearVelocity(const Vector3 &linearVelocity)
Set linear velocity.
void setFriction(float friction)
Set up friction.
void setRestitution(float restitution)
Set up restitution.
void setSleeping(bool sleeping)
Set sleeping.
reactphysics3d::CollisionBody * collisionBody
void setCollisionTypeId(uint16_t typeId)
Set collision type id.
void addForce(const Vector3 &forceOrigin, const Vector3 &force)
Add force.
static constexpr int32_t TYPE_DYNAMIC
int getType()
Return type, see TYPE_*.
void setLinearDamping(float linearDamping)
Set linear damping.
void removeCollisionListener(CollisionListener *listener)
Remove a collision listener to this rigid body.
void fireOnCollisionEnd(Body *other)
Fire on collision end.
void setAngularDamping(float angularDamping)
Set angular damping.
Body(World *world, const string &id, int type, bool enabled, uint16_t collisionTypeId, const Transformations &transformations, float restitution, float friction, float mass, const Vector3 &inertiaTensor, const vector< BoundingVolume * > boundingVolumes)
Protected constructor.
static constexpr int32_t TYPE_KINEMATIC
const Transformations & getTransformations()
const Vector3 getAngularVelocity()
const string & getRootId()
vector< reactphysics3d::ProxyShape * > proxyShapes
static constexpr uint16_t TYPEIDS_ALL
static constexpr uint16_t TYPEID_STATIC
static const Vector3 getNoRotationInertiaTensor()
void setCollisionTypeIds(uint16_t collisionTypeIds)
Set up collision type ids.
Vector3 transformationsScale
void fromTransformations(const Transformations &transformations)
Synchronizes this rigid body with transformations.
void addCollisionListener(CollisionListener *listener)
Add a collision listener to this rigid body.
float getAngularDamping()
uint16_t getCollisionTypeId()
void fireOnCollision(Body *other, CollisionResponse &collisionResponse)
Fire on collision.
static constexpr int32_t TYPE_STATIC
void addBoundingVolume(BoundingVolume *boundingVolume)
Add bounding volume.
const Vector3 getLinearVelocity()
static constexpr int32_t TYPE_COLLISION
void setRootId(const string &rootId)
Set root id.
Dynamic physics world class.
Axis aligned bounding box used for frustum, this is not directly connectable with physics engine.
Bounding volume interface.