omega-game-engine
    Preparing search index...

    Represents a scene in the 3D world, acting as a container for entities and managing the main game loop operations like update and draw. *

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any
    Index

    Constructors

    Properties

    _className: string = 'Scene'
    _objects: SceneEntity[]

    An array of all entities within the scene. * *

    _renderPipeline: RenderPipeline
    _serializationIgnoreKeys: string[]
    _uuid: string
    active: boolean = true

    A flag indicating if the entity is active and should be updated. *

    behaviours: SceneEntityBehaviour[]

    A collection of behaviours specific to the scene. *

    clearColor: Color = Colors.aliceBlue

    The background color of the scene, in RGB format. *

    destroyed: boolean = false

    A flag indicating if the entity has been destroyed. * *

    ellapsedTime: number = 0

    The total elapsed time since the scene started. * *

    entityType: number = EntityType.SCENE

    The type of the entity, specifically set to SCENE. * *

    gl: WebGL2RenderingContext

    The WebGL2 rendering context. * *

    inEditMode: boolean = false

    A flag indicating whether the scene is in edit mode (inside editor). *

    isRunning: boolean = false

    A flag indicating whether the scene's update loop is running. *

    name: string = ''
    scene: Scene

    The scene to which this entity belongs. *

    sceneFog: SceneFog
    show: boolean = true

    A flag indicating if the entity should be rendered. *

    tag: string = 'Scene'

    The tag for the scene entity. * *

    transform: Transform

    The transform component of the entity. *

    updateInEditor: boolean = false

    A flag to determine if the entity should update in the editor. *

    Accessors

    • get className(): string

      Returns string

    Methods

    • Retrieves the first behaviour of a specific type from the collection. *

      Type Parameters

      Parameters

      • constructor: new (...args: any[]) => T

        The constructor function of the type to filter by. *

      Returns undefined | T

      • The first behaviour found of the specified type, or undefined if none is found.
    • Retrieves all behaviours of a specific type from the collection. *

      Type Parameters

      Parameters

      • constructor: new (...args: any[]) => T

        The constructor function of the type to filter by. *

      Returns T[]

      • An array of behaviours of the specified type.
    • Retrieves an entity by its name. *

      Parameters

      • name: string

        The name of the entity to find. *

      Returns undefined | SceneEntity

      • The found entity, or undefined.
    • Retrieves an entity by its unique identifier. *

      Parameters

      • uuid: string

        The UUID of the entity to find. *

      Returns undefined | SceneEntity

      • The found entity, or undefined.
    • Retrieves an entity by Classname. *

      Parameters

      • className: string

      Returns undefined | SceneEntity

      • The found entity, or undefined.
    • Retrieves entities of a specific type from the collection. *

      Type Parameters

      Parameters

      • constructor: new (...args: any[]) => T

        The constructor function of the type to filter by. *

      Returns T[]

      • An array of entities of the specified type.
    • Retrieves all entities with a specific tag. *

      Parameters

      • tag: string

        The tag to filter by. *

      Returns SceneEntity[]

      • An array of entities with the given tag.
    • Retrieves all entity by its Classname. *

      Parameters

      • className: string

        The name of the entity class to find. *

      Returns SceneEntity[]

      • The found entity, or undefined.
    • Sets the WebGL2 rendering context for the scene and its rendering behaviours. *

      Parameters

      • gl: WebGL2RenderingContext

        The WebGL2 rendering context. *

      Returns void

    • Updates the state of the scene and all its active entities. * *

      Parameters

      • ellapsed: number

        The elapsed time in seconds since the last update. *

      Returns void

    • Creates a new SceneEntity instance with a given name and an optional transform.

      Parameters

      • Optionalname: string = 'Entity'

        The name of the new entity. *

      • Optionaltransform: Transform

        The transform for the entity. A new one is created if none is provided. *

      Returns SceneEntity

      • The newly created SceneEntity instance.