Class SceneInstance

Contains information about an instantiated scene.

Hierarchy

  • FrameworkObject
    • SceneInstance

Constructors

  • Creates a brand new scene with an empty root object.

    Parameters

    • name: string
    • OptionalisInternalConstructor: boolean

    Returns SceneInstance

Accessors

  • get activeTime(): number
  • The active time of the scene, if the scene is in play mode.

    Returns number

  • get isDestroyed(): boolean
  • Returns true if the scene has been destroyed.

    Returns boolean

  • get isSyncDirty(): boolean
  • Returns true if the scene has changes that need to be persisted.

    Returns boolean

  • get name(): string
  • Name of the scene.

    Returns string

  • set name(value): void
  • Parameters

    • value: string

    Returns void

  • get objectManager(): SceneNodeManager
  • Returns the manager that's responsible for tracking all the RSX objects and RSX object handles in this scene instance.

    Returns SceneNodeManager

  • get originScene(): Scene
  • Determines the original scene resource this instance was created from.

    Returns Scene

  • get physics(): PhysicsScene
  • Physical representation of the scene, as assigned by the physics sub-system. Exact implementation depends on the physics plugin used.

    Returns PhysicsScene

  • get runtimeID(): number
  • Returns an ID that uniquely identifies a scene instance at runtime.

    Returns number

  • get uuid(): UUID
  • Returns the UUID of the Scene resource this scene was instantated from.

    Returns UUID

Methods

  • Creates a new SceneObject with the specified name. Object will be placed in the top of the scene hierarchy.

    Parameters

    • name: string

      Name of the scene object.

    • Optionalflags: EnumValue<SceneObjectFlag, number>

      Optional flags that control object behavior. See SceneObjectFlags.

    Returns SceneObject

    Newly created scene object.

  • Virtual

    Destroys the scene instance and all objects within it.

    Returns void

  • Determines whether the specified flag is set on the scene instance.

    Parameters

    Returns boolean

  • Instantiates a template by creating an instance of the template's scene object hierarchy. The returned hierarchy will be parented to world root of the current scene.

    Parameters

    • templateHandle: Template

      Template resource to instantiate.

    Returns SceneObject

    Instantiated clone of the template's scene object hierarchy.

  • Notifies the scene instance that changes were persisted.

    Returns void

  • Notifies the scene instance that changes were made since last the scene instance was persisted.

    Returns void

  • Notifies the scene instance that changes were made to a particular scene object since the scene instance was persisted.

    Parameters

    • sceneObjectUUID: UUID

      The UUID of the scene object to be marked as dirty.

    Returns void

    This is an internal API, to mark a SceneObject as dirty use SceneObject::MarkAsSyncDirty instead.

  • Sets (or unsets) a flag from the scene instance.

    Parameters

    Returns void

Events

didAddSceneObject: Event<[SceneObject], void>

Called when a scene object was added to the scene instance.

willRemoveSceneObject: Event<[SceneObject], void>

Called when a scene object is about to be removed from the scene instance.

willParentChange: Event<[SceneObject], void>

Called before the object is about to be reparented to another object.

didParentChange: Event<[SceneObject], void>

Called after the object has been reparent to another object.

didActiveStateChange: Event<[SceneObject], void>

Called after the scene object's active state was changed.

didNameChange: Event<[SceneObject], void>

Called after the scene object's name was changed.

didAddComponent: Event<[SceneObject, Component], void>

Called when a component was added to a scene object.

willRemoveComponent: Event<[SceneObject, Component], void>

Called before a component is remvoed from a scene object.

didRemoveComponent: Event<[SceneObject, UUID], void>

Called after a component is removed from a scene object.

didTemplateLinkChange: Event<[SceneObject], void>

Called after the scene object's template link state was changed.

willChangeSceneRoot: Event<[], void>

Called before the root scene object's will be changed.

didChangeSceneRoot: Event<[], void>

Called after the root scene object's has changed.

didChangeSyncDirtyState: Event<[boolean], void>

Called when the dirty state of the scene changed.