Documentation / scene / MeshDrawable
Class: MeshDrawable<M>
Defined in: libs/scene/src/scene/meshdrawable.ts:131
Base interface for a drawable (renderable) object.
A drawable encapsulates geometry, material, and GPU-resident data required to be rendered. Implementations integrate with render queues, batching, and instancing.
Extends
MeshDrawableBase<this> &object&Disposable<this> &IMixinDrawable
Type Parameters
M
M extends MeshMaterial
Implements
Constructors
Constructor
new MeshDrawable<
M>(node,material,primitive):MeshDrawable<M>
Defined in: libs/scene/src/scene/meshdrawable.ts:137
Parameters
node
material
M
primitive
Returns
MeshDrawable<M>
Overrides
applyMixins(MeshDrawableBase, mixinDrawable).constructor
Properties
objectColor
readonlyobjectColor:Vector4
Defined in: libs/scene/src/render/drawable_mixin.ts:13
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).objectColor
Accessors
disposed
Get Signature
get disposed():
boolean
Defined in: libs/base/dist/index.d.ts:6107
Returns
boolean
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).disposed
material
Get Signature
get material():
M
Defined in: libs/scene/src/scene/meshdrawable.ts:142
Returns
M
Set Signature
set material(
mat):void
Defined in: libs/scene/src/scene/meshdrawable.ts:145
Parameters
mat
M
Returns
void
primitive
Get Signature
get primitive():
Primitive
Defined in: libs/scene/src/scene/meshdrawable.ts:151
Returns
Set Signature
set primitive(
prim):void
Defined in: libs/scene/src/scene/meshdrawable.ts:154
Parameters
prim
Returns
void
Methods
isPrototypeOf()
staticisPrototypeOf(v):boolean
Defined in: libs/base/dist/index.d.ts:80
Parameters
v
object
Returns
boolean
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).isPrototypeOf
on()
on<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:630
IEventTarget.on
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).on
once()
once<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:634
IEventTarget.once
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).once
off()
off<
K>(type,listener?,context?):void
Defined in: libs/base/dist/index.d.ts:638
IEventTarget.off
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener?
EventListener<{ dispose: []; }>
context?
unknown
Returns
void
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).off
dispatchEvent()
dispatchEvent<
K>(type, ...args):void
Defined in: libs/base/dist/index.d.ts:642
IEventTarget.dispatchEvent
Type Parameters
K
K extends "dispose"
Parameters
type
K
args
...object[K]
Returns
void
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).dispatchEvent
dispose()
dispose():
void
Defined in: libs/base/dist/index.d.ts:6108
Releases all GPU resources and detaches from the renderer.
Returns
void
Implementation of
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).dispose
getDrawableId()
getDrawableId():
number
Defined in: libs/scene/src/render/drawable_mixin.ts:14
Unique, stable identifier for the drawable, used in caches and picking.
Returns
number
Implementation of
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).getDrawableId
pushRenderQueueRef()
pushRenderQueueRef(
ref):void
Defined in: libs/scene/src/render/drawable_mixin.ts:15
Pushes a reference to the current render queue for cleanup or back-references.
Useful for batching or delayed state application.
Parameters
ref
Returns
void
Implementation of
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).pushRenderQueueRef
applyInstanceOffsetAndStride()
applyInstanceOffsetAndStride(
renderQueue,stride,offset):void
Defined in: libs/scene/src/render/drawable_mixin.ts:16
Parameters
renderQueue
stride
number
offset
number
Returns
void
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).applyInstanceOffsetAndStride
applyTransformUniforms()
applyTransformUniforms(
renderQueue):void
Defined in: libs/scene/src/render/drawable_mixin.ts:17
Applies transform-related uniforms to the active bind group or pipeline.
Parameters
renderQueue
The current render queue issuing this draw.
Returns
void
Implementation of
Drawable.applyTransformUniforms
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).applyTransformUniforms
applyMaterialUniforms()
applyMaterialUniforms(
instanceInfo):void
Defined in: libs/scene/src/render/drawable_mixin.ts:18
Parameters
instanceInfo
Returns
void
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).applyMaterialUniforms
applyMaterialUniformsAll()
applyMaterialUniformsAll():
void
Defined in: libs/scene/src/render/drawable_mixin.ts:19
Returns
void
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).applyMaterialUniformsAll
getObjectColor()
getObjectColor():
Vector4
Defined in: libs/scene/src/render/drawable_mixin.ts:20
Returns the unique color used for GPU picking (object ID in color).
Returns
Vector4
Implementation of
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).getObjectColor
updateState()
updateState():
void
Defined in: libs/scene/src/render/drawable_mixin.ts:21
Updates internal state or GPU resources for this drawable, if needed.
Returns
void
Implementation of
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).updateState
bind()
bind(
ctx,renderQueue):void
Defined in: libs/scene/src/render/drawable_mixin.ts:22
Parameters
ctx
renderQueue
Returns
void
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).bind
getNode()
getNode():
SceneNode
Defined in: libs/scene/src/scene/meshdrawable.ts:126
Returns the owning scene node (transform and hierarchy).
Returns
Implementation of
Inherited from
applyMixins(MeshDrawableBase, mixinDrawable).getNode
getMaterial()
getMaterial():
MeshMaterial
Defined in: libs/scene/src/scene/meshdrawable.ts:148
Returns the bound material driving shading for this drawable.
Returns
Implementation of
getPrimitive()
getPrimitive():
Primitive
Defined in: libs/scene/src/scene/meshdrawable.ts:157
Returns the geometry primitive to be drawn.
Returns
Implementation of
getPickTarget()
getPickTarget():
PickTarget
Defined in: libs/scene/src/scene/meshdrawable.ts:160
Returns the pick target override to be reported when this object is picked.
If not set, a default target derived from the node/material may be used.
Returns
Implementation of
getBoneMatrices()
getBoneMatrices():
Texture2D<unknown>
Defined in: libs/scene/src/scene/meshdrawable.ts:163
Returns the texture containing bone matrices for skinned meshes.
Returns
Texture2D<unknown>
Implementation of
getSkinInfluenceData()
getSkinInfluenceData():
SkinInfluenceData
Defined in: libs/scene/src/scene/meshdrawable.ts:166
Returns additional per-vertex skinning influences packed in a texture, if needed.
Returns
Implementation of
getMorphData()
getMorphData():
MorphData
Defined in: libs/scene/src/scene/meshdrawable.ts:169
Returns the morph target data texture (if morphing is used).
Returns
Implementation of
getMorphInfo()
getMorphInfo():
MorphInfo
Defined in: libs/scene/src/scene/meshdrawable.ts:172
Returns the morph information buffer (weights, ranges, etc.).
Returns
Implementation of
getSortDistance()
getSortDistance(
camera):number
Defined in: libs/scene/src/scene/meshdrawable.ts:178
Computes the distance used for sorting (e.g., transparent draw order).
Parameters
camera
Camera from which to compute distance (usually camera -> object).
Returns
number
Implementation of
getQueueType()
getQueueType():
number
Defined in: libs/scene/src/scene/meshdrawable.ts:186
Returns the type/category of render queue this object belongs to.
Returns
number
Implementation of
needSceneColor()
needSceneColor():
boolean
Defined in: libs/scene/src/scene/meshdrawable.ts:189
Whether the object requires access to the scene color buffer.
Returns
boolean
Implementation of
needSceneDepth()
needSceneDepth():
boolean
Defined in: libs/scene/src/scene/meshdrawable.ts:192
Whether the object requires access to the scene depth (linear or non-linear).
Returns
boolean
Implementation of
isUnlit()
isUnlit():
boolean
Defined in: libs/scene/src/scene/meshdrawable.ts:195
True if shading is unlit (does not depend on scene lighting).
Returns
boolean
Implementation of
isBatchable()
isBatchable():
this is BatchDrawable
Defined in: libs/scene/src/scene/meshdrawable.ts:198
Returns true if the object supports instanced rendering.
When true, the object should also implement the BatchDrawable methods.
Returns
this is BatchDrawable
Implementation of
draw()
draw(
ctx,renderQueue):void
Defined in: libs/scene/src/scene/meshdrawable.ts:201
Issues draw commands for this object.
Parameters
ctx
Full draw context for the current pass.
renderQueue
The current render queue issuing this draw.
Returns
void
Implementation of
onDispose()
protectedonDispose():void
Defined in: libs/scene/src/scene/meshdrawable.ts:209
Returns
void
Overrides
applyMixins(MeshDrawableBase, mixinDrawable).onDispose
getName()
getName():
string
Defined in: libs/scene/src/scene/meshdrawable.ts:215
Gets the display name of the drawable object (for debugging/UI).
Returns
string
Implementation of
Overrides
applyMixins(MeshDrawableBase, mixinDrawable).getName