|
Unravel Engine C++ Reference
|
A group of instances that can be rendered together. More...
#include <batch_collector.h>
Public Member Functions | |
| batch_group ()=default | |
| Default constructor. | |
| batch_group (const batch_key &key) | |
| Constructor with key. | |
| void | add_instance (const batch_instance &instance) |
| Add an instance to this batch. | |
| void | calculate_camera_distance (const math::vec3 &camera_pos) |
| Calculate distance from camera for sorting. | |
| auto | is_valid () const -> bool |
| Check if this batch is valid for rendering. | |
| auto | get_gpu_memory_size () const -> size_t |
| Get memory size required for GPU data. | |
Public Attributes | |
| batch_key | key |
| Key identifying this batch (mesh, material, LOD, submesh) | |
| batch_instance_collection | instances |
| Collection of instances in this batch. | |
| float | camera_distance = 0.0f |
| Distance from camera (for sorting) | |
| bool | is_split_batch = false |
| Whether this batch was split from a larger one. | |
A group of instances that can be rendered together.
Definition at line 88 of file batch_collector.h.
|
default |
Default constructor.
|
explicit |
Constructor with key.
| key | Batch key for this group |
Definition at line 66 of file batch_collector.cpp.
| void unravel::batch_group::add_instance | ( | const batch_instance & | instance | ) |
Add an instance to this batch.
| instance | Instance to add |
Definition at line 71 of file batch_collector.cpp.
| void unravel::batch_group::calculate_camera_distance | ( | const math::vec3 & | camera_pos | ) |
Calculate distance from camera for sorting.
| camera_pos | Camera position |
Definition at line 76 of file batch_collector.cpp.
| auto unravel::batch_group::get_gpu_memory_size | ( | ) | const -> size_t |
Get memory size required for GPU data.
Definition at line 111 of file batch_collector.cpp.
| auto unravel::batch_group::is_valid | ( | ) | const -> bool |
Check if this batch is valid for rendering.
Definition at line 106 of file batch_collector.cpp.
| float unravel::batch_group::camera_distance = 0.0f |
Distance from camera (for sorting)
Definition at line 97 of file batch_collector.h.
| batch_instance_collection unravel::batch_group::instances |
Collection of instances in this batch.
Definition at line 94 of file batch_collector.h.
| bool unravel::batch_group::is_split_batch = false |
Whether this batch was split from a larger one.
Definition at line 100 of file batch_collector.h.
| batch_key unravel::batch_group::key |
Key identifying this batch (mesh, material, LOD, submesh)
Definition at line 91 of file batch_collector.h.