|
ToyMaker Game Engine 0.0.2
ToyMaker is a game engine developed and maintained by Zoheb Shujauddin.
|
Files | |
| file | ToyMaker_Main/include/toymaker/engine/physics/system.hpp |
| File containing ToyMaker's implementation of XPBD, extended position based dynamics. | |
Classes | |
| class | ToyMaker::PhysicsSystem |
| The physics system, an ECS system that tracks and updates the state of each physics object in the scene according to its properties. More... | |
| struct | ToyMaker::PhysicsState |
| Component representing the physics state of the body it's attached to at some particular point in time. More... | |
| class | ToyMaker::BaseConstraint |
| Base class for constraints. More... | |
Enumerations | |
| enum | ToyMaker::PhysicsState::Mode : Traits { ToyMaker::PhysicsState::MODE_DYNAMIC =0x0 , ToyMaker::PhysicsState::MODE_KINEMATIC =0x1 , ToyMaker::PhysicsState::MODE_STATIC =0x2 } |
| Defines how the object this component is attached to responds to physics updates. More... | |
| enum | ToyMaker::PhysicsState::CollisionResponse : Traits { ToyMaker::PhysicsState::COLLISION_SEPARATE =0x4 , ToyMaker::PhysicsState::COLLISION_SIGNAL =0x8 } |
| Defines how the object this component is attached to responds to collisions. More... | |
Functions | |
| float | ToyMaker::computeGeneralizedInverseMassPositional (const ObjectBounds &object, const PhysicsState &physics, const glm::vec3 &correctionPoint, const glm::vec3 &correctionGradient) |
| Computes the generalized inverse mass used for positional corrections applied by constraints. | |
| float | ToyMaker::computeGeneralizedInverseMassRotational (const ObjectBounds &object, const PhysicsState &physics, const glm::vec3 &correctionRotational) |
| Computes the generalized inverse mass used by constraints to apply strictly rotational corrections. | |
| glm::mat3 | ToyMaker::computeInertiaRotationalWorld (const glm::vec3 &rotationalInertiaLocal, const glm::quat &orientation) |
| Returns an objects rotation tensor in the global frame given its tensor in the local frame according to its current orientation. | |
| ObjectBounds | ToyMaker::applyImpulseObject (ObjectBounds object, const PhysicsState &physics, const glm::vec3 &impulsePositional, const glm::vec3 &impulsePoint) |
| Returns object bounds in state it would be post application of a positional impulse. | |
| ObjectBounds | ToyMaker::applyImpulseObject (ObjectBounds object, const PhysicsState &physics, const glm::vec3 &impulseRotational) |
| Returns object bounds in state it would be post application of a rotational impulse. | |
| PhysicsState | ToyMaker::applyImpulsePhysics (const ObjectBounds &object, PhysicsState physics, const glm::vec3 &impulsePositional, const glm::vec3 &impulsePoint) |
| Returns new physics state after application of global impulse. | |
| PhysicsState | ToyMaker::applyImpulsePhysics (const ObjectBounds &object, PhysicsState physics, const glm::vec3 &impulseRotational) |
| Returns new physics state after application of global angular impulse. | |
| enum ToyMaker::PhysicsState::CollisionResponse : Traits |
| enum ToyMaker::PhysicsState::Mode : Traits |
Defines how the object this component is attached to responds to physics updates.
| float ToyMaker::computeGeneralizedInverseMassPositional | ( | const ObjectBounds & | object, |
| const PhysicsState & | physics, | ||
| const glm::vec3 & | correctionPoint, | ||
| const glm::vec3 & | correctionGradient ) |
Computes the generalized inverse mass used for positional corrections applied by constraints.
| object | The bounds indicating the current position and orientation of the object in world space |
| inverseMass | 1 divided by the mass of the object. |
| inverseRotationalInertia | The inverse of the rotational inertia of this object in its local frame |
| correctionPoint | Location of the point of application of the correction |
| correctionGradient | The direction of the greatest increase in error with respect to the desired object state in terms of its position. |
| float ToyMaker::computeGeneralizedInverseMassRotational | ( | const ObjectBounds & | object, |
| const PhysicsState & | physics, | ||
| const glm::vec3 & | correctionRotational ) |
Computes the generalized inverse mass used by constraints to apply strictly rotational corrections.
| inverseMass | 1 divided by the mass of the object. |
| inverseRotationalInertia | The inverse of the rotational inertia of the object in its local frame. |
| correction | The vector representing the desired rotational correction, usually a product of an impulse vector and its offset from the object's center-of-mass. Moving along its direction increases the magnitude of the correction required |