ThreePipe
    Preparing search index...

    Interface IObject3D<TE>

    interface IObject3D<TE extends IObject3DEventMap = IObject3DEventMap> {
        _currentGeometry?:
            | null
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
        _currentMaterial?:
            | null
            | IMaterial<IMaterialEventMap>
            | IMaterial<IMaterialEventMap>[];
        _loadingPromise?: Promise<void>;
        _onGeometryUpdate?: EventListener2<
            "geometryUpdate",
            BufferGeometryEventMap,
            IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
        >;
        acceptChildEvents?: boolean;
        assetType: "model" | "light" | "camera" | "widget";
        autoUpgradeChildren?: boolean;
        boundingBox?: null | Box3;
        boundingSphere?: null | Sphere;
        children: IObject3D<IObject3DEventMap>[];
        geometry?: IGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
        isCamera?: boolean;
        isLight?: boolean;
        isLine?: boolean;
        isLine2?: boolean;
        isLineSegments?: boolean;
        isLineSegments2?: boolean;
        isMesh?: boolean;
        isMeshLine?: boolean;
        isObject3D: true;
        isScene?: boolean;
        isWidget?: boolean;
        material?: IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[];
        materials?: IMaterial<IMaterialEventMap>[];
        modelObject: IObject3D<TE>;
        morphTargetDictionary?: Record<string, number>;
        morphTargetInfluences?: number[];
        objectProcessor?: IObjectProcessor;
        parent: null | IObject3D<IObject3DEventMap>;
        parentRoot?: null | IObject3D<IObject3DEventMap>;
        uiConfig?: UiObjectConfig<any, string, any>;
        userData: IObject3DUserData;
        add(...object: Object3D<Object3DEventMap>[]): this;
        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, ...args: any[]): this;
        dispose(removeFromParent?: boolean): void;
        getObjectById<
            T extends IObject3D<IObject3DEventMap> = IObject3D<IObject3DEventMap>,
        >(
            id: number,
        ): undefined | T;
        getObjectByName<
            T extends IObject3D<IObject3DEventMap> = IObject3D<IObject3DEventMap>,
        >(
            name: string,
        ): undefined | T;
        getObjectByProperty<
            T extends IObject3D<IObject3DEventMap> = IObject3D<IObject3DEventMap>,
        >(
            name: string,
            value: string,
        ): undefined | T;
        pivotToBoundsCenter(setDirty?: boolean): () => void;
        pivotToPoint(point: Vector3, setDirty?: boolean): this;
        refreshUi(): void;
        remove(...object: IObject3D<IObject3DEventMap>[]): this;
        setDirty(e?: IObjectSetDirtyOptions): void;
        traverse(callback: (object: IObject3D) => void): void;
        traverseAncestors(callback: (object: IObject3D) => void): void;
        traverseVisible(callback: (object: IObject3D) => void): void;
        updateMorphTargets(): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    _currentGeometry?:
        | null
        | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>
    _currentMaterial?:
        | null
        | IMaterial<IMaterialEventMap>
        | IMaterial<IMaterialEventMap>[]
    _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>,
    >
    acceptChildEvents?: boolean

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

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

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

    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.

    []

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

    Flag to check if a given object is of type Object3D.

    This is a constant value

    true

    isScene?: boolean
    isWidget?: boolean

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

    modelObject: IObject3D<TE>

    use object directly

    morphTargetDictionary?: Record<string, number>
    morphTargetInfluences?: number[]
    objectProcessor?: IObjectProcessor

    Object's parent in the scene graph.

    An object can have at most one parent.

    null

    parentRoot?: null | IObject3D<IObject3DEventMap>

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

    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.

    {}

    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.

    • For InstancedMesh, SkinnedMesh etc Computes bounding sphere, updating .boundingSphere attribute.

      Returns void

      bounding spheres 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

      • ...args: any[]

      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

    • 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.

    • Executes the callback on all ancestors.

      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.

    • 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.