Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/remapper/src/deps.ts>three.Object3D

A framework for Beat Saber map scripting.
Go to Latest
class three.Object3D
extends EventDispatcher<E>
Re-export
import { three } from "https://deno.land/x/remapper@2.1.0/src/deps.ts";
const { Object3D } = three;

Base class for scene graph objects

Constructors

new
Object3D()

Type Parameters

optional
E extends BaseEvent = Event

Properties

animations: AnimationClip[]

Array with animation clips.

castShadow: boolean

Gets rendered into shadow map.

children: Object3D[]

Array with object's children.

customDepthMaterial: Material

Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes. When shadow-casting with a DirectionalLight or SpotLight, if you are (a) modifying vertex positions in the vertex shader, (b) using a displacement map, (c) using an alpha map with alphaTest, or (d) using a transparent texture with alphaTest, you must specify a customDepthMaterial for proper shadows.

customDistanceMaterial: Material

Same as customDepthMaterial, but used with PointLight.

frustumCulled: boolean

When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to false the object gets rendered every frame even if it is not in the frustum of the camera.

id: number

Unique number of this object instance.

readonly
isObject3D: true

Used to check whether this or derived classes are Object3Ds. Default is true. You should not change this, as it is used internally for optimisation.

layers: Layers
matrix: Matrix4

Local transform.

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.

matrixWorld: Matrix4

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

matrixWorldNeedsUpdate: boolean

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

readonly
modelViewMatrix: Matrix4
name: string

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

readonly
normalMatrix: Matrix3
onAfterRender: (
renderer: WebGLRenderer,
scene: Scene,
camera: Camera,
geometry: BufferGeometry,
material: Material,
group: Group,
) => void

Calls after rendering object

onBeforeRender: (
renderer: WebGLRenderer,
scene: Scene,
camera: Camera,
geometry: BufferGeometry,
material: Material,
group: Group,
) => void

Calls before rendering object

parent: Object3D | null

Object's parent in the scene graph.

readonly
position: Vector3

Object's local position.

readonly
quaternion: Quaternion

Object's local rotation as a Quaternion.

receiveShadow: boolean

Material gets baked in shadow receiving.

renderOrder: number

Overrides the default rendering order of scene graph objects, from lowest to highest renderOrder. Opaque and transparent objects remain sorted independently though. When this property is set for an instance of Group, all descendants objects will be sorted and rendered together.

readonly
rotation: Euler

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

readonly
scale: Vector3

Object's local scale.

type: string

Up direction.

userData: { [key: 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.

uuid: string
visible: boolean

Object gets rendered if true.

Methods

add(...object: Object3D[]): this

Adds object as child of this object.

applyMatrix4(matrix: Matrix4): void

Applies the matrix transform to the object and updates the object's position, rotation and scale.

applyQuaternion(quaternion: Quaternion): this

Applies the rotation represented by the quaternion to the object.

attach(object: Object3D): this

Adds object as a child of this, while maintaining the object's world transform.

clear(): this

Removes all child objects.

clone(recursive?: boolean): this
copy(source: this, recursive?: boolean): this
getObjectById(id: number): Object3D | undefined

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

getObjectByName(name: string): Object3D | undefined

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

getObjectByProperty(name: string, value: string): Object3D | undefined

Updates the vector from local space to world space.

lookAt(
vector: Vector3 | number,
y?: number,
z?: number,
): void

Optionally, the x, y and z components of the world space position. Rotates the object to face a point in world space. This method does not support objects having non-uniformly-scaled parent(s).

raycast(raycaster: Raycaster, intersects: Intersection[]): void
remove(...object: Object3D[]): this

Removes object as child of this object.

Removes this object from its current parent.

rotateOnAxis(axis: Vector3, angle: number): this

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

rotateOnWorldAxis(axis: Vector3, angle: number): this

Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent.

rotateX(angle: number): this

Rotates the object around x axis in local space.

rotateY(angle: number): this

Rotates the object around y axis in local space.

rotateZ(angle: number): this

Rotates the object around z axis in local space.

setRotationFromAxisAngle(axis: Vector3, angle: number): void

axis -- A normalized vector in object space. angle -- angle in radians

Calls setRotationFromEuler(euler) on the .quaternion.

Calls setFromRotationMatrix(m) on the .quaternion.

Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).

Copy the given quaternion into .quaternion.

toJSON(meta?: { geometries: any; materials: any; textures: any; images: any; }): any
translateOnAxis(axis: Vector3, distance: number): this

Translate an object by distance along an axis in object space. The axis is assumed to be normalized.

translateX(distance: number): this

Translates object along x axis by distance.

translateY(distance: number): this

Translates object along y axis by distance.

translateZ(distance: number): this

Translates object along z axis by distance.

traverse(callback: (object: Object3D) => any): void
traverseAncestors(callback: (object: Object3D) => any): void
traverseVisible(callback: (object: Object3D) => any): void
updateMatrix(): void

Updates local transform.

updateMatrixWorld(force?: boolean): void

Updates global transform of the object and its children.

updateWorldMatrix(updateParents: boolean, updateChildren: boolean): void

Updates the global transform of the object.

Updates the vector from world space to local space.

Static Properties

DefaultMatrixAutoUpdate: boolean
DefaultUp: Vector3