Re: undefined directions in AudioListener and PannerNode setOrientation()

On Sun, Aug 25, 2013 at 10:27 PM, Robert O'Callahan <robert@ocallahan.org>wrote:

> On Mon, Aug 26, 2013 at 11:37 AM, Karl Tomlinson <
> karlt+public-audio@karlt.net> wrote
>
>> Would it make sense to have setOrientation() throw an exception if
>> any the vectors are zero or otherwise linearly dependent?
>>
>> It is not possible to determine appropriate panning parameters in
>> these situations, and the azimuth and elevation from the
>> calculation in [1] become undefined because an attempt is made to
>> normalize a zero vector.
>>
>> If the orientation is not known, then I think it would be better
>> to retain the previous orientation than to suddenly change to some
>> default orientation.  Throwing an exception seems the appropriate
>> way to indicate that a setter method was not successful in
>> changing anything.
>>
>
>
> With 2D canvas we decided it was better to not throw for singularities
> because you don't want to break the application when it's doing some
> animation that passes through a singularity. I think the same logic applies
> here. So I suggest just silently ignoring the setOrientation call.
>

That makes sense to me.

--
Ehsan
<http://ehsanakhgari.org/>

Received on Wednesday, 28 August 2013 16:37:10 UTC