Component holding an object's position, rotation and scale.
More...
#include <transform_component.hpp>
|
| bool | isUnique = true |
| | If true, only one of this component type may exist per object.
|
| |
Component holding an object's position, rotation and scale.
Every spatial game object carries a Transform. Convenience static helpers (from, posFrom, posFor, ...) read or write the transform of a given GameObject without manually fetching the component.
◆ ~Transform()
| cangine::Transform::~Transform |
( |
| ) |
|
|
overridedefault |
◆ firstFrame()
| void cangine::Transform::firstFrame |
( |
| ) |
|
|
overridevirtual |
◆ from()
Fetches the Transform component of a game object.
- Parameters
-
- Returns
- The object's Transform component.
◆ getPosition()
| Vector3 cangine::Transform::getPosition |
( |
| ) |
const |
Returns the position.
- Returns
- Current position.
◆ getRotation()
| Vector3 cangine::Transform::getRotation |
( |
| ) |
const |
Returns the rotation.
- Returns
- Current rotation in degrees.
◆ getScale()
| Vector3 cangine::Transform::getScale |
( |
| ) |
const |
Returns the scale.
- Returns
- Current scale factor per axis.
◆ posFor()
Sets the position on a game object's Transform.
- Parameters
-
| go | Game object to modify. |
| pos | New position. |
◆ posFrom()
Reads the position of a game object's Transform.
- Parameters
-
- Returns
- The object's position.
◆ rotFor()
Sets the rotation on a game object's Transform.
- Parameters
-
| go | Game object to modify. |
| rot | New rotation in degrees. |
◆ rotFrom()
Reads the rotation of a game object's Transform.
- Parameters
-
- Returns
- The object's rotation in degrees.
◆ scaleFor()
Sets the scale on a game object's Transform.
- Parameters
-
| go | Game object to modify. |
| scale | New scale factor per axis. |
◆ scaleFrom()
Reads the scale of a game object's Transform.
- Parameters
-
- Returns
- The object's scale.
◆ setPosition()
| void cangine::Transform::setPosition |
( |
Vector3 |
positionIn | ) |
|
Sets the position.
- Parameters
-
◆ setRotation()
| void cangine::Transform::setRotation |
( |
Vector3 |
rotationIn | ) |
|
Sets the rotation.
- Parameters
-
| rotationIn | New rotation in degrees. |
◆ setScale()
| void cangine::Transform::setScale |
( |
Vector3 |
scaleIn | ) |
|
Sets the scale.
- Parameters
-
| scaleIn | New scale factor per axis. |
◆ position
| Vector3 cangine::Transform::position |
|
private |
◆ rotation
| Vector3 cangine::Transform::rotation |
|
private |
Rotation in degrees (per axis).
◆ scale
The documentation for this class was generated from the following files: