Description
The Transform
property of a SceneObject
provides the transformation details of the object within the scene. This transformation is relative to the object's parent, if one is set, or to the SceneWorld
if no parent is specified. The transformation includes position, rotation, and scale, allowing for precise control over the object's placement and orientation in the scene.
Usage
To access or modify the Transform
of a SceneObject
, you can use the following syntax:
SceneObject myObject = new SceneObject();
Transform currentTransform = myObject.Transform;
// Modify the transform
currentTransform.Position = new Vector3(10, 20, 30);
currentTransform.Rotation = Rotation.From(45, 90, 0);
// Apply the modified transform back to the object
myObject.Transform = currentTransform;
This allows you to manipulate the object's position, rotation, and scale within the scene.
Example
// Example of accessing and modifying the Transform property
SceneObject myObject = new SceneObject();
// Access the current transform
Transform currentTransform = myObject.Transform;
// Modify the position
currentTransform.Position = new Vector3(10, 20, 30);
// Modify the rotation
currentTransform.Rotation = Rotation.From(45, 90, 0);
// Apply the modified transform back to the object
myObject.Transform = currentTransform;