Transform Transform { get; set; }

robot_2Generated
code_blocksInput

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

Use the Transform property to get or set the transformation of a SceneObject. This can be useful for moving, rotating, or scaling the object within the scene. If the object has a parent, the transformation is relative to that parent; otherwise, it is relative to the SceneWorld.

Example

// Example of accessing and modifying the Transform property of a SceneObject
SceneObject myObject = new SceneObject();

// Get the current transform
Transform currentTransform = myObject.Transform;

// Modify the transform
currentTransform.Position += new Vector3(10, 0, 0); // Move the object 10 units on the X axis
currentTransform.Rotation *= Rotation.FromYaw(45); // Rotate the object 45 degrees around the Y axis

// Apply the modified transform back to the object
myObject.Transform = currentTransform;