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

Links all the data necessary to compute physics calculations. More...

#include <Components.hpp>

Public Member Functions

 PhysicsEntity (Ref< Entity > &e, Ref< Transform > &transform, Ref< Collider > &collider, Ref< RigidBody > &rigidBody)
 
glm::mat4 getMat ()
 Get the matrix transformation made up of q and x. More...
 
glm::mat4 getIMat ()
 Get the inverse matrix transformation. More...
 
void clearMat ()
 Clear the matrix flags when the position or rotation is updated.
 

Public Attributes

Ref< Entityentity
 Entitiy reference.
 
Ref< Transformtf = nullptr
 transform reference
 
Ref< Colliderc = nullptr
 collider reference
 
Ref< Collidercuse = nullptr
 
Ref< RigidBodyrb = nullptr
 rigidbody reference
 
glm::vec3 v {0}
 
glm::vec3 w {0}
 velocity
 
glm::vec3 x {0}
 angular momentum
 
glm::vec3 xPrev {0}
 position
 
glm::qua< float > q {}
 previous position (needed for XPBD)
 
glm::qua< float > qPrev {}
 rotation quat
 
glm::qua< float > dQ {}
 previous quat
 
bool matUpdated = true
 storage for a delta quat More...
 
bool itmatUpdated = true
 

Detailed Description

Links all the data necessary to compute physics calculations.

Member Function Documentation

◆ getIMat()

glm::mat4 Engine::PhysicsEntity::getIMat ( )
inline

Get the inverse matrix transformation.

Returns
inverse matrix

◆ getMat()

glm::mat4 Engine::PhysicsEntity::getMat ( )
inline

Get the matrix transformation made up of q and x.

Returns
matrix

Member Data Documentation

◆ matUpdated

bool Engine::PhysicsEntity::matUpdated = true

storage for a delta quat

flags for storing matrix transformations (to avoid calculating them multiple times)


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