12 case PrimitiveTopology::LINE_LIST:
13 case PrimitiveTopology::LINE_STRIP:
15 case PrimitiveTopology::TRIANGLE_LIST:
16 case PrimitiveTopology::TRIANGLE_STRIP:
17 case PrimitiveTopology::TRIANGLE_FAN:
19 case PrimitiveTopology::POINT_LIST:
30 m_items.reserve(initial_capacity);
34 layout.vertex_count = 0;
42 , m_items(
std::move(vertices))
47 layout.vertex_count =
static_cast<uint32_t
>(
m_items.size());
62 m_items.reserve(positions.size());
63 for (
const auto& p : positions) {
81 "GeometryLeafNode: vertex index {} out of range (count: {})",
index,
m_items.size());
110 set_vertices<Vertex>(std::span {
m_items.data(),
m_items.size() });
113 layout.vertex_count =
static_cast<uint32_t
>(
m_items.size());
#define MF_WARN(comp, ctx,...)
std::vector< Vertex > m_items
void set_geometry(std::vector< Vertex > vertices)
Replace geometry with fully specified vertices.
void compute_frame() override
No-op unless a mutator has run since the last call, so AssemblyOperator::process() calling this on ev...
GeometryLeafNode(size_t initial_capacity=64)
void update_vertex(size_t index, const Vertex &vertex)
void set_positions(std::vector< glm::vec3 > positions)
Replace geometry with plain positions (color/scalar/normal/uv default).
One independent, arbitrary-topology geometry item.
uint32_t get_vertex_count() const
Get number of vertices.
virtual Portal::Graphics::PrimitiveTopology get_primitive_topology() const
Primitive topology this node's vertex data represents.
void set_vertex_layout(const Kakshya::VertexLayout &layout)
Set cached vertex layout.
void resize_vertex_buffer(uint32_t vertex_count, bool preserve_data=false)
Resize vertex buffer to hold specified number of vertices.
void set_vertex_stride(size_t stride)
Set vertex stride (bytes per vertex)
Base class for nodes that generate 3D geometry data.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
PrimitiveTopology
Vertex assembly primitive topology.
static VertexLayout for_lines(uint32_t stride=60)
Factory: layout for LineVertex (position, color, thickness, uv, normal, tangent)
static VertexLayout for_meshes(uint32_t stride=60)
Factory: layout for MeshVertex (position, color, weight, uv, normal, tangent)
static VertexLayout for_points(uint32_t stride=60)
Factory: layout for PointVertex (position, color, size, uv, normal, tangent)
Type-neutral vertex carrying the universal 60-byte attribute layout.