1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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));
}
}
}