Struct TriangleListPrimitive

Struct Documentation

struct TriangleListPrimitive

A primitive representing a set of triangles or a surface tiled by triangles.

Public Functions

FoxgloveError encode(uint8_t *ptr, size_t len, size_t *encoded_len)

Encoded the TriangleListPrimitive as protobuf to the provided buffer.

On success, writes the serialized length to *encoded_len. If the provided buffer has insufficient capacity, writes the required capacity to *encoded_len and returns FoxgloveError::BufferTooShort. If the message cannot be encoded, writes the reason to stderr and returns FoxgloveError::EncodeError.

Parameters:
  • ptr – the destination buffer. must point to at least len valid bytes.

  • len – the length of the destination buffer.

  • encoded_len – where the serialized length or required capacity will be written to.

Public Members

std::optional<Pose> pose

Origin of triangles relative to reference frame.

std::vector<Point3> points

Vertices to use for triangles, interpreted as a list of triples (0-1-2, 3-4-5, …)

std::optional<Color> color

Solid color to use for the whole shape. One of color or colors must be provided.

std::vector<Color> colors

Per-vertex colors (if specified, must have the same length as points). One of color or colors must be provided.

std::vector<uint32_t> indices

Indices into the points and colors attribute arrays, which can be used to avoid duplicating attribute data.

If omitted or empty, indexing will not be used. This default behavior is equivalent to specifying [0, 1, …, N-1] for the indices (where N is the number of points provided).

Public Static Functions

static Schema schema()

Get the TriangleListPrimitive schema.

The schema data returned is statically allocated.