ThreePipe
    Preparing search index...

    Interface IScene<TE>

    interface IScene<TE extends ISceneEventMap = ISceneEventMap> {
        __objExtUiConfigs?: Record<
            string,
            | undefined
            | (
                | UiObjectConfig<any, string, any>
                | Fof<ValOrArrOp<UiObjectConfig<any, string, any>>>
            )[],
        >;
        _currentGeometry?:
            | null
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
        _currentMaterial?:
            | null
            | IMaterial<IMaterialEventMap>
            | IMaterial<IMaterialEventMap>[];
        _customDepthMaterial?: Material<MaterialEventMap>;
        _customGBufferMaterial?: Material<MaterialEventMap>;
        _customNormalMaterial?: Material<MaterialEventMap>;
        _loadingPromise?: Promise<void>;
        _onGeometryUpdate?: EventListener2<
            "geometryUpdate",
            BufferGeometryEventMap,
            IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
        >;
        _rootPathRefreshed?: boolean;
        _rootPathRefreshing?: boolean;
        _sChildren?: Object3D<Object3DEventMap>[];
        acceptChildEvents?: boolean;
        activeCamera: ICamera;
        assetType: "model" | "light" | "camera" | "widget";
        autoUpgradeChildren?: boolean;
        background: null | Color | ITexture<TextureEventMap> | "environment";
        backgroundColor: null | Color;
        backgroundIntensity: number;
        boundingBox?: null | Box3;
        boundingSphere?: null | Sphere;
        children: IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >[];
        currentMaterial?:
            | null
            | IMaterial<IMaterialEventMap>
            | IMaterial<IMaterialEventMap>[];
        customGBufferMaterial?: Material<MaterialEventMap>;
        customNormalMaterial?: Material<MaterialEventMap>;
        defaultCamera: ICamera;
        environment: null | ITexture<TextureEventMap>;
        envMapIntensity: number;
        fixedEnvMapDirection: boolean;
        forcedOverrideMaterial?: Material<MaterialEventMap>;
        geometry?: IGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
        isCamera?: boolean;
        isLight?: boolean;
        isLine?: boolean;
        isLine2?: boolean;
        isLineSegments?: boolean;
        isLineSegments2?: boolean;
        isMesh?: boolean;
        isMeshLine?: boolean;
        isPoints?: boolean;
        isScene: true;
        isWidget?: boolean;
        mainCamera: ICamera;
        material?: IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[];
        materials?: IMaterial<IMaterialEventMap>[];
        modelObject: IScene<TE>;
        modelRoot: IObject3D;
        morphTargetDictionary?: Record<string, number>;
        morphTargetInfluences?: number[];
        objectExtensions?: IObjectExtension[];
        objectProcessor?: IObjectProcessor;
        parent:
            | null
            | IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >;
        parentRoot?:
            | null
            | IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >;
        renderCamera: ICamera;
        type: "Scene";
        uiConfig?: UiObjectConfig<any, string, any>;
        userData: IObject3DUserData;
        visible: boolean;
        add(
            ...object: IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >[],
        ): this;
        addObject<
            T extends
                IObject3D<
                    IObject3DEventMap,
                    undefined
                    | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,

                        | undefined
                        | IMaterial<IMaterialEventMap>
                        | IMaterial<IMaterialEventMap>[],
                >,
        >(
            imported: T,
            options?: AddObjectOptions,
        ): T & IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >;
        autoCenter(setDirty?: boolean, undo?: boolean): this;
        autoScale(
            autoScaleRadius?: number,
            isCentered?: boolean,
            setDirty?: boolean,
            undo?: boolean,
        ): this;
        clone(recursive?: boolean): this;
        computeBoundingBox(): void;
        computeBoundingSphere(): void;
        computeLineDistances(): void;
        copy(source: this, recursive?: boolean): this;
        dispose(removeFromParent?: boolean): void;
        findObjectsByName(name: string, parent?: any): any[];
        getBounds(precise?: boolean, ignoreInvisible?: boolean): Box3B;
        getObjectById<
            T extends
                IObject3D<
                    IObject3DEventMap,
                    undefined
                    | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,

                        | undefined
                        | IMaterial<IMaterialEventMap>
                        | IMaterial<IMaterialEventMap>[],
                > = IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >,
        >(
            id: number,
        ): undefined | T;
        getObjectByName<
            T extends
                IObject3D<
                    IObject3DEventMap,
                    undefined
                    | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,

                        | undefined
                        | IMaterial<IMaterialEventMap>
                        | IMaterial<IMaterialEventMap>[],
                > = IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >,
        >(
            name: string,
        ): undefined | T;
        getObjectByProperty<
            T extends
                IObject3D<
                    IObject3DEventMap,
                    undefined
                    | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,

                        | undefined
                        | IMaterial<IMaterialEventMap>
                        | IMaterial<IMaterialEventMap>[],
                > = IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >,
        >(
            name: string,
            value: string,
        ): undefined | T;
        pivotToBoundsCenter(setDirty?: boolean): () => void;
        pivotToPoint(point: Vector3, setDirty?: boolean): this;
        refreshUi(): void;
        remove(
            ...object: IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >[],
        ): this;
        setDirty(e?: ISceneSetDirtyOptions): void;
        toJSON(): any;
        traverse(callback: (object: IObject3D) => void): void;
        traverseAncestors(callback: (object: IObject3D) => void): void;
        traverseModels(
            callback: (object: IObject3D) => boolean | void,
            options: { visible: boolean; widgets: boolean; [key: string]: any },
        ): void;
        traverseVisible(callback: (object: IObject3D) => void): void;
        updateMorphTargets(): void;
        updateShaderProperties(
            material: {
                defines: Record<string, string | number | undefined>;
                uniforms: { [name: string]: IUniform<any> };
            },
        ): this;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    __objExtUiConfigs?: Record<
        string,
        | undefined
        | (
            | UiObjectConfig<any, string, any>
            | Fof<ValOrArrOp<UiObjectConfig<any, string, any>>>
        )[],
    >
    _currentGeometry?:
        | null
        | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>
    _currentMaterial?:
        | null
        | IMaterial<IMaterialEventMap>
        | IMaterial<IMaterialEventMap>[]
    _customDepthMaterial?: Material<MaterialEventMap>
    • store for the actual customDepthMaterial
    _customGBufferMaterial?: Material<MaterialEventMap>
    • store for the actual customGBufferMaterial
    _customNormalMaterial?: Material<MaterialEventMap>
    • store for the actual customNormalMaterial
    _loadingPromise?: Promise<void>

    A promise can be set by the object to indicate that the object is loading. This can be used by the scene, viewer, plugins to defer actions until the object is loaded.

    _onGeometryUpdate?: EventListener2<
        "geometryUpdate",
        BufferGeometryEventMap,
        IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
    >
    • for embedded objects
    _rootPathRefreshed?: boolean
    • for embedded objects
    _rootPathRefreshing?: boolean
    • when embedded objects are loading
    _sChildren?: Object3D<Object3DEventMap>[]
    • for embedded objects
    acceptChildEvents?: boolean

    Set to false to disable propagation of any events from its children.

    activeCamera: ICamera

    renamed to mainCamera

    assetType: "model" | "light" | "camera" | "widget"
    autoUpgradeChildren?: boolean

    Set to false to disable automatic call of upgradeObject3D when a child is added.

    background: null | Color | ITexture<TextureEventMap> | "environment"

    Defines the background of the scene.

    Valid inputs are:

    • A Color for defining a uniform colored background.
    • A Texture for defining a (flat) textured background.
    • Texture cubes (CubeTexture) or equirectangular textures for defining a skybox.
    • A value 'environment' will force the background to be same as environment.

    null

    backgroundColor: null | Color

    Custom property for background tint, or just background color rendered in the shader

    backgroundIntensity: number

    Attenuates the color of the background. Only applies to background textures.

    1

    Expects a Float

    boundingBox?: null | Box3

    For InstancedMesh, SkinnedMesh etc

    boundingSphere?: null | Sphere

    For InstancedMesh, SkinnedMesh etc

    Array with object's children.

    THREE.Object3DGroup | Group for info on manually grouping objects.

    []

    currentMaterial?:
        | null
        | IMaterial<IMaterialEventMap>
        | IMaterial<IMaterialEventMap>[]
    customGBufferMaterial?: Material<MaterialEventMap>

    Required for plugins like GBufferPlugin

    customNormalMaterial?: Material<MaterialEventMap>

    Required for plugins like NormalBufferPlugin

    defaultCamera: ICamera
    environment: null | ITexture<TextureEventMap>

    Sets the environment map for all physical materials in the scene. However, it's not possible to overwrite an existing texture assigned to MeshStandardMaterial.envMap.

    null

    envMapIntensity: number
    fixedEnvMapDirection: boolean
    forcedOverrideMaterial?: Material<MaterialEventMap>

    If this is set, it will be returned when accessing material property. see GBufferRenderPass for sample usage

    isCamera?: boolean
    isLight?: boolean
    isLine?: boolean
    isLine2?: boolean
    isLineSegments?: boolean
    isLineSegments2?: boolean
    isMesh?: boolean
    isMeshLine?: boolean
    isPoints?: boolean
    isScene: true

    Read-only flag to check if a given object is of type Scene.

    This is a constant value

    true

    isWidget?: boolean
    mainCamera: ICamera

    Main camera that the user controls

    Same as material but always returns an array. To set, just set material property

    modelObject: IScene<TE>

    use object directly

    modelRoot: IObject3D
    morphTargetDictionary?: Record<string, number>
    morphTargetInfluences?: number[]
    objectExtensions?: IObjectExtension[]
    objectProcessor?: IObjectProcessor
    parent:
        | null
        | IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >

    Object's parent in the scene graph.

    An object can have at most one parent.

    null

    parentRoot?:
        | null
        | IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >

    Parent/Ancestor of this object to bubble events to. This is set internally by setupObject3D.

    renderCamera: ICamera

    Camera that in currently being rendered.

    type: "Scene"

    Scene

    uiConfig?: UiObjectConfig<any, string, any>

    An object that can be used to store custom data about the Object3D.

    It should not hold references to functions as these will not be cloned.

    {}

    visible: boolean

    Object gets rendered if true.

    true

    Methods

    • Moves the bounding box center of the object to the center of the world

      Parameters

      • OptionalsetDirty: boolean

        calls setDirty

      • Optionalundo: boolean

        undo any previous autoCenter operation

      Returns this

      true
      
    • Scales the object to fit the given radius.

      Parameters

      • OptionalautoScaleRadius: number

        optional (taken from userData.autoScaleRadius by default)

      • OptionalisCentered: boolean

        optional (taken from userData.isCentered by default)

      • OptionalsetDirty: boolean

        true by default

      • Optionalundo: boolean

        undo any previous autoScale operation

      Returns this

    • Returns a clone of this object and optionally all descendants.

      Parameters

      • Optionalrecursive: boolean

        If true, descendants of the object are also cloned. Default true

      Returns this

    • For InstancedMesh, SkinnedMesh etc Computes bounding box, updating .boundingBox attribute.

      Returns void

      Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.

    • Copy the given object into this object

      Parameters

      • source: this
      • Optionalrecursive: boolean

        If true, descendants of the object are also copied. Default true

      Returns this

      Note: event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

    • Parameters

      • OptionalremoveFromParent: boolean

        remove from parent. Default true

      Returns void

    • Parameters

      • Optionalprecise: boolean
      • OptionalignoreInvisible: boolean

      Returns Box3B

    • Moves the object pivot to the center of the bounding box.

      The object will rotate around the new pivot.

      Parameters

      • OptionalsetDirty: boolean

        calls setDirty

      Returns () => void

      undo function

      true
      
    • Moves the object pivot to the given point

      The object will rotate around the new pivot.

      Parameters

      • point: Vector3

        point to move the pivot to

      • OptionalsetDirty: boolean

        calls setDirty

      Returns this

      undo function

      true
      
    • Executes the callback on this object and all descendants.

      Parameters

      • callback: (object: IObject3D) => void

        A function with as first argument an Object3D object.

      Returns void

      Note: Modifying the scene graph inside the callback is discouraged.

    • Traverse only upgraded objects with extra options

      Parameters

      • callback: (object: IObject3D) => boolean | void
      • options: { visible: boolean; widgets: boolean; [key: string]: any }

      Returns void

    • Like traverse, but the callback will only be executed for visible objects

      Parameters

      • callback: (object: IObject3D) => void

        A function with as first argument an Object3D object.

      Returns void

      Descendants of invisible objects are not traversed.