Class BoxHelper

Base class for scene graph objects

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(object: Object3D): BoxHelper

Parameters

Returns

BoxHelper

Properties

public box: Box3

public castShadow: boolean

Gets rendered into shadow map.

public children: Object3D[]

Array with object's children.

public eulerOrder: string

Order of axis for Euler angles.

public frustumCulled: boolean

When this is set, it checks every frame if the object is in the frustum of the camera. Otherwise the object gets drawn every frame even if it isn't visible.

public geometry: Geometry

public id: number

Unique number of this object instance.

public material: Material

public matrix: Matrix4

Local transform.

public matrixAutoUpdate: boolean

When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.

public matrixWorld: Matrix4

The global transform of the object. If the Object3d has no parent, then it's identical to the local transform.

public matrixWorldNeedsUpdate: boolean

When this is set, it calculates the matrixWorld in that frame and resets this property to false.

public name: string

Optional name of the object (doesn't need to be unique).

public object: Object3D

public parent: Object3D

Object's parent in the scene graph.

public position: Vector3

Object's local position.

public quaternion: Quaternion

Global rotation.

public receiveShadow: boolean

Material gets baked in shadow receiving.

public renderDepth: number

Override depth-sorting order if non null.

public rotation: Euler

Object's local rotation (Euler angles), in radians.

public rotationAutoUpdate: boolean

When this is set, then the rotationMatrix gets calculated every frame.

public scale: Vector3

Object's local scale.

public type: LineType

public up: Vector3

Up direction.

public useQuaternion: boolean

Use quaternion instead of Euler angles for specifying local rotation.

public userData: 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.

public visible: boolean

Object gets rendered if true.

Methods

public add(object: Object3D)

Adds object as child of this object.

Parameters

public applyMatrix(matrix: Matrix4)

This updates the position, rotation and scale with the matrix.

Parameters

public clone(object?: Line): Line

Parameters

  • object?: Line optional

Returns

Line

public getDescendants(array?: Object3D[]): Object3D[]

Searches whole subgraph recursively to add all objects in the array.

Parameters

  • array?: Object3D[] optional

    optional argument that returns the the array with descendants.

Returns

Object3D[]

public getObjectById(id: string, recursive: boolean): Object3D

Searches through the object's children and returns the first with a matching id, optionally recursive.

Parameters

  • id: string

    Unique number of the object instance

  • recursive: boolean

    Boolean whether to search through the children's children. Default is false.

Returns

Object3D

public getObjectByName(name: string, recursive: boolean): Object3D

Searches through the object's children and returns the first with a matching name, optionally recursive.

Parameters

  • name: string

    String to match to the children's Object3d.name property.

  • recursive: boolean

    Boolean whether to search through the children's children. Default is false.

Returns

Object3D

public localToWorld(vector: Vector3): Vector3

Updates the vector from local space to world space.

Parameters

Returns

Vector3

public lookAt(vector: Vector3)

Rotates object to face point in space.

Parameters

  • vector: Vector3

    A world vector to look at.

public remove(object: Object3D)

Removes object as child of this object.

Parameters

public rotateOnAxis(axis: Vector3, angle: number): Object3D

Rotate an object along an axis in object space. The axis is assumed to be normalized.

Parameters

  • axis: Vector3

    A normalized vector in object space.

  • angle: number

    The angle in radians.

Returns

Object3D

public translateOnAxis(axis: Vector3, distance: number): Object3D

Parameters

  • axis: Vector3

    A normalized vector in object space.

  • distance: number

    The distance to translate.

Returns

Object3D

public translateX(distance: number)

Translates object along x axis by distance.

Parameters

  • distance: number

    Distance.

public translateY(distance: number)

Translates object along y axis by distance.

Parameters

  • distance: number

    Distance.

public translateZ(distance: number)

Translates object along z axis by distance.

Parameters

  • distance: number

    Distance.

public traverse(callback: (object: THREE.Object3D) => any)

Translates object along arbitrary axis by distance.

Parameters

  • callback: (object: THREE.Object3D) => any

public update(object?: Object3D)

Parameters

public updateMatrix()

Updates local transform.

public updateMatrixWorld(force: boolean)

Updates global transform of the object and its children.

Parameters

  • force: boolean

public worldToLocal(vector: Vector3): Vector3

Updates the vector from world space to local space.

Parameters

Returns

Vector3