Ring-buffer pool of 512 world-space decal quads (bullet holes, scorch marks).
More...
#include <BulletHoleDecal.hpp>
|
| void | spawn (glm::vec3 pos, glm::vec3 normal, WeaponType wt) |
| | Place a new decal at pos oriented by normal.
|
| void | update (float dt) |
| | Fade all active decals over time.
|
| const DecalInstance * | data () const |
| uint32_t | count () const |
|
| static constexpr uint32_t | k_max = 512 |
Ring-buffer pool of 512 world-space decal quads (bullet holes, scorch marks).
Oldest decal is overwritten when the pool is full. All 512 slots are uploaded to the GPU every frame (24 KB – cheap) so there is no kill/compact logic.
◆ count()
| uint32_t BulletHoleDecal::count |
( |
| ) |
const |
|
inlinenodiscard |
◆ data()
◆ spawn()
| void BulletHoleDecal::spawn |
( |
glm::vec3 | pos, |
|
|
glm::vec3 | normal, |
|
|
WeaponType | wt ) |
Place a new decal at pos oriented by normal.
- Parameters
-
| pos | World-space decal center. |
| normal | Surface normal for decal orientation. |
| wt | Weapon type controlling decal size. |
◆ update()
| void BulletHoleDecal::update |
( |
float | dt | ) |
|
Fade all active decals over time.
- Parameters
-
| dt | Frame delta time in seconds. |
◆ head_
| uint32_t BulletHoleDecal::head_ = 0 |
|
private |
Ring-buffer insertion pointer.
◆ k_max
| uint32_t BulletHoleDecal::k_max = 512 |
|
staticconstexprprivate |
◆ slots_
The documentation for this class was generated from the following files: