SplatComponent class Gaussian splatting

An engine component that draws a GaussianSplats set.

Attach it to a node like any other component; the node's transform places and orients the set (uniform scale only, since a non-uniform scale distorts the splat covariances). The inherited mesh-component machinery registers, culls, and bounds the draw; the splats render in the translucent phase, depth-tested against opaque scene geometry.

final splats = await GaussianSplats.fromAsset('assets/garden.ply');
scene.add(Node()..addComponent(SplatComponent(splats)));
Inheritance

Constructors

SplatComponent(GaussianSplats splats)
Creates a component that draws splats.
factory

Properties

antialiased bool
Whether small-footprint opacity compensation (anti-aliased rasterization) is enabled.
getter/setter pair
cropBox → Matrix4?
The active crop box (a unit cube placed in the set's local space), or null when no crop is set. See setCropBox.
no setter
cropMode SplatCropMode
How the crop box filters splats.
no setter
enabled bool
Whether this component's update hook runs each frame.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isAttached bool
Whether this component is currently attached to a node.
no setterinherited
isLoaded bool
Whether onLoad has completed.
no setterinherited
isMounted bool
Whether the owning node is part of a live scene graph.
no setterinherited
mesh Mesh
The mesh this component draws.
getter/setter pairinherited
node Node
The node this component is attached to.
no setterinherited
opacity double
Global opacity multiplier in 0, 1.
getter/setter pair
renderItems List<RenderItem>
The render items registered for this component's mesh primitives, empty while not mounted. Exposed so a subclass (the LOD component) can tag the items it just registered.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shDegree int
The spherical-harmonic degree evaluated per splat, clamped to what the set carries.
getter/setter pair
splats GaussianSplats
The splat set this component draws.
final
splatScale double
Multiplier on every splat's footprint; 1 is the captured size.
getter/setter pair
tint ↔ Vector4
Linear RGBA tint multiplied into every splat.
getter/setter pair

Methods

cloneFor(Node cloneOwner) Component?
Returns a copy of this component for cloneOwner, the Node.clone counterpart of the owning node, or null to not carry the component to clones (the default).
inherited
fixedUpdate(double fixedDt) → void
Called once per fixed physics step while the component is mounted, enabled, and loaded. fixedDt is the fixed timestep of the surrounding PhysicsWorld, not the frame interval.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAttach() → void
Called when this component is added to a node.
inherited
onDetach() → void
Called when this component is removed from a node.
inherited
onLoad() Future<void>
Optional asynchronous setup, such as loading an asset.
inherited
onMount() → void
Called when the owning node enters a live scene graph.
inherited
onRenderItemsRegistered() → void
Called after this component registers its render items, on mount and on every re-registration (mesh assignment, refreshMaterials).
inherited
onUnmount() → void
Called when the owning node leaves a live scene graph.
override
setCropBox(Matrix4? box, {SplatCropMode mode = SplatCropMode.include}) → void
Sets or clears the crop box. box places a unit cube (corners at +/-1) in the set's local space, and mode keeps only the splats inside it or drops them. Cropping runs per frame on the GPU, so the box can animate freely.
toString() String
A string representation of this object.
inherited
update(double deltaSeconds) → void
Called once per frame while the component is mounted, enabled, and loaded. deltaSeconds is the elapsed time since the previous tick.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited