mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-09 14:23:51 +00:00
docs: add why-comments to rendering, packets, and UI code
- charge_effect: explain inversesqrt guard (prevents NaN on stationary character) and dust accumulator rate (30 particles/sec * 16ms) - swim_effects: explain why insect pipeline disables depth test (screen-space sprites must render above water geometry) - packet_parsers_classic: explain spline waypoint cap (DoS prevention) and packed GUID compression format (non-zero bytes only, mask byte) - talent_screen: explain class ID to bitmask conversion (1-indexed WoW class IDs → power-of-2 mask for TalentTab.classMask matching) - auth_screen: explain login music volume reduction (80% so UI sounds remain audible over background track)
This commit is contained in:
parent
e8a4a7402f
commit
92369c1cec
5 changed files with 14 additions and 3 deletions
|
|
@ -474,11 +474,13 @@ void ChargeEffect::emit(const glm::vec3& position, const glm::vec3& direction) {
|
|||
// Spawn dust puffs at feet
|
||||
glm::vec3 horizDir = glm::vec3(direction.x, direction.y, 0.0f);
|
||||
float horizLenSq = glm::dot(horizDir, horizDir);
|
||||
// Skip dust when character is nearly stationary — prevents NaN from inversesqrt(0)
|
||||
if (horizLenSq < 1e-6f) return;
|
||||
float invHorizLen = glm::inversesqrt(horizLenSq);
|
||||
glm::vec3 backDir = -horizDir * invHorizLen;
|
||||
glm::vec3 sideDir = glm::vec3(-backDir.y, backDir.x, 0.0f);
|
||||
|
||||
// Accumulate ~0.48 per frame at 60fps (30 particles/sec * 16ms); emit when >= 1.0
|
||||
dustAccum_ += 30.0f * 0.016f;
|
||||
while (dustAccum_ >= 1.0f && dustPuffs_.size() < MAX_DUST) {
|
||||
dustAccum_ -= 1.0f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue