Fix mount dust visibility: spawn above ground with stronger upward velocity

Fixes issue where dust particles were angling down into terrain and not visible.
Changes spawn position to fixed 0.2 units above ground, increases upward velocity
to 1.2-2.5 for clearer rise, and uses only horizontal velocity component for drift
to prevent Z component from pushing particles downward.
This commit is contained in:
Kelsi 2026-02-09 01:32:40 -08:00
parent eb288d2064
commit 42821604d3

View file

@ -121,19 +121,21 @@ void MountDust::spawnDust(const glm::vec3& position, const glm::vec3& velocity,
spawnAccum -= 1.0f;
Particle p;
// Spawn slightly behind and to the sides of the mount
// Spawn slightly behind and to the sides of the mount, at ground level
p.position = position + glm::vec3(
randFloat(-0.3f, 0.3f),
randFloat(-0.3f, 0.3f),
randFloat(-0.1f, 0.1f)
0.2f // Spawn slightly above ground to ensure visibility
);
// Dust rises up and drifts backward slightly
// Dust rises up and spreads outward
// Only use horizontal velocity for drift, ignore vertical component
glm::vec3 horizontalVel = glm::vec3(velocity.x, velocity.y, 0.0f);
p.velocity = glm::vec3(
randFloat(-0.2f, 0.2f),
randFloat(-0.2f, 0.2f),
randFloat(0.5f, 1.2f) // Rise upward
) - velocity * 0.2f; // Drift backward relative to movement
randFloat(-0.3f, 0.3f), // Random horizontal spread
randFloat(-0.3f, 0.3f),
randFloat(1.2f, 2.5f) // Strong upward movement for visibility
) - horizontalVel * 0.15f; // Drift backward slightly based on horizontal movement only
p.lifetime = 0.0f;
p.maxLifetime = randFloat(0.4f, 0.8f);