Rotation Rotation { get; set; }

robot_2Generated
code_blocksInput

Description

The Rotation property of a SceneObject represents the orientation of the object in 3D space. This rotation is relative to the object's parent, if it has one, or to the SceneWorld if no parent is set. The rotation is defined using the Rotation type, which typically encapsulates a quaternion or Euler angles to represent 3D rotations.

Usage

To get or set the rotation of a SceneObject, you can use the Rotation property. This property allows you to manipulate the orientation of the object within its scene. When setting the rotation, ensure that the value is a valid Rotation object.

Example

// Example of setting the rotation of a SceneObject
SceneObject myObject = new SceneObject();

// Set the rotation to a new Rotation value
myObject.Rotation = new Rotation( 0, 90, 0 ); // Rotates the object 90 degrees around the Y-axis

// Retrieve the current rotation
Rotation currentRotation = myObject.Rotation;

// Output the current rotation
// Note: Avoid using Console.WriteLine in Sandbox environment
// Instead, use logging or debugging tools provided by the environment
Log.Info($"Current Rotation: {currentRotation}");