Description
The Offset
property of the SceneLoadOptions
class specifies a transformation that is applied to the scene when it is loaded. This transformation can include translation, rotation, and scaling, allowing you to adjust the position, orientation, and size of the scene in the world space.
Usage
To use the Offset
property, create an instance of SceneLoadOptions
and set the Offset
property to a Transform
object that represents the desired transformation. This transformation will be applied to the scene when it is loaded.
Example
// Create a new SceneLoadOptions instance
SceneLoadOptions loadOptions = new SceneLoadOptions();
// Define a transformation
Transform sceneOffset = new Transform();
sceneOffset.Position = new Vector3(10, 0, 0); // Move the scene 10 units along the X-axis
sceneOffset.Rotation = Rotation.FromAxis(Vector3.Up, 45); // Rotate the scene 45 degrees around the Y-axis
// Set the Offset property
loadOptions.Offset = sceneOffset;
// Load the scene with the specified options
SceneFile scene = loadOptions.GetSceneFile();
// Assume LoadScene is a method to load the scene with the given options
LoadScene(scene, loadOptions);