3#include <btBulletDynamicsCommon.h>
20 btCollisionShape*
shape =
nullptr;
50 void update(
float deltaTimeSeconds);
63 static btCollisionShape *
createBoxShape(
const glm::vec3& halfExtents);
83 static btCollisionShape *
createPlaneShape(
const glm::vec3& surfaceNormal,
float distanceFromOrigin);
btCollisionDispatcher * dispatcher
void update(float deltaTimeSeconds)
Steps the physics simulation by 1/120th of a second. The idea of the engine is that it should run on ...
void onPhysicsComponentDestroyed(entt::registry ®istry, entt::entity entity)
Cleans up the hit box pointers and motion state if applicable.
static btCollisionShape * createBoxShape(const glm::vec3 &halfExtents)
Creates a collision box.
btCollisionConfiguration * collisionConfiguration
btBroadphaseInterface * broadphase
static btCollisionShape * createSphereShape(float radius)
Creates a collision sphere.
btRigidBody * createRigidBody(const RigidBodyCreateInfo &info) const
Creates a rigid body for the physics simulation.
btDiscreteDynamicsWorld * getDynamicsWorld() const
Gets the world where the physics simulation is performed inside.
static btCollisionShape * createCapsuleShape(float radius, float height)
creates a capsule with a height and a radius.
static btCollisionShape * createPlaneShape(const glm::vec3 &surfaceNormal, float distanceFromOrigin)
Creates a plane from.
btConstraintSolver * solver
void removeRigidBody(btRigidBody *body) const
Removes a rigid body from the physics simulation.
btDiscreteDynamicsWorld * dynamicsWorld
Log category system implementation.
Rigid body create info is used to create a rigid body. It delivers all informations like the initial ...
glm::mat4 transform
initial location for the rigid body
float restitution
energy absorption 0.0f means full absorption on impact, 0.5f half of the energy is maintained after i...
float friction
friction 0.0f - 1.0f. 0 is ice 0.3f - 0.5f wood or plastic. 0.7f - 1.0f High friction
btCollisionShape * shape
pointer to the collision shape
float mass
mass in Kilograms. Mass of 0 is a static object --> immovable