#[non_exhaustive]pub enum Payload {
None,
Mesh(Mesh),
InstancedMesh(InstancedMesh),
SkinnedMesh(Box<SkinnedMesh>),
BatchedMesh(Box<BatchedMesh>),
Line(Line),
Points(Points),
Sprite(Sprite),
Light(LightObject),
ClippingGroup(ClippingGroup),
}Expand description
The subclass state of one crate::core::Object3D.
None is a plain Object3D, a Group, a Bone — anything the renderer
walks through without drawing.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
None
A plain Object3D, a Group or a Bone: nothing to draw.
Mesh(Mesh)
Mesh.geometry / Mesh.material.
InstancedMesh(InstancedMesh)
InstancedMesh extends Mesh.
SkinnedMesh(Box<SkinnedMesh>)
SkinnedMesh extends Mesh — the skeleton and the two bind matrices on
top of the Mesh. is_mesh() is true for it, as isMesh is in
three.js. Boxed because the two bind matrices and the bounding volumes
make it half again the size of the next-largest variant, and every
Object3D in the tree carries a Payload.
BatchedMesh(Box<BatchedMesh>)
BatchedMesh extends Mesh — boxed because it is much the largest
variant (three data textures and two draw-list arrays).
Line(Line)
Line extends Object3D — and LineSegments extends Line, which is the
is_line_segments flag inside. Not a Mesh: the renderer reads the
object to pick line-strip / line-list over triangle-list.
Points(Points)
Points extends Object3D — like Line, not a Mesh: the renderer
reads the object to pick point-list over triangle-list.
Sprite(Sprite)
Sprite extends Object3D — not a Mesh either: _projectObject()
gives it an arm of its own, culled by Frustum.intersectsSprite() and
sorted by its origin rather than by a geometry bounding sphere.
Light(LightObject)
Light extends Object3D, one variant per subclass. The renderer reaches
it through RenderList.lights, which _projectObject() fills from
object.is_light — set alongside this variant.
ClippingGroup(ClippingGroup)
ClippingGroup extends Group — the planes _projectObject() folds
into the clipping context of everything below it.
Implementations§
Source§impl Payload
impl Payload
Sourcepub fn is_mesh(&self) -> bool
pub fn is_mesh(&self) -> bool
object.isMesh — true for InstancedMesh too, exactly as in three.js
where InstancedMesh extends Mesh.
Sourcepub fn is_skinned_mesh(&self) -> bool
pub fn is_skinned_mesh(&self) -> bool
object.isSkinnedMesh.
Sourcepub fn skinned_mesh(&self) -> Option<&SkinnedMesh>
pub fn skinned_mesh(&self) -> Option<&SkinnedMesh>
The SkinnedMesh this node is, if it is one.
Sourcepub fn skinned_mesh_mut(&mut self) -> Option<&mut SkinnedMesh>
pub fn skinned_mesh_mut(&mut self) -> Option<&mut SkinnedMesh>
The SkinnedMesh this node is, mutably, if it is one.
Sourcepub fn is_instanced_mesh(&self) -> bool
pub fn is_instanced_mesh(&self) -> bool
object.isInstancedMesh.
Sourcepub fn is_line(&self) -> bool
pub fn is_line(&self) -> bool
object.isLine — true for a LineSegments too, exactly as in three.js
where LineSegments extends Line.
Sourcepub fn is_line_segments(&self) -> bool
pub fn is_line_segments(&self) -> bool
object.isLineSegments.
Sourcepub fn is_clipping_group(&self) -> bool
pub fn is_clipping_group(&self) -> bool
object.isClippingGroup.
Sourcepub fn clipping_group(&self) -> Option<&ClippingGroup>
pub fn clipping_group(&self) -> Option<&ClippingGroup>
The ClippingGroup this node is, if it is one.
Sourcepub fn clipping_group_mut(&mut self) -> Option<&mut ClippingGroup>
pub fn clipping_group_mut(&mut self) -> Option<&mut ClippingGroup>
The ClippingGroup this node is, mutably, if it is one.
Sourcepub fn sprite_mut(&mut self) -> Option<&mut Sprite>
pub fn sprite_mut(&mut self) -> Option<&mut Sprite>
The Sprite this node is, mutably, if it is one.
Sourcepub fn points_mut(&mut self) -> Option<&mut Points>
pub fn points_mut(&mut self) -> Option<&mut Points>
The Points this node is, mutably, if it is one.
Sourcepub fn geometry(&self) -> Option<&Rc<BufferGeometry>>
pub fn geometry(&self) -> Option<&Rc<BufferGeometry>>
object.geometry for anything _projectObject()’s
isMesh || isLine || isPoints arm draws, and for its isSprite arm.
Sourcepub fn material(&self) -> Option<&MeshBasicNodeMaterial>
pub fn material(&self) -> Option<&MeshBasicNodeMaterial>
object.material for the same set. None is three.js’ “no material of
its own”, which scene.overrideMaterial (or MeshBasicNodeMaterial’s
defaults) stands in for.
Sourcepub fn material_mut(&mut self) -> Option<&mut MeshBasicNodeMaterial>
pub fn material_mut(&mut self) -> Option<&mut MeshBasicNodeMaterial>
object.material for writing — what ReflectorNode.updateBefore()
needs to set material.visible = false around its own render.
Sourcepub fn morph_target_influences(&self) -> Vec<f64>
pub fn morph_target_influences(&self) -> Vec<f64>
Mesh.morphTargetInfluences. A Line has the field in three.js too, but
nothing on the ladder morphs one, so it is always empty here. A
SkinnedMesh keeps its influences behind an Rc<RefCell<…>> — the
animation binding writes into them from outside — so this returns a
value rather than a borrow.
Sourcepub fn mesh_mut(&mut self) -> Option<&mut Mesh>
pub fn mesh_mut(&mut self) -> Option<&mut Mesh>
The Mesh half, mutably, of whichever mesh-ish payload this is.
Sourcepub fn light(&self) -> Option<&LightObject>
pub fn light(&self) -> Option<&LightObject>
The light this node is, if it is one.
Sourcepub fn light_mut(&mut self) -> Option<&mut LightObject>
pub fn light_mut(&mut self) -> Option<&mut LightObject>
The light this node is, mutably, if it is one.
Sourcepub fn is_batched_mesh(&self) -> bool
pub fn is_batched_mesh(&self) -> bool
object.isBatchedMesh.
Sourcepub fn batched_mesh(&self) -> Option<&BatchedMesh>
pub fn batched_mesh(&self) -> Option<&BatchedMesh>
The BatchedMesh this node is, if it is one.
Sourcepub fn batched_mesh_mut(&mut self) -> Option<&mut BatchedMesh>
pub fn batched_mesh_mut(&mut self) -> Option<&mut BatchedMesh>
The BatchedMesh this node is, mutably, if it is one.
Sourcepub fn instanced_mesh(&self) -> Option<&InstancedMesh>
pub fn instanced_mesh(&self) -> Option<&InstancedMesh>
The InstancedMesh this node is, if it is one.
Sourcepub fn instanced_mesh_mut(&mut self) -> Option<&mut InstancedMesh>
pub fn instanced_mesh_mut(&mut self) -> Option<&mut InstancedMesh>
The InstancedMesh this node is, mutably, if it is one.
Sourcepub fn instance_matrix(&self) -> Option<&InstancedBufferAttribute>
pub fn instance_matrix(&self) -> Option<&InstancedBufferAttribute>
InstancedMesh.instanceMatrix, None for a plain mesh.
Sourcepub fn instance_color(&self) -> Option<&InstancedBufferAttribute>
pub fn instance_color(&self) -> Option<&InstancedBufferAttribute>
InstancedMesh.instanceColor — None until setColorAt() is called,
and None for a plain mesh.