YourGameLib
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
yourgame::util::RigidBody Class Reference

Represents a rigid body, holding a void pointer to an underlying implementation. More...

#include <physenv.h>

Public Member Functions

 RigidBody (std::string name, void *body)
 Constructor.
 
 ~RigidBody ()
 
yourgame::math::Trafo getTrafo ()
 Get transform (Trafo) calculated from rigid body.
 
void setTrafo (yourgame::math::Trafo trafo)
 Set transform (Trafo) of rigid body.
 
void setRestitution (float restitution)
 Set the restitution of the rigid body.
 
void setFriction (float friction)
 Set the friction of the rigid body.
 
void setSleepingThresholds (float linear, float angular)
 Set the Sleeping Thresholds of the rigid body.
 
void setLinearFactors (float x, float y, float z)
 Set the Linear Factors (x,y,z) of the rigid body.
 
void setAngularFactor (float angFac)
 Set the Angular Factor of the rigid body.
 
void setAngularFactors (float x, float y, float z)
 Set the Angular Factors (x,y,z) of the rigid body.
 
void applyCentralForce (float x, float y, float z)
 Apply central force to the rigid body.
 
void applyCentralImpulse (float x, float y, float z)
 Apply central impulse to the rigid body.
 

Public Attributes

std::string m_name
 
void *const m_body
 

Detailed Description

Represents a rigid body, holding a void pointer to an underlying implementation.

Constructor & Destructor Documentation

◆ RigidBody()

yourgame::util::RigidBody::RigidBody ( std::string  name,
void *  body 
)
inline

Constructor.

Parameters
namename of the rigid body
bodypointer to the underlying implementation

◆ ~RigidBody()

yourgame::util::RigidBody::~RigidBody ( )

Member Function Documentation

◆ applyCentralForce()

void yourgame::util::RigidBody::applyCentralForce ( float  x,
float  y,
float  z 
)

Apply central force to the rigid body.

Parameters
xx-component of force vector
yy-component of force vector
zz-component of force vector

◆ applyCentralImpulse()

void yourgame::util::RigidBody::applyCentralImpulse ( float  x,
float  y,
float  z 
)

Apply central impulse to the rigid body.

Parameters
xx-component of impulse vector
yy-component of impulse vector
zz-component of impulse vector

◆ getTrafo()

yourgame::math::Trafo yourgame::util::RigidBody::getTrafo ( )

Get transform (Trafo) calculated from rigid body.

Returns
Trafo object

◆ setAngularFactor()

void yourgame::util::RigidBody::setAngularFactor ( float  angFac)

Set the Angular Factor of the rigid body.

Parameters
angFacangular factor

◆ setAngularFactors()

void yourgame::util::RigidBody::setAngularFactors ( float  x,
float  y,
float  z 
)

Set the Angular Factors (x,y,z) of the rigid body.

Parameters
xAngular Factor for x coordinate
yAngular Factor for y coordinate
zAngular Factor for z coordinate

◆ setFriction()

void yourgame::util::RigidBody::setFriction ( float  friction)

Set the friction of the rigid body.

Parameters
frictionfriction

◆ setLinearFactors()

void yourgame::util::RigidBody::setLinearFactors ( float  x,
float  y,
float  z 
)

Set the Linear Factors (x,y,z) of the rigid body.

Parameters
xLinear Factor for x coordinate
yLinear Factor for y coordinate
zLinear Factor for z coordinate

◆ setRestitution()

void yourgame::util::RigidBody::setRestitution ( float  restitution)

Set the restitution of the rigid body.

Parameters
restitutionrestitution

◆ setSleepingThresholds()

void yourgame::util::RigidBody::setSleepingThresholds ( float  linear,
float  angular 
)

Set the Sleeping Thresholds of the rigid body.

Parameters
linearlinear sleeping threshold
angularangular sleeping threshold

◆ setTrafo()

void yourgame::util::RigidBody::setTrafo ( yourgame::math::Trafo  trafo)

Set transform (Trafo) of rigid body.

Attention
works for kinematic bodies only
Parameters
trafoTrafo to set

Member Data Documentation

◆ m_body

void* const yourgame::util::RigidBody::m_body

◆ m_name

std::string yourgame::util::RigidBody::m_name

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