|
VisuTwin Canvas
C++ 3D Engine — Metal Backend
|
Renderable instance of a Mesh with its own material, transform node, and optional GPU instancing. More...
#include <scene/meshInstance.h>
Classes | |
| struct | InstancingData |
Public Member Functions | |
| BoundingBox | aabb () |
| int | batchGroupId () const |
| bool | castShadow () const |
| bool | cull () const |
| int | instancingCount () const |
| const InstancingData & | instancingData () const |
| bool | isDynamicBatch () const |
| uint32_t | mask () const |
| Material * | material () const |
| Mesh * | mesh () const |
| MeshInstance (Mesh *mesh, Material *material, GraphNode *node=nullptr) | |
| GraphNode * | node () const |
| bool | receiveShadow () const |
| void | setBatchGroupId (int id) |
| void | setCastShadow (const bool value) |
| void | setCull (const bool value) |
| void | setCustomAabb (const BoundingBox &aabb) |
| void | setDynamicBatch (bool v) |
| void | setIndirectInstancing (const std::shared_ptr< VertexBuffer > &compactedVB, void *indirectArgs, int slot=0) |
| void | setInstancing (const std::shared_ptr< VertexBuffer > &vertexBuffer, int count) |
| void | setMask (const uint32_t value) |
| void | setReceiveShadow (const bool value) |
| void | setSkinBatchInstance (SkinBatchInstance *sbi) |
| void | setVisible (bool v) |
| void | setVisibleThisFrame (const bool value) |
| SkinBatchInstance * | skinBatchInstance () const |
| bool | visible () const |
| bool | visibleThisFrame () const |
Renderable instance of a Mesh with its own material, transform node, and optional GPU instancing.
A single Mesh can be referenced by many MeshInstance objects, each with a different material and transform (GraphNode). Hardware instancing and GPU-driven indirect rendering are supported for drawing many copies with a single draw call.
Definition at line 30 of file meshInstance.h.
| visutwin::canvas::MeshInstance::MeshInstance | ( | Mesh * | mesh, |
| Material * | material, | ||
| GraphNode * | node = nullptr ) |
Definition at line 12 of file meshInstance.cpp.
References material(), mesh(), and node().
| BoundingBox visutwin::canvas::MeshInstance::aabb | ( | ) |
Definition at line 17 of file meshInstance.cpp.
References visutwin::canvas::BoundingBox::setCenter(), and visutwin::canvas::BoundingBox::setHalfExtents().
Referenced by setCustomAabb(), and visutwin::canvas::shouldRenderShadowMeshInstance().
|
inline |
Definition at line 106 of file meshInstance.h.
|
inline |
Definition at line 62 of file meshInstance.h.
Referenced by visutwin::canvas::shouldRenderShadowMeshInstance().
|
inline |
Definition at line 70 of file meshInstance.h.
Referenced by visutwin::canvas::shouldRenderShadowMeshInstance().
|
inline |
Definition at line 102 of file meshInstance.h.
|
inline |
Definition at line 101 of file meshInstance.h.
|
inline |
True when this mesh instance is part of a dynamic batch (triggers VT_FEATURE_DYNAMIC_BATCH).
Definition at line 120 of file meshInstance.h.
|
inline |
Definition at line 76 of file meshInstance.h.
|
inline |
Definition at line 58 of file meshInstance.h.
Referenced by MeshInstance(), and visutwin::canvas::shouldRenderShadowMeshInstance().
|
inline |
Definition at line 56 of file meshInstance.h.
Referenced by MeshInstance(), and visutwin::canvas::shouldRenderShadowMeshInstance().
|
inline |
Definition at line 60 of file meshInstance.h.
Referenced by MeshInstance(), and visutwin::canvas::shouldRenderShadowMeshInstance().
|
inline |
Definition at line 67 of file meshInstance.h.
|
inline |
Definition at line 107 of file meshInstance.h.
|
inline |
Definition at line 63 of file meshInstance.h.
|
inline |
Definition at line 71 of file meshInstance.h.
|
inline |
Override the computed AABB with a custom value (used by dynamic batch AABB updates).
Definition at line 124 of file meshInstance.h.
References aabb().
|
inline |
Definition at line 121 of file meshInstance.h.
|
inline |
Definition at line 92 of file meshInstance.h.
|
inline |
Definition at line 82 of file meshInstance.h.
|
inline |
Definition at line 77 of file meshInstance.h.
|
inline |
Definition at line 68 of file meshInstance.h.
|
inline |
Definition at line 117 of file meshInstance.h.
|
inline |
Definition at line 111 of file meshInstance.h.
|
inline |
Definition at line 74 of file meshInstance.h.
|
inline |
SkinBatchInstance pointer for dynamic batches (non-owning, owned by Batch).
Definition at line 116 of file meshInstance.h.
|
inline |
When false, the mesh instance is hidden (merged into a batch).
Definition at line 110 of file meshInstance.h.
|
inline |
Definition at line 73 of file meshInstance.h.