Class: InstancedMesh<TGeometry, TMaterial, TEventMap>
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:39
A special version of Mesh with instanced rendering support
Remarks
Use InstancedMesh if you have to render a large number of objects with the same geometry and material(s) but with different world transformations The usage of InstancedMesh will help you to reduce the number of draw calls and thus improve the overall rendering performance in your application.
See
- Example: WebGL / instancing / dynamic
- Example: WebGL / instancing / performance
- Example: WebGL / instancing / scatter
- Example: WebGL / instancing / raycast
- Official Documentation
- Source
Extends
Mesh<TGeometry,TMaterial,TEventMap>
Type Parameters
TGeometry
TGeometry extends BufferGeometry = BufferGeometry
TMaterial
TMaterial extends Material | Material[] = Material | Material[]
TEventMap
TEventMap extends InstancedMeshEventMap = InstancedMeshEventMap
Constructors
Constructor
new InstancedMesh<
TGeometry,TMaterial,TEventMap>(geometry,material,count):InstancedMesh<TGeometry,TMaterial,TEventMap>
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:100
Create a new instance of InstancedMesh
Parameters
geometry
TGeometry
An instance of BufferGeometry.
material
TMaterial
A single or an array of Material. Default is a new MeshBasicMaterial.
count
number
The maximum number of instances of this Mesh. Expects a Integer
Returns
InstancedMesh<TGeometry, TMaterial, TEventMap>
Overrides
Properties
animations
animations:
AnimationClip[]
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:269
Array with object's animation clips.
Default Value
[]
Inherited from
boundingBox
boundingBox:
Box3
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:85
This bounding box encloses all instances of the InstancedMesh,, which can be calculated with .computeBoundingBox().
Remarks
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
Default Value
null
boundingSphere
boundingSphere:
Sphere
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:92
This bounding sphere encloses all instances of the InstancedMesh, which can be calculated with .computeBoundingSphere().
Remarks
bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are null.
Default Value
null
castShadow
castShadow:
boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:241
Whether the object gets rendered into shadow map.
Default Value
false
Inherited from
children
children:
Object3D<Object3DEventMap>[]
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:148
Array with object's children.
See
THREE.Object3DGroup | Group for info on manually grouping objects.
Default Value
[]
Inherited from
count
count:
number
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:78
The number of instances.
Remarks
The count value passed into the constructor represents the maximum number of instances of this mesh.
You can change the number of instances at runtime to an integer value in the range [0, count].
If you need more instances than the original count value, you have to create a new InstancedMesh.
Expects a Integer
Overrides
customDepthMaterial?
optionalcustomDepthMaterial:Material<MaterialEventMap>
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:278
Custom depth material to be used when rendering to the depth map.
Remarks
Can only be used in context of meshes. When shadow-casting with a DirectionalLight or SpotLight, if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows.
Default Value
undefined
Inherited from
customDistanceMaterial?
optionalcustomDistanceMaterial:Material<MaterialEventMap>
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:284
Same as customDepthMaterial, but used with THREE.Object3DPointLight | PointLight.
Default Value
undefined
Inherited from
frustumCulled
frustumCulled:
boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:254
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.
Default Value
true
Inherited from
geometry
geometry:
TGeometry
Defined in: node_modules/@types/three/src/objects/Mesh.d.ts:59
An instance of BufferGeometry (or derived classes), defining the object's structure.
Default Value
Inherited from
id
readonlyid:number
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:112
Unique number for this Object3D instance.
Remarks
Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
Expects a Integer
Inherited from
instanceColor
instanceColor:
InstancedBufferAttribute
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:62
Represents the colors of all instances.
You have to set .instanceColor.needsUpdate() flag to true if you modify instanced data via .setColorAt().
Default Value
null
instanceMatrix
instanceMatrix:
InstancedBufferAttribute
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:55
Represents the local transformation of all instances.
You have to set .instanceMatrix.needsUpdate() flag to true if you modify instanced data via .setMatrixAt().
isInstancedMesh
readonlyisInstancedMesh:true
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:49
Read-only flag to check if a given object is of type InstancedMesh.
Remarks
This is a constant value
Default Value
true
isMesh
readonlyisMesh:true
Defined in: node_modules/@types/three/src/objects/Mesh.d.ts:47
Read-only flag to check if a given object is of type Mesh.
Remarks
This is a constant value
Default Value
true
Inherited from
isObject3D
readonlyisObject3D:true
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:105
Flag to check if a given object is of type Object3D.
Remarks
This is a constant value
Default Value
true
Inherited from
layers
layers:
Layers
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:229
The layer membership of the object.
Remarks
The object is only visible if it has at least one layer in common with the THREE.Object3DCamera | Camera in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using Raycaster.
Default Value
new THREE.Layers()
Inherited from
material
material:
TMaterial
Defined in: node_modules/@types/three/src/objects/Mesh.d.ts:65
An instance of material derived from the Material base class or an array of materials, defining the object's appearance.
Default Value
`new THREE.MeshBasicMaterial()`.
Inherited from
matrix
matrix:
Matrix4
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:194
The local transform matrix.
Default Value
new THREE.Matrix4()
Inherited from
matrixAutoUpdate
matrixAutoUpdate:
boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:208
When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.
Default Value
DEFAULT_MATRIX_AUTO_UPDATE - that is (true).
Inherited from
matrixWorld
matrixWorld:
Matrix4
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:201
The global transform of the object.
Remarks
If the Object3D has no parent, then it's identical to the local transform .matrix.
Default Value
new THREE.Matrix4()
Inherited from
matrixWorldAutoUpdate
matrixWorldAutoUpdate:
boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:215
If set, then the renderer checks every frame if the object and its children need matrix updates. When it isn't, then you have to maintain all matrices in the object and its children yourself.
Default Value
DEFAULT_MATRIX_WORLD_AUTO_UPDATE - that is (true).
Inherited from
matrixWorldNeedsUpdate
matrixWorldNeedsUpdate:
boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:221
When this is set, it calculates the matrixWorld in that frame and resets this property to false.
Default Value
false
Inherited from
modelViewMatrix
readonlymodelViewMatrix:Matrix4
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:183
Default Value
new THREE.Matrix4()
Inherited from
morphTargetDictionary?
optionalmorphTargetDictionary:object
Defined in: node_modules/@types/three/src/objects/Mesh.d.ts:77
A dictionary of morphTargets based on the morphTarget.name property.
Index Signature
[key: string]: number
Default Value
undefined, but rebuilt by updateMorphTargets | .updateMorphTargets().
Inherited from
morphTargetInfluences?
optionalmorphTargetInfluences:number[]
Defined in: node_modules/@types/three/src/objects/Mesh.d.ts:71
An array of weights typically from 0-1 that specify how much of the morph is applied.
Default Value
undefined, but reset to a blank array by updateMorphTargets | .updateMorphTargets().
Inherited from
morphTexture
morphTexture:
DataTexture
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:68
Represents the morph target weights of all instances. You have to set its .needsUpdate flag to true if you modify instanced data via .setMorphAt.
name
name:
string
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:125
Optional name of the object
Remarks
(doesn't need to be unique).
Default Value
""
Inherited from
normalMatrix
readonlynormalMatrix:Matrix3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:188
Default Value
new THREE.Matrix3()
Inherited from
occlusionTest?
optionalocclusionTest:boolean
Defined in: node_modules/@types/three/src/renderers/common/Backend.d.ts:10
Inherited from
parent
parent:
Object3D<Object3DEventMap>
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:140
Object's parent in the scene graph.
Remarks
An object can have at most one parent.
Default Value
null
Inherited from
pivot
pivot:
Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:312
The pivot point for rotation and scale transformations. When set, rotation and scale are applied around this point instead of the object's origin.
Default
null
Inherited from
position
readonlyposition:Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:160
Object's local position.
Default Value
new THREE.Vector3() - that is (0, 0, 0).
Inherited from
quaternion
readonlyquaternion:Quaternion
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:172
Object's local rotation as a Quaternion.
Default Value
new THREE.Quaternion() - that is (0, 0, 0, 1).
Inherited from
receiveShadow
receiveShadow:
boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:247
Whether the material receives shadows.
Default Value
false
Inherited from
renderOrder
renderOrder:
number
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:263
This value allows the default rendering order of scene graph objects to be overridden although opaque and transparent objects remain sorted independently.
Remarks
When this property is set for an instance of Group, all descendants objects will be sorted and rendered together. Sorting is from lowest to highest renderOrder.
Default Value
0
Inherited from
rotation
readonlyrotation:Euler
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:166
Object's local rotation (Euler angles), in radians.
Default Value
new THREE.Euler() - that is (0, 0, 0, Euler.DEFAULT_ORDER).
Inherited from
scale
readonlyscale:Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:178
The object's local scale.
Default Value
new THREE.Vector3( 1, 1, 1 )
Inherited from
static
static:
boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:296
Whether the 3D object is supposed to be static or not. If set to true, it means
the 3D object is not going to be changed after the initial renderer. This includes
geometry and material settings. A static 3D object can be processed by the renderer
slightly faster since certain state checks can be bypassed.
Only relevant in context of WebGPURenderer.
Default
false
Inherited from
type
readonlytype:string
Defined in: node_modules/@types/three/src/objects/Mesh.d.ts:53
Default Value
Mesh
Inherited from
up
up:
Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:154
This is used by the lookAt method, for example, to determine the orientation of the result.
Default Value
Object3D.DEFAULT_UP - that is (0, 1, 0).
Inherited from
userData
userData:
Record<string,any>
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:303
An object that can be used to store custom data about the Object3D.
Remarks
It should not hold references to functions as these will not be cloned.
Default
{}
Inherited from
uuid
uuid:
string
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:118
UUID of this object instance.
Remarks
This gets automatically assigned and shouldn't be edited.
Inherited from
visible
visible:
boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:235
Object gets rendered if true.
Default Value
true
Inherited from
DEFAULT_MATRIX_AUTO_UPDATE
staticDEFAULT_MATRIX_AUTO_UPDATE:boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:397
The default setting for matrixAutoUpdate for newly created Object3Ds.
Default Value
true
Inherited from
Mesh.DEFAULT_MATRIX_AUTO_UPDATE
DEFAULT_MATRIX_WORLD_AUTO_UPDATE
staticDEFAULT_MATRIX_WORLD_AUTO_UPDATE:boolean
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:403
The default setting for matrixWorldAutoUpdate for newly created Object3Ds.
Default Value
true
Inherited from
Mesh.DEFAULT_MATRIX_WORLD_AUTO_UPDATE
DEFAULT_UP
staticDEFAULT_UP:Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:391
The default up direction for objects, also used as the default position for DirectionalLight, HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down).
Default Value
new THREE.Vector3( 0, 1, 0)
Inherited from
Methods
add()
add(...
object):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:539
Adds another Object3D as child of this Object3D.
Parameters
object
...Object3D<Object3DEventMap>[]
Returns
this
Remarks
An arbitrary number of objects may be added Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent.
See
Inherited from
addEventListener()
addEventListener<
T>(type,listener):void
Defined in: node_modules/@types/three/src/core/EventDispatcher.d.ts:52
Adds a listener to an event type.
Type Parameters
T
T extends string
Parameters
type
T
The type of event to listen to.
listener
EventListener<TEventMap[T], T, InstancedMesh<TGeometry, TMaterial, TEventMap>>
The function that gets called when the event is fired.
Returns
void
Inherited from
applyMatrix4()
applyMatrix4(
matrix):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:409
Applies the matrix transform to the object and updates the object's position, rotation and scale.
Parameters
matrix
Returns
void
Inherited from
applyQuaternion()
applyQuaternion(
quaternion):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:415
Applies the rotation represented by the quaternion to the object.
Parameters
quaternion
Returns
this
Inherited from
attach()
attach(
object):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:565
Adds a Object3D as a child of this, while maintaining the object's world transform.
Parameters
object
Returns
this
Remarks
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
See
Inherited from
clear()
clear():
this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:557
Removes all child objects.
Returns
this
Inherited from
clone()
clone(
recursive?):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:692
Returns a clone of this object and optionally all descendants.
Parameters
recursive?
boolean
If true, descendants of the object are also cloned. Default true
Returns
this
Inherited from
computeBoundingBox()
computeBoundingBox():
void
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:107
Computes the bounding box of the instanced mesh, and updates the .boundingBox attribute. The bounding box is not computed by the engine; it must be computed by your app. You may need to recompute the bounding box if an instance is transformed via .setMatrixAt().
Returns
void
computeBoundingSphere()
computeBoundingSphere():
void
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:114
Computes the bounding sphere of the instanced mesh, and updates the .boundingSphere attribute. The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling. You may need to recompute the bounding sphere if an instance is transformed via page:.setMatrixAt.
Returns
void
copy()
copy(
object,recursive?):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:701
Copies the given object into this object.
Parameters
object
recursive?
boolean
If set to true, descendants of the object are copied next to the existing ones. If set to
false, descendants are left unchanged. Default is true.
Returns
this
Remarks
Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
Inherited from
dispatchEvent()
dispatchEvent<
T>(event):void
Defined in: node_modules/@types/three/src/core/EventDispatcher.d.ts:81
Fire an event type.
Type Parameters
T
T extends string
Parameters
event
BaseEvent<T> & TEventMap[T]
The event that gets fired.
Returns
void
Inherited from
dispose()
dispose():
void
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:176
Frees the GPU-related resources allocated by this instance
Returns
void
Remarks
Call this method whenever this instance is no longer used in your app.
getColorAt()
getColorAt(
index,color):Color
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:121
Get the color of the defined instance.
Parameters
index
number
The index of an instance. Values have to be in the range [0, count]. Expects a Integer
color
This color object will be set to the color of the defined instance.
Returns
getMatrixAt()
getMatrixAt(
index,matrix):Matrix4
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:137
Get the local transformation matrix of the defined instance.
Parameters
index
number
The index of an instance Values have to be in the range [0, count]. Expects a Integer
matrix
This 4x4 matrix will be set to the local transformation matrix of the defined instance.
Returns
getMorphAt()
getMorphAt(
index,mesh):void
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:144
Get the morph target weights of the defined instance.
Parameters
index
number
The index of an instance. Values have to be in the range [0, count].
mesh
The .morphTargetInfluences property of this mesh will be filled with the morph target weights of the defined instance.
Returns
void
getObjectById()
getObjectById(
id):Object3D<Object3DEventMap>
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:573
Searches through an object and its children, starting with the object itself, and returns the first with a matching id.
Parameters
id
number
Unique number of the object instance. Expects a Integer
Returns
Remarks
Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
See
Inherited from
getObjectByName()
getObjectByName(
name):Object3D<Object3DEventMap>
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:581
Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Parameters
name
string
String to match to the children's Object3D.name property.
Returns
Remarks
Note that for most objects the name is an empty string by default You will have to set it manually to make use of this method.
Inherited from
getObjectByProperty()
getObjectByProperty(
name,value):Object3D<Object3DEventMap>
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:590
Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
Parameters
name
string
the property name to search for.
value
any
value of the given property.
Returns
Inherited from
getObjectsByProperty()
getObjectsByProperty(
name,value,optionalTarget?):Object3D<Object3DEventMap>[]
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:600
Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
Parameters
name
string
The property name to search for.
value
any
Value of the given property.
optionalTarget?
target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
Returns
Inherited from
getVertexPosition()
getVertexPosition(
index,target):Vector3
Defined in: node_modules/@types/three/src/objects/Mesh.d.ts:99
Get the local-space position of the vertex at the given index, taking into account the current animation state of both morph targets and skinning.
Parameters
index
number
Expects a Integer
target
Returns
Inherited from
getWorldDirection()
getWorldDirection(
target):Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:624
Returns a vector representing the direction of object's positive z-axis in world space.
Parameters
target
The result will be copied into this Vector3.
Returns
Inherited from
getWorldPosition()
getWorldPosition(
target):Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:606
Returns a vector representing the position of the object in world space.
Parameters
target
The result will be copied into this Vector3.
Returns
Inherited from
getWorldQuaternion()
getWorldQuaternion(
target):Quaternion
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:612
Returns a quaternion representing the rotation of the object in world space.
Parameters
target
The result will be copied into this Quaternion.
Returns
Inherited from
getWorldScale()
getWorldScale(
target):Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:618
Returns a vector of the scaling factors applied to the object for each axis in world space.
Parameters
target
The result will be copied into this Vector3.
Returns
Inherited from
hasEventListener()
hasEventListener<
T>(type,listener):boolean
Defined in: node_modules/@types/three/src/core/EventDispatcher.d.ts:62
Checks if listener is added to an event type.
Type Parameters
T
T extends string
Parameters
type
T
The type of event to listen to.
listener
EventListener<TEventMap[T], T, InstancedMesh<TGeometry, TMaterial, TEventMap>>
The function that gets called when the event is fired.
Returns
boolean
Inherited from
localToWorld()
localToWorld(
vector):Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:508
Converts the vector from this object's local space to world space.
Parameters
vector
A vector representing a position in this object's local space.
Returns
Inherited from
lookAt()
Call Signature
lookAt(
vector):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:521
Rotates the object to face a point in world space.
Parameters
vector
A vector representing a position in world space to look at.
Returns
void
Remarks
This method does not support objects having non-uniformly-scaled parent(s).
Inherited from
Call Signature
lookAt(
x,y,z):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:529
Rotates the object to face a point in world space.
Parameters
x
number
Expects a Float
y
number
Expects a Float
z
number
Expects a Float
Returns
void
Remarks
This method does not support objects having non-uniformly-scaled parent(s).
Inherited from
onAfterRender()
onAfterRender(
renderer,scene,camera,geometry,material,group):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:377
An optional callback that is executed immediately after a 3D object is rendered.
Parameters
renderer
scene
camera
geometry
material
group
Returns
void
Remarks
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which
define their visual appearance with geometries and materials like instances of Mesh, Line,
Points or Sprite. Instances of Object3D, Group or Bone are not renderable
and thus this callback is not executed for such objects.
Inherited from
onAfterShadow()
onAfterShadow(
renderer,scene,camera,shadowCamera,geometry,depthMaterial,group):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:342
An optional callback that is executed immediately after a 3D object is rendered to a shadow map.
Parameters
renderer
scene
camera
shadowCamera
geometry
depthMaterial
group
Returns
void
Remarks
This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry,
depthMaterial, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which
define their visual appearance with geometries and materials like instances of Mesh, Line,
Points or Sprite. Instances of Object3D, Group or Bone are not renderable
and thus this callback is not executed for such objects.
Inherited from
onBeforeRender()
onBeforeRender(
renderer,scene,camera,geometry,material,group):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:360
An optional callback that is executed immediately before a 3D object is rendered.
Parameters
renderer
scene
camera
geometry
material
group
Returns
void
Remarks
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which
define their visual appearance with geometries and materials like instances of Mesh, Line,
Points or Sprite. Instances of Object3D, Group or Bone are not renderable
and thus this callback is not executed for such objects.
Inherited from
onBeforeShadow()
onBeforeShadow(
renderer,scene,camera,shadowCamera,geometry,depthMaterial,group):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:323
An optional callback that is executed immediately before a 3D object is rendered to a shadow map.
Parameters
renderer
scene
camera
shadowCamera
geometry
depthMaterial
group
Returns
void
Remarks
This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry,
depthMaterial, group.
Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which
define their visual appearance with geometries and materials like instances of Mesh, Line,
Points or Sprite. Instances of Object3D, Group or Bone are not renderable
and thus this callback is not executed for such objects.
Inherited from
raycast()
raycast(
raycaster,intersects):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:634
Abstract (empty) method to get intersections between a casted ray and this object
Parameters
raycaster
intersects
Intersection<Object3D<Object3DEventMap>>[]
Returns
void
Remarks
Subclasses such as Mesh, Line, and Points implement this method in order to use raycasting.
See
Default Value
() => {}
Inherited from
remove()
remove(...
object):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:547
Removes a Object3D as child of this Object3D.
Parameters
object
...Object3D<Object3DEventMap>[]
Returns
this
Remarks
An arbitrary number of objects may be removed.
See
Group for info on manually grouping objects.
Inherited from
removeEventListener()
removeEventListener<
T>(type,listener):void
Defined in: node_modules/@types/three/src/core/EventDispatcher.d.ts:72
Removes a listener from an event type.
Type Parameters
T
T extends string
Parameters
type
T
The type of the listener that gets removed.
listener
EventListener<TEventMap[T], T, InstancedMesh<TGeometry, TMaterial, TEventMap>>
The listener function that gets removed.
Returns
void
Inherited from
removeFromParent()
removeFromParent():
this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:552
Removes this object from its current parent.
Returns
this
Inherited from
rotateOnAxis()
rotateOnAxis(
axis,angle):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:449
Rotate an object along an axis in object space.
Parameters
axis
A normalized vector in object space.
angle
number
The angle in radians. Expects a Float
Returns
this
Remarks
The axis is assumed to be normalized.
Inherited from
rotateOnWorldAxis()
rotateOnWorldAxis(
axis,angle):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:458
Rotate an object along an axis in world space.
Parameters
axis
A normalized vector in world space.
angle
number
The angle in radians. Expects a Float
Returns
this
Remarks
The axis is assumed to be normalized Method Assumes no rotated parent.
Inherited from
rotateX()
rotateX(
angle):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:464
Rotates the object around x axis in local space.
Parameters
angle
number
Returns
this
Inherited from
rotateY()
rotateY(
angle):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:470
Rotates the object around y axis in local space.
Parameters
angle
number
Returns
this
Inherited from
rotateZ()
rotateZ(
angle):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:476
Rotates the object around z axis in local space.
Parameters
angle
number
Returns
this
Inherited from
setColorAt()
setColorAt(
index,color):this
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:130
Sets the given color to the defined instance
Parameters
index
number
The index of an instance. Values have to be in the range [0, count]. Expects a Integer
color
The color of a single instance.
Returns
this
Remarks
Make sure you set .instanceColor.needsUpdate() to true after updating all the colors.
setMatrixAt()
setMatrixAt(
index,matrix):this
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:154
Sets the given local transformation matrix to the defined instance. Make sure you set
.instanceMatrix.needsUpdate() flag to true after updating all
the matrices.
Negatively scaled matrices are not supported.
Parameters
index
number
The index of an instance. Values have to be in the range [0, count]. Expects a Integer
matrix
A 4x4 matrix representing the local transformation of a single instance.
Returns
this
setMorphAt()
setMorphAt(
index,mesh):this
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:162
Sets the morph target weights to the defined instance. Make sure you set .morphTexture.needsUpdate to true after updating all the influences.
Parameters
index
number
The index of an instance. Values have to be in the range [0, count].
mesh
A mesh with .morphTargetInfluences property containing the morph target weights of a single instance.
Returns
this
setRotationFromAxisAngle()
setRotationFromAxisAngle(
axis,angle):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:422
Calls setFromAxisAngle(axis, angle) on the .quaternion.
Parameters
axis
A normalized vector in object space.
angle
number
Angle in radians. Expects a Float
Returns
void
Inherited from
setRotationFromEuler()
setRotationFromEuler(
euler):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:428
Calls setFromEuler(euler) on the .quaternion.
Parameters
euler
Euler angle specifying rotation amount.
Returns
void
Inherited from
setRotationFromMatrix()
setRotationFromMatrix(
m):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:435
Calls setFromRotationMatrix(m) on the .quaternion.
Parameters
m
Rotate the quaternion by the rotation component of the matrix.
Returns
void
Remarks
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
Inherited from
setRotationFromQuaternion()
setRotationFromQuaternion(
q):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:441
Copy the given Quaternion into .quaternion.
Parameters
q
Normalized Quaternion.
Returns
void
Inherited from
Mesh.setRotationFromQuaternion
toJSON()
toJSON(
meta?):InstancedMeshJSON
Defined in: node_modules/@types/three/src/objects/InstancedMesh.d.ts:178
Convert the object to three.js JSON Object/Scene format.
Parameters
meta?
Object containing metadata such as materials, textures or images for the object.
Returns
Overrides
translateOnAxis()
translateOnAxis(
axis,distance):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:484
Translate an object by distance along an axis in object space
Parameters
axis
A normalized vector in object space.
distance
number
The distance to translate. Expects a Float
Returns
this
Remarks
The axis is assumed to be normalized.
Inherited from
translateX()
translateX(
distance):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:490
Translates object along x axis in object space by distance units.
Parameters
distance
number
Expects a Float
Returns
this
Inherited from
translateY()
translateY(
distance):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:496
Translates object along y axis in object space by distance units.
Parameters
distance
number
Expects a Float
Returns
this
Inherited from
translateZ()
translateZ(
distance):this
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:502
Translates object along z axis in object space by distance units.
Parameters
distance
number
Expects a Float
Returns
this
Inherited from
traverse()
traverse(
callback):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:641
Executes the callback on this object and all descendants.
Parameters
callback
(object) => any
A function with as first argument an Object3D object.
Returns
void
Remarks
Note: Modifying the scene graph inside the callback is discouraged.
Inherited from
traverseAncestors()
traverseAncestors(
callback):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:656
Executes the callback on all ancestors.
Parameters
callback
(object) => any
A function with as first argument an Object3D object.
Returns
void
Remarks
Note: Modifying the scene graph inside the callback is discouraged.
Inherited from
traverseVisible()
traverseVisible(
callback):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:649
Like traverse, but the callback will only be executed for visible objects
Parameters
callback
(object) => any
A function with as first argument an Object3D object.
Returns
void
Remarks
Descendants of invisible objects are not traversed. Note: Modifying the scene graph inside the callback is discouraged.
Inherited from
updateMatrix()
updateMatrix():
void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:661
Updates local transform.
Returns
void
Inherited from
updateMatrixWorld()
updateMatrixWorld(
force?):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:669
Updates the global transform of the object.
And will update the object descendants if .matrixWorldNeedsUpdate is set to true or if the force parameter is set to true.
Parameters
force?
boolean
A boolean that can be used to bypass .matrixWorldAutoUpdate, to recalculate the world matrix of the object and descendants on the current frame.
Useful if you cannot wait for the renderer to update it on the next frame, assuming .matrixWorldAutoUpdate set to true.
Returns
void
Inherited from
updateWorldMatrix()
updateWorldMatrix(
updateParents?,updateChildren?,force?):void
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:680
An alternative version of Object3D#updateMatrixWorld with more control over the update of ancestor and descendant nodes.
Parameters
updateParents?
boolean
Whether ancestor nodes should be updated or not.
updateChildren?
boolean
Whether descendant nodes should be updated or not.
force?
boolean
When set to true, a recomputation of world matrices is forced even
when Object3D#matrixWorldNeedsUpdate is false.
Returns
void
Inherited from
worldToLocal()
worldToLocal(
vector):Vector3
Defined in: node_modules/@types/three/src/core/Object3D.d.ts:514
Converts the vector from world space to this object's local space.
Parameters
vector
A vector representing a position in world space.