PointsRenderable
A set of point markers drawn as screen-space sprites.
Each point has a world-space position, a color, a size in pixels, and a marker shape. All instances share a single marker sprite atlas. The point set is fixed at construction, so build a new instance to change it. Construct these directly inside a custom Layer.
ts
class Particles extends Layer {
public readonly type = "Particles";
constructor(positions: vec3[]) {
super();
this.addObject(
new PointsRenderable(
positions.map((position) => ({
position,
color: Color.RED,
size: 20,
marker: "circle" as const,
}))
)
);
this.setState("ready");
}
public update() {}
}Extends RenderableObject and inherits all public properties and methods.
Constructor
Creates a renderable drawing one marker per entry.
ts
new PointsRenderable(points): PointsRenderable;| Parameter | Description |
|---|---|
points: PointProps[] | The points to draw. |
Types
PointProps
Initialization properties for a point in PointsRenderable.
| Property | Description |
|---|---|
position: vec3 | World-space position of the point. |
color: ColorLike | Fill color of the marker. |
size: number | Marker size in pixels. |
marker: Marker | Marker shape. |
Accessors
type string overrides
Identifies the renderable type as PointsRenderable.
ts
get type(): string;