Sprite2D
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:180
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Sprite2D(
options?):Sprite2D
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:880
Create a new Sprite2D. Can be called with no arguments for R3F compatibility - set texture via property.
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Sprite2D
Overrides
Section titled “Overrides”Mesh.constructor
Properties
Section titled “Properties”_idx:
number=0
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:515
Index into the backing arrays (0 when standalone, eid when enrolled).
alphaMap
Section titled “alphaMap”alphaMap:
AlphaMap|null=null
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:253
CPU-side alpha data for 'alpha' hit-test mode.
alphaThreshold
Section titled “alphaThreshold”alphaThreshold:
number=0.5
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:256
Alpha value (0–1) below which a pixel is treated as transparent.
animations
Section titled “animations”animations:
AnimationClip[]
Defined in: three.js/core/Object3D:animations
Array with object’s animation clips.
Default Value
Section titled “Default Value”[]
Inherited from
Section titled “Inherited from”Mesh.animations
castShadow
Section titled “castShadow”castShadow:
boolean
Defined in: three.js/core/Object3D:castShadow
Whether the object gets rendered into shadow map.
Default Value
Section titled “Default Value”false
Inherited from
Section titled “Inherited from”Mesh.castShadow
children
Section titled “children”children:
Object3D<Object3DEventMap>[]
Defined in: three.js/core/Object3D:children
Array with object’s children.
THREE.Object3DGroup | Group for info on manually grouping objects.
Default Value
Section titled “Default Value”[]
Inherited from
Section titled “Inherited from”Mesh.children
count:
number
Defined in: three.js/objects/Mesh:count
The number of instances of this mesh. Can only be used with WebGPURenderer.
Default
Section titled “Default”1Inherited from
Section titled “Inherited from”Mesh.count
customDepthMaterial?
Section titled “customDepthMaterial?”
optionalcustomDepthMaterial?:Material<MaterialEventMap>
Defined in: three.js/core/Object3D:customDepthMaterial
Custom depth material to be used when rendering to the depth map.
Remarks
Section titled “Remarks”Can only be used in context of meshes. When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows.
Default Value
Section titled “Default Value”undefined
Inherited from
Section titled “Inherited from”Mesh.customDepthMaterial
customDistanceMaterial?
Section titled “customDistanceMaterial?”
optionalcustomDistanceMaterial?:Material<MaterialEventMap>
Defined in: three.js/core/Object3D:customDistanceMaterial
Same as customDepthMaterial, but used with THREE.Object3DPointLight | PointLight.
Default Value
Section titled “Default Value”undefined
Inherited from
Section titled “Inherited from”Mesh.customDistanceMaterial
frustumCulled
Section titled “frustumCulled”frustumCulled:
boolean
Defined in: three.js/core/Object3D:frustumCulled
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
Section titled “Default Value”true
Inherited from
Section titled “Inherited from”Mesh.frustumCulled
geometry
Section titled “geometry”geometry:
BufferGeometry
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:184
An instance of THREE.BufferGeometry | BufferGeometry (or derived classes), defining the object’s structure.
Default Value
Section titled “Default Value”THREE.BufferGeometry | `new THREE.BufferGeometry()`.
Overrides
Section titled “Overrides”Mesh.geometry
readonlyid:number
Defined in: three.js/core/Object3D:id
Unique number for this Object3D instance.
Remarks
Section titled “Remarks”Note that ids are assigned in chronological order: 1, 2, 3, …, incrementing by one for each new object.
Expects a Integer
Inherited from
Section titled “Inherited from”Mesh.id
isMesh
Section titled “isMesh”
readonlyisMesh:true
Defined in: three.js/objects/Mesh:isMesh
Read-only flag to check if a given object is of type Mesh .
Remarks
Section titled “Remarks”This is a constant value
Default Value
Section titled “Default Value”true
Inherited from
Section titled “Inherited from”Mesh.isMesh
isObject3D
Section titled “isObject3D”
readonlyisObject3D:true
Defined in: three.js/core/Object3D:isObject3D
Flag to check if a given object is of type Object3D .
Remarks
Section titled “Remarks”This is a constant value
Default Value
Section titled “Default Value”true
Inherited from
Section titled “Inherited from”Mesh.isObject3D
layers
Section titled “layers”layers:
Layers
Defined in: three.js/core/Object3D:layers
The layer membership of the object.
Remarks
Section titled “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 THREE.Raycaster | Raycaster.
Default Value
Section titled “Default Value”new THREE.Layers()
Inherited from
Section titled “Inherited from”Mesh.layers
material
Section titled “material”material:
Sprite2DMaterial
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:185
An instance of material derived from the THREE.Material | Material base class or an array of materials, defining the object’s appearance.
Default Value
Section titled “Default Value”THREE.MeshBasicMaterial | `new THREE.MeshBasicMaterial()`.
Overrides
Section titled “Overrides”Mesh.material
matrix
Section titled “matrix”matrix:
Matrix4
Defined in: three.js/core/Object3D:matrix
The local transform matrix.
Default Value
Section titled “Default Value”new THREE.Matrix4()
Inherited from
Section titled “Inherited from”Mesh.matrix
matrixAutoUpdate
Section titled “matrixAutoUpdate”matrixAutoUpdate:
boolean
Defined in: three.js/core/Object3D:matrixAutoUpdate
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
Section titled “Default Value”DEFAULT_MATRIX_AUTO_UPDATE - that is (true).
Inherited from
Section titled “Inherited from”Mesh.matrixAutoUpdate
matrixWorld
Section titled “matrixWorld”matrixWorld:
Matrix4
Defined in: three.js/core/Object3D:matrixWorld
The global transform of the object.
Remarks
Section titled “Remarks”If the Object3D has no parent, then it’s identical to the local transform THREE.Object3D.matrix | .matrix.
Default Value
Section titled “Default Value”new THREE.Matrix4()
Inherited from
Section titled “Inherited from”Mesh.matrixWorld
matrixWorldAutoUpdate
Section titled “matrixWorldAutoUpdate”matrixWorldAutoUpdate:
boolean
Defined in: three.js/core/Object3D:matrixWorldAutoUpdate
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
Section titled “Default Value”DEFAULT_MATRIX_WORLD_AUTO_UPDATE - that is (true).
Inherited from
Section titled “Inherited from”Mesh.matrixWorldAutoUpdate
matrixWorldNeedsUpdate
Section titled “matrixWorldNeedsUpdate”matrixWorldNeedsUpdate:
boolean
Defined in: three.js/core/Object3D:matrixWorldNeedsUpdate
When this is set, it calculates the matrixWorld in that frame and resets this property to false.
Default Value
Section titled “Default Value”false
Inherited from
Section titled “Inherited from”Mesh.matrixWorldNeedsUpdate
modelViewMatrix
Section titled “modelViewMatrix”
readonlymodelViewMatrix:Matrix4
Defined in: three.js/core/Object3D:modelViewMatrix
Default Value
Section titled “Default Value”new THREE.Matrix4()
Inherited from
Section titled “Inherited from”Mesh.modelViewMatrix
morphTargetDictionary?
Section titled “morphTargetDictionary?”
optionalmorphTargetDictionary?:object
Defined in: three.js/objects/Mesh:morphTargetDictionary
A dictionary of morphTargets based on the morphTarget.name property.
Index Signature
Section titled “Index Signature”[key: string]: number
Default Value
Section titled “Default Value”undefined, but rebuilt by .updateMorphTargets() .
Inherited from
Section titled “Inherited from”Mesh.morphTargetDictionary
morphTargetInfluences?
Section titled “morphTargetInfluences?”
optionalmorphTargetInfluences?:number[]
Defined in: three.js/objects/Mesh:morphTargetInfluences
An array of weights typically from 0-1 that specify how much of the morph is applied.
Default Value
Section titled “Default Value”undefined, but reset to a blank array by .updateMorphTargets() .
Inherited from
Section titled “Inherited from”Mesh.morphTargetInfluences
name:
string
Defined in: three.js/core/Object3D:name
Optional name of the object
Remarks
Section titled “Remarks”(doesn’t need to be unique).
Default Value
Section titled “Default Value”""
Inherited from
Section titled “Inherited from”Mesh.name
normalMatrix
Section titled “normalMatrix”
readonlynormalMatrix:Matrix3
Defined in: three.js/core/Object3D:normalMatrix
Default Value
Section titled “Default Value”new THREE.Matrix3()
Inherited from
Section titled “Inherited from”Mesh.normalMatrix
occlusionTest?
Section titled “occlusionTest?”
optionalocclusionTest?:boolean
Defined in: three.js/renderers/common/Backend:occlusionTest
Inherited from
Section titled “Inherited from”Mesh.occlusionTest
onBeforeRender
Section titled “onBeforeRender”onBeforeRender: (
renderer,scene,camera,geometry,material,group) =>void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:2230
Auto-orchestration Signal B: the sprite’s own mesh is being drawn, so the renderer and scene are in hand. One property check per draw once registered — the hot path stays ~free.
An optional callback that is executed immediately before a 3D object is rendered.
Parameters
Section titled “Parameters”renderer
Section titled “renderer”camera
Section titled “camera”geometry
Section titled “geometry”material
Section titled “material”Returns
Section titled “Returns”void
Remarks
Section titled “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.
Overrides
Section titled “Overrides”Mesh.onBeforeRender
parent
Section titled “parent”parent:
Object3D<Object3DEventMap> |null
Defined in: three.js/core/Object3D:parent
Object’s parent in the scene graph .
Remarks
Section titled “Remarks”An object can have at most one parent.
Default Value
Section titled “Default Value”null
Inherited from
Section titled “Inherited from”Mesh.parent
pivot:
Vector3|null
Defined in: three.js/core/Object3D:pivot
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
Section titled “Default”nullInherited from
Section titled “Inherited from”Mesh.pivot
position
Section titled “position”
readonlyposition:Vector3
Defined in: three.js/core/Object3D:position
Object’s local position.
Default Value
Section titled “Default Value”new THREE.Vector3() - that is (0, 0, 0).
Inherited from
Section titled “Inherited from”Mesh.position
quaternion
Section titled “quaternion”
readonlyquaternion:Quaternion
Defined in: three.js/core/Object3D:quaternion
Object’s local rotation as a THREE.Quaternion | Quaternion.
Default Value
Section titled “Default Value”new THREE.Quaternion() - that is (0, 0, 0, 1).
Inherited from
Section titled “Inherited from”Mesh.quaternion
receiveShadow
Section titled “receiveShadow”receiveShadow:
boolean
Defined in: three.js/core/Object3D:receiveShadow
Whether the material receives shadows.
Default Value
Section titled “Default Value”false
Inherited from
Section titled “Inherited from”Mesh.receiveShadow
renderOrder
Section titled “renderOrder”renderOrder:
number
Defined in: three.js/core/Object3D:renderOrder
This value allows the default rendering order of scene graph objects to be overridden although opaque and transparent objects remain sorted independently.
Remarks
Section titled “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
Section titled “Default Value”0
Inherited from
Section titled “Inherited from”Mesh.renderOrder
rotation
Section titled “rotation”
readonlyrotation:Euler
Defined in: three.js/core/Object3D:rotation
Object’s local rotation (Euler angles ), in radians.
Default Value
Section titled “Default Value”new THREE.Euler() - that is (0, 0, 0, Euler.DEFAULT_ORDER).
Inherited from
Section titled “Inherited from”Mesh.rotation
readonlyscale:Vector3
Defined in: three.js/core/Object3D:scale
The object’s local scale.
Default Value
Section titled “Default Value”new THREE.Vector3( 1, 1, 1 )
Inherited from
Section titled “Inherited from”Mesh.scale
static
Section titled “static”static:
boolean
Defined in: three.js/core/Object3D:static
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
Section titled “Default”falseInherited from
Section titled “Inherited from”Mesh.static
readonlytype:string
Defined in: three.js/objects/Mesh:type
Default Value
Section titled “Default Value”Mesh
Inherited from
Section titled “Inherited from”Mesh.type
up:
Vector3
Defined in: three.js/core/Object3D:up
This is used by the lookAt method, for example, to determine the orientation of the result.
Default Value
Section titled “Default Value”Object3D.DEFAULT_UP - that is (0, 1, 0).
Inherited from
Section titled “Inherited from”Mesh.up
userData
Section titled “userData”userData:
Record<string,any>
Defined in: three.js/core/Object3D:userData
An object that can be used to store custom data about the Object3D .
Remarks
Section titled “Remarks”It should not hold references to functions as these will not be cloned.
Default
Section titled “Default”{}
Inherited from
Section titled “Inherited from”Mesh.userData
uuid:
string
Defined in: three.js/core/Object3D:uuid
UUID of this object instance.
Remarks
Section titled “Remarks”This gets automatically assigned and shouldn’t be edited.
Inherited from
Section titled “Inherited from”Mesh.uuid
visible
Section titled “visible”visible:
boolean
Defined in: three.js/core/Object3D:visible
Object gets rendered if true.
Default Value
Section titled “Default Value”true
Inherited from
Section titled “Inherited from”Mesh.visible
DEFAULT_MATRIX_AUTO_UPDATE
Section titled “DEFAULT_MATRIX_AUTO_UPDATE”
staticDEFAULT_MATRIX_AUTO_UPDATE:boolean
Defined in: three.js/core/Object3D:DEFAULT_MATRIX_AUTO_UPDATE
The default setting for matrixAutoUpdate for newly created Object3Ds.
Default Value
Section titled “Default Value”true
Inherited from
Section titled “Inherited from”Mesh.DEFAULT_MATRIX_AUTO_UPDATE
DEFAULT_MATRIX_WORLD_AUTO_UPDATE
Section titled “DEFAULT_MATRIX_WORLD_AUTO_UPDATE”
staticDEFAULT_MATRIX_WORLD_AUTO_UPDATE:boolean
Defined in: three.js/core/Object3D:DEFAULT_MATRIX_WORLD_AUTO_UPDATE
The default setting for matrixWorldAutoUpdate for newly created Object3Ds.
Default Value
Section titled “Default Value”true
Inherited from
Section titled “Inherited from”Mesh.DEFAULT_MATRIX_WORLD_AUTO_UPDATE
DEFAULT_UP
Section titled “DEFAULT_UP”
staticDEFAULT_UP:Vector3
Defined in: three.js/core/Object3D:DEFAULT_UP
The default up direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down).
Default Value
Section titled “Default Value”new THREE.Vector3( 0, 1, 0)
Inherited from
Section titled “Inherited from”Mesh.DEFAULT_UP
options
Section titled “options”
staticoptions:RenderingSetting|undefined=undefined
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:182
Class-level rendering defaults, resolved before RenderingConfig.
supportedHitTestModes
Section titled “supportedHitTestModes”
readonlystaticsupportedHitTestModes: readonlyHitTestMode[]
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:250
Hit-test modes supported by this class. See spec §6.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get alpha():
number
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1497
Get alpha/opacity.
Returns
Section titled “Returns”number
Set Signature
Section titled “Set Signature”set alpha(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1504
Set alpha/opacity (0-1).
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
anchor
Section titled “anchor”Get Signature
Section titled “Get Signature”get anchor():
Vector2
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1443
Get the anchor point. Returns the stored Vector2 (like Object3D.position).
Returns
Section titled “Returns”Set Signature
Section titled “Set Signature”set anchor(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1450
Set the anchor point. Accepts [x, y] array or Vector2.
Parameters
Section titled “Parameters”[number, number] | Vector2
Returns
Section titled “Returns”void
castsShadow
Section titled “castsShadow”Get Signature
Section titled “Get Signature”get castsShadow():
boolean
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:447
Whether this sprite contributes its silhouette to the shadow-caster
occlusion pre-pass. Stored as bit 2 of _systemFlags. Default: false
— most sprites don’t cast; opt in by setting to true.
Consumed by the occlusion pre-pass shader, which masks the sprite’s
alpha by this bit before the SDF seed. Flipping it takes effect on
the next frame with zero CPU rebuild (same model as receiveShadows).
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set castsShadow(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:451
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Get Signature
Section titled “Get Signature”get flipX():
boolean
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1517
Get flipX state.
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set flipX(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1524
Set flipX state.
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Get Signature
Section titled “Get Signature”get flipY():
boolean
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1539
Get flipY state.
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set flipY(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1546
Set flipY state.
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Get Signature
Section titled “Get Signature”get frame():
SpriteFrame|null
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1365
Get the current frame.
Returns
Section titled “Returns”SpriteFrame | null
Set Signature
Section titled “Set Signature”set frame(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1372
Set the current frame (R3F prop compatibility).
Parameters
Section titled “Parameters”SpriteFrame | null
Returns
Section titled “Returns”void
height
Section titled “height”Get Signature
Section titled “Get Signature”get height():
number
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1677
Get the height of the sprite in world units.
Returns
Section titled “Returns”number
hitRadius
Section titled “hitRadius”Get Signature
Section titled “Get Signature”get hitRadius():
number
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:276
Hit radius override in local units. Default 0.5 (inscribed half-width of unit quad).
Returns
Section titled “Returns”number
Set Signature
Section titled “Set Signature”set hitRadius(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:280
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
hitTestMode
Section titled “hitTestMode”Get Signature
Section titled “Get Signature”get hitTestMode():
HitTestMode
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:292
Pointer hit-testing strategy. Setting 'none' nulls the instance raycast property.
Returns
Section titled “Returns”Set Signature
Section titled “Set Signature”set hitTestMode(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:296
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Get Signature
Section titled “Get Signature”get lit():
boolean
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:342
Whether this sprite receives lighting from Flatland’s LightEffect.
Stored as bit 0 of _systemFlags so lit/unlit sprites with the same
texture share the same material and batch together.
Default: true — set lit = false to opt out.
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set lit(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:346
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
pixelPerfect
Section titled “pixelPerfect”Get Signature
Section titled “Get Signature”get pixelPerfect():
boolean
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:315
Whether this sprite’s final projected translation snaps to physical pixels.
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set pixelPerfect(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:319
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
receiveShadows
Section titled “receiveShadows”Get Signature
Section titled “Get Signature”get receiveShadows():
boolean
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:369
Whether this sprite receives shadows from the SDF shadow pipeline.
Stored as bit 1 of _systemFlags.
Default: true — set receiveShadows = false to opt out.
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set receiveShadows(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:373
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
shadowRadius
Section titled “shadowRadius”Get Signature
Section titled “Get Signature”get shadowRadius():
number|undefined
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:421
Per-sprite occluder radius (world units) consumed by shadow-casting LightEffects — e.g. DefaultLightEffect’s SDF sphere-tracer uses it as the self-silhouette escape distance so a tracer launched from inside the caster steps out cleanly.
Returns undefined while in auto-resolve mode (default), in which
case transformSyncSystem writes max(|scale.x|, |scale.y|) into
the per-instance attribute each frame — covering animation frames
and runtime scale changes without manual updates. Assign a number
to override (useful when the visible body is tighter than the
quad’s bounds, or when an off-center anchor pushes the silhouette).
Assign undefined to return to auto-resolve.
Returns
Section titled “Returns”number | undefined
Set Signature
Section titled “Set Signature”set shadowRadius(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:425
Parameters
Section titled “Parameters”number | undefined
Returns
Section titled “Returns”void
sortLayer
Section titled “sortLayer”Get Signature
Section titled “Get Signature”get sortLayer():
SortLayerValue
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1579
Get the sortLayer (primary sort key). Returns the registered name when one was assigned; the numeric order otherwise.
Returns
Section titled “Returns”Set Signature
Section titled “Set Signature”set sortLayer(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1591
Set the sortLayer (primary sort key) — a registered name (typed via
SortLayerRegistry augmentation) or a finite signed 32-bit numeric
order. Routes the sprite to the batch matching its new run key on the
next system pass.
Throws
Section titled “Throws”When a numeric order is outside the signed 32-bit range.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
texture
Section titled “texture”Get Signature
Section titled “Get Signature”get texture():
Texture<unknown,TextureEventMap> |null
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1174
Get the current texture.
Returns
Section titled “Returns”Texture <unknown, TextureEventMap > | null
Set Signature
Section titled “Set Signature”set texture(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1181
Set a new texture.
Parameters
Section titled “Parameters”Texture <unknown, TextureEventMap > | null
Returns
Section titled “Returns”void
Get Signature
Section titled “Get Signature”get tint():
Color
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1476
Get tint color. Returns a stored Color reference (like Material.color). Mutating the returned Color triggers ECS sync via onChange callback.
Returns
Section titled “Returns”Set Signature
Section titled “Set Signature”set tint(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1483
Set tint color. Accepts Color, hex string, hex number, or [r, g, b] array (0-1).
Parameters
Section titled “Parameters”string | number | [number, number, number] | Color
Returns
Section titled “Returns”void
Get Signature
Section titled “Get Signature”get width():
number
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1670
Get the width of the sprite in world units.
Returns
Section titled “Returns”number
zIndex
Section titled “zIndex”Get Signature
Section titled “Get Signature”get zIndex():
number
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1634
Get z-index within layer (secondary sort key).
Returns
Section titled “Returns”number
Set Signature
Section titled “Set Signature”set zIndex(
value):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1656
Set z-index within layer (secondary sort key).
Hot path. Every moving sprite in a y-sorted scene calls this every frame, so the cost has to stay near-zero per call.
The raw SoA write is unconditional — transformSyncSystem reads
_zIndexArr directly and bakes the value into the instance matrix
for the GPU depth test. That alone is enough for alphaTest+depthWrite
materials (GPU resolves order via the baked-in Z, no CPU sort needed).
For non-gated materials, we flip the batch’s _sortDirty flag so
batchSortSystem knows to re-sort this batch on its next pass. This
replaced the prior Changed(SpriteZIndex) channel — the generic change
tracker enumerated every flip every frame even when the gate trivially
skipped the sort, costing ~7ms/frame in a 12k-sprite demo. The
per-batch boolean costs one ref read + one write.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
Methods
Section titled “Methods”_setupInstanceAttributes()
Section titled “_setupInstanceAttributes()”_setupInstanceAttributes():
void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1738
Set up instance attributes on the geometry for single-sprite rendering.
Uses one interleaved buffer (mirroring SpriteBatch) so batched and
standalone paths share the same shader attribute shape. Also
allocates buffers for custom attributes from the material’s schema
(pure effect data — effectBuf0, effectBuf1, …).
Returns
Section titled “Returns”void
add(…
object):this
Defined in: three.js/core/Object3D:add
Adds another Object3D as child of this Object3D .
Parameters
Section titled “Parameters”object
Section titled “object”…Object3D <Object3DEventMap >[]
Returns
Section titled “Returns”this
Remarks
Section titled “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.
- attach
- THREE.Group | Group for info on manually grouping objects.
Inherited from
Section titled “Inherited from”Mesh.add
addEffect()
Section titled “addEffect()”addEffect(
effect):this
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1839
Add an effect instance to this sprite. Auto-registers the effect type on the material if not already registered. Sets the enable bit and writes effect data to packed buffers.
Parameters
Section titled “Parameters”effect
Section titled “effect”Returns
Section titled “Returns”this
Example
Section titled “Example”const dissolve = new DissolveEffect()dissolve.progress = 0.5sprite.addEffect(dissolve)addEventListener()
Section titled “addEventListener()”addEventListener<
T>(type,listener):void
Defined in: three.js/core/EventDispatcher:addEventListener
Adds a listener to an event type.
Type Parameters
Section titled “Type Parameters”T extends keyof Object3DEventMap
Parameters
Section titled “Parameters”T
The type of event to listen to.
listener
Section titled “listener”EventListener <Object3DEventMap [T], T, Sprite2D>
The function that gets called when the event is fired.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Mesh.addEventListener
applyMatrix4()
Section titled “applyMatrix4()”applyMatrix4(
matrix):void
Defined in: three.js/core/Object3D:applyMatrix4
Applies the matrix transform to the object and updates the object’s position, rotation and scale.
Parameters
Section titled “Parameters”matrix
Section titled “matrix”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Mesh.applyMatrix4
applyQuaternion()
Section titled “applyQuaternion()”applyQuaternion(
quaternion):this
Defined in: three.js/core/Object3D:applyQuaternion
Applies the rotation represented by the quaternion to the object.
Parameters
Section titled “Parameters”quaternion
Section titled “quaternion”Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Mesh.applyQuaternion
attach()
Section titled “attach()”attach(
object):this
Defined in: three.js/core/Object3D:attach
Adds a Object3D as a child of this, while maintaining the object’s world transform.
Parameters
Section titled “Parameters”object
Section titled “object”Returns
Section titled “Returns”this
Remarks
Section titled “Remarks”Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
Inherited from
Section titled “Inherited from”Mesh.attach
clear()
Section titled “clear()”clear():
this
Defined in: three.js/core/Object3D:clear
Removes all child objects.
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Mesh.clear
clone()
Section titled “clone()”clone(
recursive?):this
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:2817
Clone the sprite.
Parameters
Section titled “Parameters”recursive?
Section titled “recursive?”boolean
Returns
Section titled “Returns”this
Overrides
Section titled “Overrides”Mesh.clone
copy()
Section titled “copy()”copy(
source,recursive?):this
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:2804
Copy Three.js object state while preserving authored visibility. A batched source is internally suppressed, but that implementation detail must not make the copied sprite authored-hidden.
Parameters
Section titled “Parameters”source
Section titled “source”this
recursive?
Section titled “recursive?”boolean
Returns
Section titled “Returns”this
Overrides
Section titled “Overrides”Mesh.copy
dispatchEvent()
Section titled “dispatchEvent()”dispatchEvent<
T>(event):void
Defined in: three.js/core/EventDispatcher:dispatchEvent
Fire an event type.
Type Parameters
Section titled “Type Parameters”T extends keyof Object3DEventMap
Parameters
Section titled “Parameters”BaseEvent <T> & Object3DEventMap [T]
The event that gets fired.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Mesh.dispatchEvent
dispose()
Section titled “dispose()”dispose():
void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:2741
Dispose of resources.
Returns
Section titled “Returns”void
flip()
Section titled “flip()”flip(
horizontal,vertical):this
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1561
Flip the sprite.
Parameters
Section titled “Parameters”horizontal
Section titled “horizontal”boolean
vertical
Section titled “vertical”boolean
Returns
Section titled “Returns”this
getObjectById()
Section titled “getObjectById()”getObjectById(
id):Object3D<Object3DEventMap> |undefined
Defined in: three.js/core/Object3D:getObjectById
Searches through an object and its children, starting with the object itself, and returns the first with a matching id.
Parameters
Section titled “Parameters”number
Unique number of the object instance. Expects a Integer
Returns
Section titled “Returns”Object3D <Object3DEventMap > | undefined
Remarks
Section titled “Remarks”Note that ids are assigned in chronological order: 1, 2, 3, …, incrementing by one for each new object.
id
Inherited from
Section titled “Inherited from”Mesh.getObjectById
getObjectByName()
Section titled “getObjectByName()”getObjectByName(
name):Object3D<Object3DEventMap> |undefined
Defined in: three.js/core/Object3D:getObjectByName
Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
Parameters
Section titled “Parameters”string
String to match to the children’s Object3D.name property.
Returns
Section titled “Returns”Object3D <Object3DEventMap > | undefined
Remarks
Section titled “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
Section titled “Inherited from”Mesh.getObjectByName
getObjectByProperty()
Section titled “getObjectByProperty()”getObjectByProperty(
name,value):Object3D<Object3DEventMap> |undefined
Defined in: three.js/core/Object3D:getObjectByProperty
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
Section titled “Parameters”string
the property name to search for.
any
value of the given property.
Returns
Section titled “Returns”Object3D <Object3DEventMap > | undefined
Inherited from
Section titled “Inherited from”Mesh.getObjectByProperty
getObjectsByProperty()
Section titled “getObjectsByProperty()”getObjectsByProperty(
name,value,optionalTarget?):Object3D<Object3DEventMap>[]
Defined in: three.js/core/Object3D:getObjectsByProperty
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
Section titled “Parameters”string
The property name to search for.
any
Value of the given property.
optionalTarget?
Section titled “optionalTarget?”Object3D <Object3DEventMap >[]
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
Section titled “Returns”Object3D <Object3DEventMap >[]
Inherited from
Section titled “Inherited from”Mesh.getObjectsByProperty
getVertexPosition()
Section titled “getVertexPosition()”getVertexPosition(
index,target):Vector3
Defined in: three.js/objects/Mesh:getVertexPosition
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
Section titled “Parameters”number
Expects a Integer
target
Section titled “target”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Mesh.getVertexPosition
getWorldDirection()
Section titled “getWorldDirection()”getWorldDirection(
target):Vector3
Defined in: three.js/core/Object3D:getWorldDirection
Returns a vector representing the direction of object’s positive z-axis in world space.
Parameters
Section titled “Parameters”target
Section titled “target”The result will be copied into this Vector3.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Mesh.getWorldDirection
getWorldPosition()
Section titled “getWorldPosition()”getWorldPosition(
target):Vector3
Defined in: three.js/core/Object3D:getWorldPosition
Returns a vector representing the position of the object in world space.
Parameters
Section titled “Parameters”target
Section titled “target”The result will be copied into this Vector3.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Mesh.getWorldPosition
getWorldPosition2D()
Section titled “getWorldPosition2D()”getWorldPosition2D():
Vector2
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1817
Get world position (convenience method).
Returns
Section titled “Returns”getWorldQuaternion()
Section titled “getWorldQuaternion()”getWorldQuaternion(
target):Quaternion
Defined in: three.js/core/Object3D:getWorldQuaternion
Returns a quaternion representing the rotation of the object in world space.
Parameters
Section titled “Parameters”target
Section titled “target”The result will be copied into this Quaternion.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Mesh.getWorldQuaternion
getWorldScale()
Section titled “getWorldScale()”getWorldScale(
target):Vector3
Defined in: three.js/core/Object3D:getWorldScale
Returns a vector of the scaling factors applied to the object for each axis in world space.
Parameters
Section titled “Parameters”target
Section titled “target”The result will be copied into this Vector3.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Mesh.getWorldScale
hasEventListener()
Section titled “hasEventListener()”hasEventListener<
T>(type,listener):boolean
Defined in: three.js/core/EventDispatcher:hasEventListener
Checks if listener is added to an event type.
Type Parameters
Section titled “Type Parameters”T extends keyof Object3DEventMap
Parameters
Section titled “Parameters”T
The type of event to listen to.
listener
Section titled “listener”EventListener <Object3DEventMap [T], T, Sprite2D>
The function that gets called when the event is fired.
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”Mesh.hasEventListener
localToWorld()
Section titled “localToWorld()”localToWorld(
vector):Vector3
Defined in: three.js/core/Object3D:localToWorld
Converts the vector from this object’s local space to world space.
Parameters
Section titled “Parameters”vector
Section titled “vector”A vector representing a position in this object’s local space.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Mesh.localToWorld
lookAt()
Section titled “lookAt()”Call Signature
Section titled “Call Signature”lookAt(
vector):void
Defined in: three.js/core/Object3D:lookAt
Rotates the object to face a point in world space.
Parameters
Section titled “Parameters”vector
Section titled “vector”A vector representing a position in world space to look at.
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”This method does not support objects having non-uniformly-scaled parent(s).
Inherited from
Section titled “Inherited from”Mesh.lookAt
Call Signature
Section titled “Call Signature”lookAt(
x,y,z):void
Defined in: three.js/core/Object3D:lookAt
Rotates the object to face a point in world space.
Parameters
Section titled “Parameters”number
Expects a Float
number
Expects a Float
number
Expects a Float
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”This method does not support objects having non-uniformly-scaled parent(s).
Inherited from
Section titled “Inherited from”Mesh.lookAt
onAfterRender()
Section titled “onAfterRender()”onAfterRender(
renderer,scene,camera,geometry,material,group):void
Defined in: three.js/core/Object3D:onAfterRender
An optional callback that is executed immediately after a 3D object is rendered.
Parameters
Section titled “Parameters”renderer
Section titled “renderer”camera
Section titled “camera”geometry
Section titled “geometry”material
Section titled “material”Returns
Section titled “Returns”void
Remarks
Section titled “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
Section titled “Inherited from”Mesh.onAfterRender
onAfterShadow()
Section titled “onAfterShadow()”onAfterShadow(
renderer,scene,camera,shadowCamera,geometry,depthMaterial,group):void
Defined in: three.js/core/Object3D:onAfterShadow
An optional callback that is executed immediately after a 3D object is rendered to a shadow map.
Parameters
Section titled “Parameters”renderer
Section titled “renderer”camera
Section titled “camera”shadowCamera
Section titled “shadowCamera”geometry
Section titled “geometry”depthMaterial
Section titled “depthMaterial”Returns
Section titled “Returns”void
Remarks
Section titled “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
Section titled “Inherited from”Mesh.onAfterShadow
onBeforeShadow()
Section titled “onBeforeShadow()”onBeforeShadow(
renderer,scene,camera,shadowCamera,geometry,depthMaterial,group):void
Defined in: three.js/core/Object3D:onBeforeShadow
An optional callback that is executed immediately before a 3D object is rendered to a shadow map.
Parameters
Section titled “Parameters”renderer
Section titled “renderer”camera
Section titled “camera”shadowCamera
Section titled “shadowCamera”geometry
Section titled “geometry”depthMaterial
Section titled “depthMaterial”Returns
Section titled “Returns”void
Remarks
Section titled “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
Section titled “Inherited from”Mesh.onBeforeShadow
raycast()
Section titled “raycast()”raycast(
raycaster,intersects):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:2242
Pointer raycast against the sprite’s local Z=0 plane.
The quad is a centered unit square ([-0.5, 0.5] in X and Y). Anchor and
scale are already baked into the world matrix by updateMatrix(), so this
method works entirely in centered-quad local space with no anchor math.
Parameters
Section titled “Parameters”raycaster
Section titled “raycaster”intersects
Section titled “intersects”Intersection <Object3D <Object3DEventMap >>[]
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”Mesh.raycast
remove()
Section titled “remove()”remove(…
object):this
Defined in: three.js/core/Object3D:remove
Removes a Object3D as child of this Object3D .
Parameters
Section titled “Parameters”object
Section titled “object”…Object3D <Object3DEventMap >[]
Returns
Section titled “Returns”this
Remarks
Section titled “Remarks”An arbitrary number of objects may be removed.
THREE.Group | Group for info on manually grouping objects.
Inherited from
Section titled “Inherited from”Mesh.remove
removeEffect()
Section titled “removeEffect()”removeEffect(
effect):this
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1981
Remove an effect instance from this sprite. Clears the enable bit and resets effect data to defaults. The effect type remains registered on the material (no shader change).
Parameters
Section titled “Parameters”effect
Section titled “effect”Returns
Section titled “Returns”this
removeEventListener()
Section titled “removeEventListener()”removeEventListener<
T>(type,listener):void
Defined in: three.js/core/EventDispatcher:removeEventListener
Removes a listener from an event type.
Type Parameters
Section titled “Type Parameters”T extends keyof Object3DEventMap
Parameters
Section titled “Parameters”T
The type of the listener that gets removed.
listener
Section titled “listener”EventListener <Object3DEventMap [T], T, Sprite2D>
The listener function that gets removed.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Mesh.removeEventListener
removeFromParent()
Section titled “removeFromParent()”removeFromParent():
this
Defined in: three.js/core/Object3D:removeFromParent
Removes this object from its current parent.
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Mesh.removeFromParent
rotateOnAxis()
Section titled “rotateOnAxis()”rotateOnAxis(
axis,angle):this
Defined in: three.js/core/Object3D:rotateOnAxis
Rotate an object along an axis in object space.
Parameters
Section titled “Parameters”A normalized vector in object space.
number
The angle in radians. Expects a Float
Returns
Section titled “Returns”this
Remarks
Section titled “Remarks”The axis is assumed to be normalized.
Inherited from
Section titled “Inherited from”Mesh.rotateOnAxis
rotateOnWorldAxis()
Section titled “rotateOnWorldAxis()”rotateOnWorldAxis(
axis,angle):this
Defined in: three.js/core/Object3D:rotateOnWorldAxis
Rotate an object along an axis in world space.
Parameters
Section titled “Parameters”A normalized vector in world space.
number
The angle in radians. Expects a Float
Returns
Section titled “Returns”this
Remarks
Section titled “Remarks”The axis is assumed to be normalized Method Assumes no rotated parent.
Inherited from
Section titled “Inherited from”Mesh.rotateOnWorldAxis
rotateX()
Section titled “rotateX()”rotateX(
angle):this
Defined in: three.js/core/Object3D:rotateX
Rotates the object around x axis in local space.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Mesh.rotateX
rotateY()
Section titled “rotateY()”rotateY(
angle):this
Defined in: three.js/core/Object3D:rotateY
Rotates the object around y axis in local space.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Mesh.rotateY
rotateZ()
Section titled “rotateZ()”rotateZ(
angle):this
Defined in: three.js/core/Object3D:rotateZ
Rotates the object around z axis in local space.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Mesh.rotateZ
setAnchor()
Section titled “setAnchor()”setAnchor(
x,y):this
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1467
Set the anchor point (0-1). (0, 0) = top-left, (0.5, 0.5) = center, (0.5, 1) = bottom-center
The anchor offset is baked into the matrix transform — no
geometry rebuild. Writing _anchor.set(...) triggers the
observable.vector2 callback which marks the matrix dirty; the next
updateMatrix picks up the new value.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”this
setFrame()
Section titled “setFrame()”setFrame(
frame):this
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:1382
Set the current frame. Note: Does not modify scale - call updateSize() manually if needed after first frame.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
setRotationFromAxisAngle()
Section titled “setRotationFromAxisAngle()”setRotationFromAxisAngle(
axis,angle):void
Defined in: three.js/core/Object3D:setRotationFromAxisAngle
Calls THREE.Quaternion.setFromAxisAngle | setFromAxisAngle(axis, angle) on the .quaternion.
Parameters
Section titled “Parameters”A normalized vector in object space.
number
Angle in radians. Expects a Float
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Mesh.setRotationFromAxisAngle
setRotationFromEuler()
Section titled “setRotationFromEuler()”setRotationFromEuler(
euler):void
Defined in: three.js/core/Object3D:setRotationFromEuler
Calls THREE.Quaternion.setFromEuler | setFromEuler(euler) on the .quaternion.
Parameters
Section titled “Parameters”Euler angle specifying rotation amount.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Mesh.setRotationFromEuler
setRotationFromMatrix()
Section titled “setRotationFromMatrix()”setRotationFromMatrix(
m):void
Defined in: three.js/core/Object3D:setRotationFromMatrix
Calls THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix(m) on the .quaternion.
Parameters
Section titled “Parameters”Rotate the quaternion by the rotation component of the matrix.
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
Inherited from
Section titled “Inherited from”Mesh.setRotationFromMatrix
setRotationFromQuaternion()
Section titled “setRotationFromQuaternion()”setRotationFromQuaternion(
q):void
Defined in: three.js/core/Object3D:setRotationFromQuaternion
Copy the given THREE.Quaternion | Quaternion into .quaternion.
Parameters
Section titled “Parameters”Normalized Quaternion.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Mesh.setRotationFromQuaternion
toJSON()
Section titled “toJSON()”toJSON(
meta?):MeshJSON
Defined in: three.js/objects/Mesh:toJSON
Convert the object to three.js JSON Object/Scene format .
Parameters
Section titled “Parameters”Object containing metadata such as materials, textures or images for the object.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Mesh.toJSON
translateOnAxis()
Section titled “translateOnAxis()”translateOnAxis(
axis,distance):this
Defined in: three.js/core/Object3D:translateOnAxis
Translate an object by distance along an axis in object space
Parameters
Section titled “Parameters”A normalized vector in object space.
distance
Section titled “distance”number
The distance to translate. Expects a Float
Returns
Section titled “Returns”this
Remarks
Section titled “Remarks”The axis is assumed to be normalized.
Inherited from
Section titled “Inherited from”Mesh.translateOnAxis
translateX()
Section titled “translateX()”translateX(
distance):this
Defined in: three.js/core/Object3D:translateX
Translates object along x axis in object space by distance units.
Parameters
Section titled “Parameters”distance
Section titled “distance”number
Expects a Float
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Mesh.translateX
translateY()
Section titled “translateY()”translateY(
distance):this
Defined in: three.js/core/Object3D:translateY
Translates object along y axis in object space by distance units.
Parameters
Section titled “Parameters”distance
Section titled “distance”number
Expects a Float
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Mesh.translateY
translateZ()
Section titled “translateZ()”translateZ(
distance):this
Defined in: three.js/core/Object3D:translateZ
Translates object along z axis in object space by distance units.
Parameters
Section titled “Parameters”distance
Section titled “distance”number
Expects a Float
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Mesh.translateZ
traverse()
Section titled “traverse()”traverse(
callback):void
Defined in: three.js/core/Object3D:traverse
Executes the callback on this object and all descendants.
Parameters
Section titled “Parameters”callback
Section titled “callback”(object) => any
A function with as first argument an Object3D object.
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”Note: Modifying the scene graph inside the callback is discouraged.
Inherited from
Section titled “Inherited from”Mesh.traverse
traverseAncestors()
Section titled “traverseAncestors()”traverseAncestors(
callback):void
Defined in: three.js/core/Object3D:traverseAncestors
Executes the callback on all ancestors.
Parameters
Section titled “Parameters”callback
Section titled “callback”(object) => any
A function with as first argument an Object3D object.
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”Note: Modifying the scene graph inside the callback is discouraged.
Inherited from
Section titled “Inherited from”Mesh.traverseAncestors
traverseVisible()
Section titled “traverseVisible()”traverseVisible(
callback):void
Defined in: three.js/core/Object3D:traverseVisible
Like traverse, but the callback will only be executed for visible objects
Parameters
Section titled “Parameters”callback
Section titled “callback”(object) => any
A function with as first argument an Object3D object.
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”Descendants of invisible objects are not traversed. Note: Modifying the scene graph inside the callback is discouraged.
Inherited from
Section titled “Inherited from”Mesh.traverseVisible
updateMatrix()
Section titled “updateMatrix()”updateMatrix():
void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:2460
Fast 2D matrix update — bypasses Three.js quaternion-based compose().
Three.js Object3D.updateMatrix() calls matrix.compose(position, quaternion, scale) which does full 3D quaternion→matrix math (~20 multiplies). For 2D sprites we only need position, scale, and optional Z-axis rotation — written directly to the matrix elements.
Also bakes in the layer/zIndex Z offset without save/restore of position.z.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”Mesh.updateMatrix
updateMatrixWorld()
Section titled “updateMatrixWorld()”updateMatrixWorld(
force?):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:2332
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
Section titled “Parameters”force?
Section titled “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
Section titled “Returns”void
Overrides
Section titled “Overrides”Mesh.updateMatrixWorld
updateMorphTargets()
Section titled “updateMorphTargets()”updateMorphTargets():
void
Defined in: three.js/objects/Mesh:updateMorphTargets
Updates the morphTargets to have no influence on the object
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”Resets the morphTargetInfluences and morphTargetDictionary properties.
Inherited from
Section titled “Inherited from”Mesh.updateMorphTargets
updateWorldMatrix()
Section titled “updateWorldMatrix()”updateWorldMatrix(
updateParents,updateChildren):void
Defined in: packages/three-flatland/src/sprites/Sprite2D.ts:2324
Make matrixWorld current on demand. For an enrolled (batched) sprite,
matrixWorldAutoUpdate is off and the sprite is not a graph child, so
three’s own traversal never composes it — do it here. For a standalone
sprite, defer to three’s normal ancestor walk. This is the standard
three refresh contract, so any consumer (raycast, bounds, devtools) can
sprite.updateWorldMatrix(true, false) then read matrixWorld.
Parameters
Section titled “Parameters”updateParents
Section titled “updateParents”boolean
updateChildren
Section titled “updateChildren”boolean
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”Mesh.updateWorldMatrix
worldToLocal()
Section titled “worldToLocal()”worldToLocal(
vector):Vector3
Defined in: three.js/core/Object3D:worldToLocal
Converts the vector from world space to this object’s local space.
Parameters
Section titled “Parameters”vector
Section titled “vector”A vector representing a position in world space.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Mesh.worldToLocal