SceneAnchorclass

A serializable transform that is either absolute in world space, or local to a GameObject so it follows that object. It carries position and rotation - so it can describe a direction or a frame as well as a location. Resolve it with `Sandbox.SceneAnchor.ToWorld`. Implicitly constructible from a `Vector3` (a world position) or a `Transform` (a world transform).

objectSceneAnchor
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed struct Sandbox.SceneAnchor

Methods1

Showing 1 methods

public Transform ToWorld()PUBLIC

Resolves this anchor to a world-space transform.

Returns:Transform

Properties5

Showing 5 properties

public bool Sandbox.SceneAnchor.IsAnchored { get; set; }PUBLICGETSET

True when this anchor is attached to a valid object.

Returns:bool

public Vector3 Sandbox.SceneAnchor.LocalPosition { get; set; }PUBLICGETSET

Position - in world space when `Sandbox.SceneAnchor.Parent` is null, otherwise local to it.

Returns:Vector3

public Rotation Sandbox.SceneAnchor.LocalRotation { get; set; }PUBLICGETSET

Rotation - in world space when `Sandbox.SceneAnchor.Parent` is null, otherwise local to it.

Returns:Rotation

public Sandbox.GameObject Sandbox.SceneAnchor.Parent { get; set; }PUBLICGETSET

The object this anchor is attached to, or null for a fixed world-space anchor. When set, `Sandbox.SceneAnchor.LocalPosition` and `Sandbox.SceneAnchor.LocalRotation` are interpreted relative to it.

Returns:GameObject

On this page