All the methods to manipulate the Transform component.
More...
|
void | updatePosition (const unsigned int &id, const glm::vec3 &position) |
| Updates the position of the given entity.
|
void | updateScale (const unsigned int &id, const glm::vec3 &scale) |
| Updates the scale of the given entity.
|
void | updateRotation (const unsigned int &id, const glm::vec3 &rotation) |
| Updates the rotation of the given entity.
|
void | addPosition (const unsigned int &id, const glm::vec3 &offset) |
| Adds an offset to the position of the given entity.
|
void | addScale (const unsigned int &id, const glm::vec3 &offset) |
| Adds an offset to the scale of the given entity.
|
void | addRotation (const unsigned int &id, const glm::vec3 &offset) |
| Adds an offset to the rotation of the given entity.
|
glm::vec3 | getPosition (const unsigned int &id) |
| Retrieves the position of the given entity.
|
glm::vec3 | getScale (const unsigned int &id) |
| Retrieves the scale of the given entity.
|
glm::vec3 | getRotation (const unsigned int &id) |
| Retrieves the rotation of the given entity.
|
glm::mat4 | getModelMatrix (const unsigned int &id) |
| Retrieves the model matrix of the given entity.
|
void | updateModelMatrix (const unsigned int &id) |
| Updates the model matrix of the given entity.
|
void | updateAllModelMatrix () |
| Updates all model matrix of each entity with the Transform component.
|
All the methods to manipulate the Transform component.
- Note
- It calls the Transform component methods already defined.
- See also
- Transform
◆ addPosition()
void systems::transform::addPosition |
( |
const unsigned int & | id, |
|
|
const glm::vec3 & | offset ) |
Adds an offset to the position of the given entity.
- Parameters
-
id | the entity id |
offset | the position offset to be added |
◆ addRotation()
void systems::transform::addRotation |
( |
const unsigned int & | id, |
|
|
const glm::vec3 & | offset ) |
Adds an offset to the rotation of the given entity.
It works the same way of updateRotation.
- See also
- systems::transform::updateRotation()
- Parameters
-
id | the entity id |
offset | the rotation offset to be added |
◆ addScale()
void systems::transform::addScale |
( |
const unsigned int & | id, |
|
|
const glm::vec3 & | offset ) |
Adds an offset to the scale of the given entity.
- Parameters
-
id | the entity id |
offset | the scale offset to be added |
◆ getModelMatrix()
glm::mat4 systems::transform::getModelMatrix |
( |
const unsigned int & | id | ) |
|
Retrieves the model matrix of the given entity.
If the model matrix is dirty it will be updated by the component automatically.
- Parameters
-
- Returns
- the entity model matrix
◆ getPosition()
glm::vec3 systems::transform::getPosition |
( |
const unsigned int & | id | ) |
|
Retrieves the position of the given entity.
- Parameters
-
- Returns
- the entity position
◆ getRotation()
glm::vec3 systems::transform::getRotation |
( |
const unsigned int & | id | ) |
|
Retrieves the rotation of the given entity.
- Parameters
-
- Returns
- the entity rotation in Euler angle.
◆ getScale()
glm::vec3 systems::transform::getScale |
( |
const unsigned int & | id | ) |
|
Retrieves the scale of the given entity.
- Parameters
-
- Returns
- the entity scale
◆ updateModelMatrix()
void systems::transform::updateModelMatrix |
( |
const unsigned int & | id | ) |
|
Updates the model matrix of the given entity.
If the model matrix is dirty it will update the model matrix and also the entity collider if it has one.
- Parameters
-
◆ updatePosition()
void systems::transform::updatePosition |
( |
const unsigned int & | id, |
|
|
const glm::vec3 & | position ) |
Updates the position of the given entity.
- Parameters
-
id | the entity id |
position | the entity new position |
◆ updateRotation()
void systems::transform::updateRotation |
( |
const unsigned int & | id, |
|
|
const glm::vec3 & | rotation ) |
Updates the rotation of the given entity.
It takes an Euler angle glm::vec3 in degrees and it will be converted in radians by the component.
- Parameters
-
id | the entity id |
rotation | the entity new rotation in degrees |
◆ updateScale()
void systems::transform::updateScale |
( |
const unsigned int & | id, |
|
|
const glm::vec3 & | scale ) |
Updates the scale of the given entity.
- Parameters
-
id | the entity id |
scale | the entity new scale |