Class Transform

Class Documentation

class Transform

A transform defining position, rotation, and scale.

Public Functions

inline Transform(glm::vec3 position, glm::vec3 rotation, glm::vec3 scale)

Create a new transform.

Parameters:
  • position – Position relative to the parent

  • rotation – Rotation about the center

  • scale – Scale from the center

inline glm::vec3 GetPosition() const

Get the position.

Returns:

The position

inline glm::vec3 GetRotation() const

Get the rotation.

Returns:

The rotation

inline glm::vec3 GetScale() const

Get the scale.

Returns:

The scale

inline void SetPosition(glm::vec3 newPos)

Set the position.

Parameters:

newPos – The new position

inline void SetRotation(glm::vec3 newRot)

Set the rotation.

Parameters:

newRot – The new rotation

inline void SetScale(glm::vec3 newScale)

Set the scale.

Parameters:

newScale – The new scale

inline glm::mat4 GetTransformationMatrix() const

Get the matrix representing the applied transformations.

Returns:

The transformation matrix