ThreePipe
    Preparing search index...

    Class RootScene<TE>

    Type Parameters

    Hierarchy

    Implements

    Index

    Constructors

    Properties

    assetType: "model" = ...
    autoDisposeSceneMaps: boolean = true

    Calls dispose on current old environment map, background map when it is changed. Runtime only (not serialized)

    autoNearFarEnabled: boolean = true

    For Programmatically toggling autoNearFar. This property is not supposed to be in the UI or serialized. Use camera.userData.autoNearFar for UI and serialization This is used in PickingPlugin autoNearFar will still be disabled if this is true and camera.userData.autoNearFar is false

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

    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 = null

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

    backgroundIntensity: number = 1

    The intensity for the environment light.

    Array with object's children.

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

    []

    clone: (recursive?: boolean) => this

    Returns a clone of this object and optionally all descendants.

    Type declaration

      • (recursive?: boolean): this
      • Parameters

        • Optionalrecursive: boolean

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

        Returns this

    copy: (source: this, recursive?: boolean, ...args: any[]) => this

    Copy the given object into this object

    Type declaration

      • (source: this, recursive?: boolean, ...args: any[]): this
      • Parameters

        • source: this
        • Optionalrecursive: boolean

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

        • ...args: any[]

        Returns this

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

    defaultCamera: ICamera

    The default camera in the scene

    environment: null | ITexture<TextureEventMap> = null

    The default environment map used when rendering materials in the scene

    envMapIntensity: number = 1

    The intensity for the environment light.

    envMapRotation: number = 0

    Rotation in radians of the default environment map. Same as environment.rotation.

    Note - this is not serialized here, but inside the texture.

    fixedEnvMapDirection: boolean = false

    Fixed direction environment reflections irrespective of camera position.

    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

    Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

    Type declaration

    Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.

    id

    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

    Searches through an object and its children, starting with the object itself, and returns the first with a matching name.

    Type declaration

    Note that for most objects the name is an empty string by default

    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

    Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.

    Type declaration

    isRootScene: true
    modelRoot: IObject3D

    The root object where all imported objects are added.

    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

    refreshUi: any = ...
    remove: (
        ...object: IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >[],
    ) => this

    Removes a Object3D as child of this Object3D.

    An arbitrary number of objects may be removed.

    Group for info on manually grouping objects.

    textureSlots: Record<string, ITexture> = {}

    Extra textures/envmaps that can be used by objects/materials/plugins and will be serialized.

    traverse: (callback: (object: IObject3D) => void) => void

    Executes the callback on this object and all descendants.

    Type declaration

      • (callback: (object: IObject3D) => void): void
      • 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.

    traverseAncestors: (callback: (object: IObject3D) => void) => void

    Executes the callback on all ancestors.

    Type declaration

      • (callback: (object: IObject3D) => void): void
      • 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.

    traverseModels: any = ...

    Traverse only upgraded objects with extra options

    traverseVisible: (callback: (object: IObject3D) => void) => void

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

    Type declaration

      • (callback: (object: IObject3D) => void): void
      • Parameters

        • callback: (object: IObject3D) => void

          A function with as first argument an Object3D object.

        Returns void

    Descendants of invisible objects are not traversed.

    uiConfig: UiObjectConfig

    Accessors

    Methods

    • Parameters

      • dispose: boolean = false
      • setDirty: boolean = true

      Returns void

    • Dispose the scene and clear all resources. WARNING - Not fully implemented yet, just clears the scene.

      Parameters

      • clear: boolean = true

      Returns void

    • Parameters

      • setDirty: boolean = true
      • clear: boolean = true

      Returns void

    • Refreshes the scene active camera near far values, based on the scene bounding box. This is called automatically every time the camera fov is updated.

      Returns void

    • Returns the bounding box of the whole scene (model root and other meta objects). To get the bounds of just the objects added by the user(not by plugins) use new Box3B().expandByObject(scene.modelRoot)

      Parameters

      • precise: boolean = false
      • ignoreInvisible: boolean = true
      • ignoreWidgets: boolean = true
      • OptionalignoreObject: (obj: Object3D) => boolean

      Returns Box3B

    • Similar to getBounds, but returns the bounding box of just the modelRoot.

      Parameters

      • precise: boolean = false
      • ignoreInvisible: boolean = true
      • ignoreWidgets: boolean = true
      • OptionalignoreObject: (obj: Object3D) => boolean

      Returns Box3B

    • Refreshes the scene active camera near far values, based on the scene bounding box. This is called automatically every time the camera is updated.

      Returns void

    • For visualizing the scene bounds. API incomplete.

      Parameters

      • Optionalevent: Partial<({ object: IObject3D<IObject3DEventMap, IGeometry<NormalBufferAttributes, BufferGeometryEventMap> | undefined, IMaterial<...> | ... 1 more ... | undefined>; geometry: IGeometry<...>; bubbleToParent: boolean; } & AnyOptions & { ...; }) | ({ ...; } & Omit<...>) | { ...; }> & ISceneSetDirtyOptions & { ...; }

      Returns this

    • Parameters

      • rootObject: undefined | Object3D<Object3DEventMap> = undefined

        The object to point at.

      • centerOffset: Vector3 = ...

        The distance offset from the object to point at.

      • targetOffset: Vector3 = ...

        The distance offset for the target from the center of object to point at.

      Returns void

      Sets the camera pointing towards the object at a specific distance.

    • Sets the backgroundColor property from a string, number or Color, and updates the scene.

      Parameters

      • color: null | string | number | Color

      Returns void

    • Equivalent to setDirty({refreshScene: true}), dispatches 'sceneUpdate' event with the specified options.

      Parameters

      Returns this

      use refreshScene

    • Parameters

      • material: {
            defines: Record<string, string | number | undefined>;
            uniforms: { [name: string]: IUniform<any> };
        }

      Returns this