Skip to content

Transform

Imagment edited this page Mar 26, 2025 · 5 revisions

Explanation

The Transform class defines an object's position, rotation, and scale in 3D space (or 2D if the layer is excluded). It provides basic transformation functionalities such as translation.

Constructors

Constructor Description
Transform() Default constructor, initializes position to (0,0,0), rotation to 0, and scale to (1,1,1).
explicit Transform(Actor* parent) Creates a Transform instance and associates it with a parent Actor.
Transform(const Transform& other) Copy constructor.
Transform& operator=(const Transform& other) Copy assignment operator.

Members

Member Type Description
Vector3 position Vector3 The position of the object in 3D space. Defaults to (0,0,0).
double rotation double The rotation of the object in degrees. Defaults to 0.0.
Vector3 scale Vector3 The scale of the object. Defaults to (1,1,1).

Functions

Method Description
std::shared_ptr<Component> Clone() const Creates and returns a copy of this Transform object.
void Translate(Vector3 offset) Moves the object by a given offset.

Overview

Structure of the engine

Silver Mathematics

Components

Clone this wiki locally