CG-Project2
Loading...
Searching...
No Matches
systems::physic Namespace Reference

This namespaces contains all utilities for entities affected by physic. More...

Functions

void resetGravitySolver (const unsigned int &id)
 Resets velocity on the on y-axis, acceleration and force of the given entity.
glm::vec3 getVelocity (const unsigned int &id)
 Retrieves the velocity of the given entity.
void updateVelocity (const unsigned int &id, const glm::vec3 velocity)
 Updates the velocity of the given entity.
void addVelocity (const unsigned int &id, const glm::vec3 offset)
 Adds the given offset to the velocity of the given entity.
void updateRestitutionFactor (const unsigned int &id, const float &factor)
 Updates the restitution factor of the given entity.
glm::vec3 getAcceleration (const unsigned int &id)
 Retrieves the acceleration of the given entity.
void updateAcceleration (const unsigned int &id, const glm::vec3 acceleration)
 Updates the acceleration of the given entity.
void addAcceleration (const unsigned int &id, const glm::vec3 offset)
 Adds the given offset to the acceleration of the given entity.
glm::vec3 getForce (const unsigned int &id)
 Retrieves the force of the given entity.
void updateForce (const unsigned int &id, const glm::vec3 force)
 Updates the force of the given entity.
void addForce (const unsigned int &id, const glm::vec3 offset)
 Adds the given offset to the force of the given entity.
float getMass (const unsigned int &id)
 Retrieves the mass of the given entity.
void updateMass (const unsigned int &id, const float &mass)
 Updates the mass of the given entity.

Detailed Description

This namespaces contains all utilities for entities affected by physic.

Function Documentation

◆ addAcceleration()

void systems::physic::addAcceleration ( const unsigned int & id,
const glm::vec3 offset )

Adds the given offset to the acceleration of the given entity.

Parameters
identity id
offsetthe offset to add

◆ addForce()

void systems::physic::addForce ( const unsigned int & id,
const glm::vec3 offset )

Adds the given offset to the force of the given entity.

Parameters
identity id
offsetthe offset to add

◆ addVelocity()

void systems::physic::addVelocity ( const unsigned int & id,
const glm::vec3 offset )

Adds the given offset to the velocity of the given entity.

Parameters
identity id
offsetthe offset to add

◆ getAcceleration()

glm::vec3 systems::physic::getAcceleration ( const unsigned int & id)

Retrieves the acceleration of the given entity.

Parameters
identity id
Returns
a glm::vec3 vector containing entity acceleration

◆ getForce()

glm::vec3 systems::physic::getForce ( const unsigned int & id)

Retrieves the force of the given entity.

Parameters
identity id
Returns
a glm::vec3 vector containing entity force

◆ getMass()

float systems::physic::getMass ( const unsigned int & id)

Retrieves the mass of the given entity.

Parameters
identity id
Returns
the entity mass

◆ getVelocity()

glm::vec3 systems::physic::getVelocity ( const unsigned int & id)

Retrieves the velocity of the given entity.

Parameters
identity id
Returns
a glm::vec3 vector containing entity velocity

◆ resetGravitySolver()

void systems::physic::resetGravitySolver ( const unsigned int & id)

Resets velocity on the on y-axis, acceleration and force of the given entity.

Warning
This means if there is a velocity on y-axis external to GravitySolver it will be lost when this method is called.
Parameters
identity id

◆ updateAcceleration()

void systems::physic::updateAcceleration ( const unsigned int & id,
const glm::vec3 acceleration )

Updates the acceleration of the given entity.

Parameters
identity id
accelerationentity new acceleration

◆ updateForce()

void systems::physic::updateForce ( const unsigned int & id,
const glm::vec3 force )

Updates the force of the given entity.

Parameters
identity id
forceentity new force

◆ updateMass()

void systems::physic::updateMass ( const unsigned int & id,
const float & mass )

Updates the mass of the given entity.

Parameters
identity id
massentity new mass

◆ updateRestitutionFactor()

void systems::physic::updateRestitutionFactor ( const unsigned int & id,
const float & factor )

Updates the restitution factor of the given entity.

Parameters
identity id
factorentity new restitution factor

◆ updateVelocity()

void systems::physic::updateVelocity ( const unsigned int & id,
const glm::vec3 velocity )

Updates the velocity of the given entity.

Parameters
identity id
velocityentity new velocity