Untitled Game engine no.5  1.0
Public Member Functions | Public Attributes | List of all members
Engine::RigidBody Struct Reference

Physics rigidbody component. Stores the physical parameters of an object. Such as moment of inertia, mass, velocity, angular momentum, air drag, force, torque, etc... More...

#include <Components.hpp>

Public Member Functions

 RigidBody (float height, float width, float depth, float m)
 
void setMomentCube (float height, float width, float depth, float m)
 Set the moment of inertia of this rigidbody to that of a solid cube. More...
 

Public Attributes

glm::vec3 velocity = glm::vec3(0, 0, 0)
 velocity vector
 
glm::vec3 force = glm::vec3(0, 0, 0)
 force vector
 
float airDrag = 0.1f
 air drag co-efficient
 
float angularDrag = 1.f
 air drag co-efficient
 
bool kinematic = true
 is the object affected by physics
 
glm::mat3 moment
 moment of inertia
 
glm::mat3 invMoment
 inverse moment of inertia
 
glm::vec3 w = glm::vec3(0, 0, 0)
 Angular velocity.
 
glm::vec3 t = glm::vec3(0, 0.f, 0)
 Torque.
 
Ref< PhysicsEntityphysicsEntity
 Reference to an active physics entity.
 
float iMass = 1
 inverse mass
 
float drag = 2.98f
 drag co-efficient
 
bool grounded = true
 grounded flag
 

Detailed Description

Physics rigidbody component. Stores the physical parameters of an object. Such as moment of inertia, mass, velocity, angular momentum, air drag, force, torque, etc...

Member Function Documentation

◆ setMomentCube()

void Engine::RigidBody::setMomentCube ( float  height,
float  width,
float  depth,
float  m 
)
inline

Set the moment of inertia of this rigidbody to that of a solid cube.

Parameters
height
width
depth
mmass

The documentation for this struct was generated from the following file: