-
- Notifications
You must be signed in to change notification settings - Fork 0
Transform
Imagment edited this page Mar 26, 2025 · 5 revisions
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.
| 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. |
| 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). |
| 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. |