|
Unravel Engine C++ Reference
|
GPU-friendly vertex data for instancing. More...
#include <batch_instance.h>
Public Member Functions | |
| instance_vertex_data ()=default | |
| Default constructor. | |
| instance_vertex_data (const batch_instance &instance) | |
| Constructor from batch instance. | |
| void | set_lod_param (float lod_param) |
| Set the LOD parameter (stored in matrix[3][3]) | |
| auto | get_lod_param () const -> float |
| Get the LOD parameter (from matrix[3][3]) | |
| auto | is_valid () const -> bool |
| Check if the vertex data is valid. | |
| auto | to_string () const -> std::string |
| Get string representation for debugging. | |
Static Public Member Functions | |
| static auto | packed_size () -> size_t |
Public Attributes | |
| math::mat4 | world_matrix |
| World transformation matrix with LOD parameter packed in [3][3] (i_data0, i_data1, i_data2, i_data3) | |
GPU-friendly vertex data for instancing.
This structure matches the shader input layout and packs the instance data into a single 4x4 matrix for efficient copying. The LOD parameter is packed into the matrix[3][3] position (which is normally 1.0 for homogeneous coordinates). The matrix will be interpreted as 4 vec4 attributes (i_data0 through i_data3) by the shader.
Definition at line 66 of file batch_instance.h.
|
default |
Default constructor.
|
explicit |
Constructor from batch instance.
| instance | The batch instance to convert |
Definition at line 53 of file batch_instance.cpp.
| auto unravel::instance_vertex_data::get_lod_param | ( | ) | const -> float |
Get the LOD parameter (from matrix[3][3])
Definition at line 65 of file batch_instance.cpp.
| auto unravel::instance_vertex_data::is_valid | ( | ) | const -> bool |
Check if the vertex data is valid.
Definition at line 70 of file batch_instance.cpp.
|
inlinestatic |
Definition at line 68 of file batch_instance.h.
| void unravel::instance_vertex_data::set_lod_param | ( | float | lod_param | ) |
Set the LOD parameter (stored in matrix[3][3])
| lod_param | LOD parameter value |
Definition at line 60 of file batch_instance.cpp.
| auto unravel::instance_vertex_data::to_string | ( | ) | const -> std::string |
Get string representation for debugging.
Definition at line 87 of file batch_instance.cpp.
| math::mat4 unravel::instance_vertex_data::world_matrix |
World transformation matrix with LOD parameter packed in [3][3] (i_data0, i_data1, i_data2, i_data3)
Definition at line 73 of file batch_instance.h.