With this patch, entities can serve as a sound source whose position
updates relative to the listener. This implements the last missing
feature of my previous positional audio patch, which is moving sound sources.
Previously, all sounds were relative to the listener with the listener
centered at (0, 0, 0), and once a sound started playing, the position could
not be changed. Volume was set as an estimation of the distance to the listener.
These restrictions are now gone; OpenAL will handle the volume & panning
based on the distance.
The remaining problem is that stereo sounds are not attenuated, at all.
Lua additions:
- playSfx() takes an additional parameter now.
- entity_setStopSoundsOnDeath()
This changes all typical vector interpolation functions that get
value, time, loopType, pingPong, ease as args from the Lua state;
use unified functions for all value type occurances.
This fixes the slightly annoying problem that it was not possible to
pass a boolean true to pingPong or ease, because lua_tonumber() would
always return 0 in that case.
Also changed:
- obj_getWorldPosition() now takes optional x,y-vector
New:
- obj_getWorldPositionAndRotation() is a more efficient shortcut,
as often both position and rotation are retrieved together,
and the underlying matrix chain operation is rather expensive.
- entity_getEmitter()
- entity_getNumEmitters()
- setSceneColor2()
- getSceneColor2()
This means there are no longer two builds necessary (one normal,
one dev), and all mod deveopment can be done using one build,
by setting
Demo builds now allow browsing the online mod list, but neither
downloading nor starting mods or applying patches.
The fix as suggested by Jonas Kulla on the mailing list is also in.
There hasn't been any extensive testing, and it may not yet compile
on platforms other than win32.
- quad_setRepeatTexture()
- quad_setRepeatScale()
- quad_isRepeatTexture()
(bone, entity, ... as well)
- getOldDT() - return unmodified dt
- getDT() - as passed to update(), for complicated edge cases
where dt is unavailable but required.
This allows to e.g. prevent ACTION_TOGGLEHELPSCREEN from being handled by
the game, and instead use a node's catch action functionality to handle the event.
Add related Lua functions:
- setIgnoreAction()
- isIgnoreAction()
- sendAction()
Respecting maxspeed lerp is not a good idea, there are nodes that set this
(normalpass, energypass, just to name two).
This causes way too fast swimming while the maxspeed lerp is > 1.