Re: undefined directions in AudioListener and PannerNode setOrientation()

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.

Rob
-- 
Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w  *
*

Received on Monday, 26 August 2013 02:28:21 UTC