|
Unravel Engine C++ Reference
|
Collection of batch instances with utilities. More...
#include <batch_instance.h>
Public Types | |
| using | container_type = std::vector<batch_instance> |
| using | iterator = container_type::iterator |
| using | const_iterator = container_type::const_iterator |
Public Member Functions | |
| batch_instance_collection ()=default | |
| Default constructor. | |
| void | reserve (size_t count) |
| Reserve space for instances. | |
| void | add_instance (const batch_instance &instance) |
| Add an instance to the collection. | |
| void | add_instance (const math::mat4 &world_transform) |
| Add an instance with just world transform. | |
| void | clear () |
| Clear all instances. | |
| auto | size () const -> size_t |
| Get number of instances. | |
| auto | empty () const -> bool |
| Check if collection is empty. | |
| auto | operator[] (size_t index) -> batch_instance & |
| Get instance by index. | |
| auto | operator[] (size_t index) const -> const batch_instance & |
| Get instance by index (const) | |
| auto | begin () -> iterator |
| Get iterator to beginning. | |
| auto | end () -> iterator |
| Get iterator to end. | |
| auto | begin () const -> const_iterator |
| Get const iterator to beginning. | |
| auto | end () const -> const_iterator |
| Get const iterator to end. | |
| auto | to_vertex_data () const -> std::vector< instance_vertex_data > |
| Convert all instances to GPU vertex data. | |
| auto | get_gpu_memory_size () const -> size_t |
| Get memory size required for GPU data. | |
Collection of batch instances with utilities.
Provides convenient methods for managing collections of instances and converting them to GPU-friendly format.
Definition at line 117 of file batch_instance.h.
| using unravel::batch_instance_collection::const_iterator = container_type::const_iterator |
Definition at line 122 of file batch_instance.h.
| using unravel::batch_instance_collection::container_type = std::vector<batch_instance> |
Definition at line 120 of file batch_instance.h.
| using unravel::batch_instance_collection::iterator = container_type::iterator |
Definition at line 121 of file batch_instance.h.
|
default |
Default constructor.
| void unravel::batch_instance_collection::add_instance | ( | const batch_instance & | instance | ) |
Add an instance to the collection.
| instance | Instance to add |
Definition at line 112 of file batch_instance.cpp.
| void unravel::batch_instance_collection::add_instance | ( | const math::mat4 & | world_transform | ) |
Add an instance with just world transform.
| world_transform | World transformation matrix |
Definition at line 117 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::begin | ( | ) | -> iterator |
Get iterator to beginning.
Definition at line 147 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::begin | ( | ) | const -> const_iterator |
Get const iterator to beginning.
Definition at line 157 of file batch_instance.cpp.
| void unravel::batch_instance_collection::clear | ( | ) |
Clear all instances.
Definition at line 122 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::empty | ( | ) | const -> bool |
Check if collection is empty.
Definition at line 132 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::end | ( | ) | -> iterator |
Get iterator to end.
Definition at line 152 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::end | ( | ) | const -> const_iterator |
Get const iterator to end.
Definition at line 162 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::get_gpu_memory_size | ( | ) | const -> size_t |
Get memory size required for GPU data.
Definition at line 180 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::operator[] | ( | size_t | index | ) | -> batch_instance& |
Get instance by index.
| index | Index of the instance |
Definition at line 137 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::operator[] | ( | size_t | index | ) | const -> const batch_instance& |
Get instance by index (const)
| index | Index of the instance |
Definition at line 142 of file batch_instance.cpp.
| void unravel::batch_instance_collection::reserve | ( | size_t | count | ) |
Reserve space for instances.
| count | Number of instances to reserve space for |
Definition at line 107 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::size | ( | ) | const -> size_t |
Get number of instances.
Definition at line 127 of file batch_instance.cpp.
| auto unravel::batch_instance_collection::to_vertex_data | ( | ) | const -> std::vector<instance_vertex_data> |
Convert all instances to GPU vertex data.
Definition at line 167 of file batch_instance.cpp.