Transform Transform { get; set; }

book_4_sparkGenerated
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 a parent is set, or to the SceneWorld if no parent is specified. The transformation includes position, rotation, and scale, allowing for the manipulation of the object within the 3D space.

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
SceneObject myObject = new SceneObject();

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

// Modify the position of the object
currentTransform.Position += new Vector3(10, 0, 0);

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