1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02:00

Sound refactor and improvements (#12764)

This commit is contained in:
DS
2023-06-16 20:15:21 +02:00
committed by GitHub
parent 8e1af25738
commit edcbfa31c9
52 changed files with 2802 additions and 1211 deletions

View File

@@ -1179,11 +1179,12 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
v3s16 node_below_pos = floatToInt(foot_pos + v3f(0.0f, -0.5f, 0.0f),
1.0f);
MapNode n = m_env->getMap().getNode(node_below_pos);
SimpleSoundSpec spec = ndef->get(n).sound_footstep;
SoundSpec spec = ndef->get(n).sound_footstep;
// Reduce footstep gain, as non-local-player footsteps are
// somehow louder.
spec.gain *= 0.6f;
m_client->sound()->playSoundAt(spec, foot_pos * BS);
// The footstep-sound doesn't travel with the object. => vel=0
m_client->sound()->playSoundAt(0, spec, foot_pos, v3f(0.0f));
}
}
}