Shape
Every shape takes the shared props below plus its own size props. Every numeric prop accepts a plain number or an animated value.
Shared by every shape
Section titled “Shared by every shape”| Prop | Type | Default | Notes |
|---|---|---|---|
position | Vec3 | 0 | Object { x, y, z }, tuple [x, y, z], partial object, or one number for all three |
rotation | Vec3 | 0 | Same forms; degrees |
color | string | white | Hex #rrggbb or #rrggbbaa |
opacity | number | 0.9 | |
material | Material | lambert, ambient: 0.2 | See Materials |
onClick | (shape, event) => void | ||
onPointerOver | (shape) => void | ||
onPointerOut | (shape) => void |
outline and glow are not props. They come from an enclosing <Effect> —
see Composers.
Size props by shape
Section titled “Size props by shape”height is the full height unless noted. roundness rounds edges and
shrinks the shape by the same amount; only the shapes listed with it have it.
| Component | Size props | Notes |
|---|---|---|
<Box> | size, roundness | size is half-extents per axis; one number for a cube |
<BoxFrame> | size, edge | Wireframe box; edge is the bar thickness |
<Sphere> | radius, roundness | |
<Ellipsoid> | size | Three radii |
<Octahedron> | size | Vertex distance from centre |
<Cylinder> | radius, height | |
<RoundedCylinder> | radius, height, roundness | |
<HexPrism> | radius, height | |
<TriPrism> | radius, height | Approximate distance |
<Plane> | size, roundness | A thin rounded rectangle |
<Rhombus> | lengthA, lengthB, height, roundness | Half-diagonals |
<Pyramid> | base, height | Square base half-extent |
<Cone> | radius, height | |
<CappedCone> | radiusBottom, radiusTop, height | |
<RoundCone> | radiusBottom, radiusTop, height | Spherical ends |
<Capsule> | radius, height, roundness | height is the distance between the two sphere centres |
<Torus> | radius, thickness, open, capAngle, roundness | radius is the ring, thickness the tube; open with capAngle in degrees draws a partial ring |
<Link> | radius, thickness, length | A torus stretched by length |
<CutSphere> | radius, cutHeight | |
<CutHollowSphere> | radius, cutHeight, thickness | |
<DeathStar> | radius, biteRadius, biteOffset | |
<SolidAngle> | angle, radius | Cone-shaped slice of a sphere; angle in radians |
<Circle2D> | radius | Flat — pair with <Extrude> or <Revolve> |
<Rect2D> | size | Flat |
<RoundedRect2D> | size, roundness | Flat |
What the component does with them
Section titled “What the component does with them”Each component maps its own props into the engine’s fixed record — three size
floats, a rounding float, and a type ID — at registration. <Sphere radius>
becomes size.x; <Torus radius thickness capAngle> becomes size.x,
size.y and size.z in radians. That mapping, and the shader case that reads
it, are the shape’s contract; see Adding a shape.