The color used by shapes, specified in sRGB color space. The alpha component is respected. Defaults to white.
Whether shapes are depth tested against the depth buffer. Defaults to true.
The layer shapes are rendered into, or null to use the LAYERID_IMMEDIATE layer. Defaults to null.
The number of line segments used to approximate a full circle. Defaults to 20.
A matrix applied to every point of every shape, or null for no transform. Assign this to draw a group of shapes in the local space of a node. Defaults to null.
Renders the three axes of a matrix, colored red, green and blue for x, y and z respectively. This function ignores WireRenderer#color.
The transform whose axes are rendered.
The length of each axis.
Renders the edges of a bounding box. An OrientedBox is rendered in its own orientation, composed with WireRenderer#transform.
The box to render.
Renders a cone as a base ring joined to its apex by four side lines. The parameters match those describing a spot light, so a light's cone can be visualized directly.
Renders the edges of a view frustum. The camera does not need to be enabled or rendering, so the view volume of an inactive camera can be visualized.
A camera, or a view-projection matrix.
Renders the shape and extent of a light, using the light's own color. An omni light is drawn as a sphere of its range, a spot light as its cone, and a directional light as an arrow showing the direction it shines in. A light shines along the negative y-axis of its entity, so the shape follows that axis rather than the entity's forward direction.
The light to render.
Optionalsize: number = 1
The length of the arrow used for a directional light, which has no inherent extent. Defaults to 1.
Renders discrete line segments, formed by consecutive pairs of points.
The points to draw lines between. The length must be a multiple of two.
Optionalcolors: Color[]
One color per point, or undefined to use WireRenderer#color. The color of each segment is interpolated between its ends.
Renders discrete line segments from packed arrays of numbers. This is the fastest of the line functions, as it avoids reading individual Vec3 and Color instances.
Packed xyz coordinates, forming pairs of points.
Optionalcolors: number[] | Float32Array<ArrayBufferLike>
Packed rgba values, one color per point, or undefined to use WireRenderer#color.
Renders a closed strip of connected line segments, joining the last point back to the first.
The points of the loop, in order.
Optionalcolors: Color[]
One color per point, or undefined to use WireRenderer#color.
Renders a square section of a plane, with a short stub along its normal.
The rotation of the square within its plane is derived from the normal, and no such derivation is continuous over all directions. An animated normal will therefore make the square appear to jump as it passes the direction where the derivation switches. To rotate a square smoothly, pass a fixed normal and drive WireRenderer#transform instead.
Renders a small axis-aligned cross marking a position.
The position to mark.
The overall length of each arm of the cross.
Renders an open strip of connected line segments.
The points of the strip, in order.
Optionalcolors: Color[]
One color per point, or undefined to use WireRenderer#color.
Renders a sphere as three great circles, one in each of the primary planes.
The center of the sphere.
The radius of the sphere.
Renders wireframe shapes for a single frame, for debugging and visualization. Shapes are submitted as line segments to the layer given by WireRenderer#layer, which defaults to the LAYERID_IMMEDIATE layer, and are discarded once the frame has been rendered, so they must be issued again on every frame they should be visible.
The renderer holds the state used by the shapes it draws - WireRenderer#color, WireRenderer#layer, WireRenderer#depthTest, WireRenderer#segments and WireRenderer#transform. Fields can be assigned between calls, and drawing many shapes with the same state allocates nothing:
A second set of state is simply a second instance. Instances hold no GPU resources, and those sharing a layer and depth test mode submit into the same batch, so using several has no additional rendering cost:
These are thin lines, one pixel wide. For thick lines with caps, joins and dashes, intended as part of the rendered scene rather than as a debugging aid, see WideLineRenderer instead.