Yey! :lol:
I guess the OpenAL documentation is badly written
Yes, I found out testing, not by the docs... if you see above I quoted a code example because no text from the theory was specific enough.
In the tutorial I'm talking about a 2D world viewed from top, like a RTS or RPG game
I thought of that after my rant :oops:
I was thinking a more super mario bros like.
(X, Y) then you have to call SetTarget(1, 0, 0).
Nope, this would get me +Z as right and -Z as left.
As Y is always facing up (+Y
is OpenAL's "up"), and we are facing -X (OpenAL's "at")... then the plane that it's defined is XY... so right or left would be defined by the Z value.
(check yourself with the Right Hand Rule)
Nobody told you to do so
I know, but maybe a more pixel-friendly value would be best for new users of the library (as you said, nobody really goes in depth with this... I assume because of it's difficulty to get it working).
Nevertheless consider adding a
SetDefaultAttenuation/MinDistance as a sf::Sound static function. It could be
convenient to centralize initialization of this parameters in a couple of lines, instead of having to add a wrapper to load sounds.
Who will really need to change the distance model?
I don't have a real reason, no.
Maybe if you're developing not a game but an application (Simple Fast
Media Library), like a music player or whatever, it would work as an audio balance.
To me it's ok to have the up vector hard-coded, this is like a physical constant (just like gravity for example).
In 3D, gives you the hability to roll your head (e.g. Peeking from a corner of a wall).
In 2D gives you freedom to define which sound-coordinate axis is associated with a screen-coordinate counterpart. I like using x for x and y for y, it's more confortable to work this way.
Also to let you "reverse" the speakers (Up = -Up), for configuration and also could be used for a weird powerup effect.
What you're trying to do is forwarding the OpenAL programming interface to SFML... it's goal is just to be simple and fast.
Yeah, you're right. I also understand your point of view. Keeping it minimalistic is really a cool feature.
I really appreciate your feedback, don't hesitate to defend your point of view
Thanks, I can be a real pain in the ass :lol:
I came to this conclusion:If you have a up vector +Y, and at(target) vector -Z... it leaves +X=right and -X=left.
The target vector is actually "depthness", which is played (or should be) as "further inside the monitor" (which we'll probably never use)
Y is Up, so if you wan't something making a falling sound, this is your axis.
And that's the same as a plataformer! You really want things falling (Y screen axis) to be represented like the're coming from "up" (Y sound axis). Actually it's opposite sign.
How it's now it's actually correct!
(But we can't test this without a quadraphonic system.)
So with all this whining I've been about, I wasn't even correct.
:oops:
I don't understand your second graphical example
The only point left is the "sound going thru the listener's head" that mutes one speaker or the other.
It happens if a sound position relays in the axis orthogonal to target and up. It's not heard from both speakers, not even near the listener's position...
That's what the second graphic is about. But actually it makes no sense, don't try to figure it out.
I don't know if it's the way OpenAL handles distances for left and right speakers or what it is.
I think it has to do with the fact that there is no real life situation in which a sound passes thru your skull.
So my solution was to move away the listener from the "monitor".
Ok... I'm really over the edge... I'll go to sleep now.
Good luck
-Martín