|
514 | 514 | panningModel: typeof o.panningModel !== 'undefined' ? o.panningModel : pa.panningModel
|
515 | 515 | };
|
516 | 516 |
|
517 |
| - // Update the panner values or create a new panner if none exists. |
| 517 | + // Create a new panner node if one doesn't already exist. |
518 | 518 | var panner = sound._panner;
|
519 |
| - if (panner) { |
520 |
| - panner.coneInnerAngle = pa.coneInnerAngle; |
521 |
| - panner.coneOuterAngle = pa.coneOuterAngle; |
522 |
| - panner.coneOuterGain = pa.coneOuterGain; |
523 |
| - panner.distanceModel = pa.distanceModel; |
524 |
| - panner.maxDistance = pa.maxDistance; |
525 |
| - panner.refDistance = pa.refDistance; |
526 |
| - panner.rolloffFactor = pa.rolloffFactor; |
527 |
| - panner.panningModel = pa.panningModel; |
528 |
| - } else { |
| 519 | + if (!panner) { |
529 | 520 | // Make sure we have a position to setup the node with.
|
530 | 521 | if (!sound._pos) {
|
531 | 522 | sound._pos = self._pos || [0, 0, -0.5];
|
532 | 523 | }
|
533 | 524 |
|
534 | 525 | // Create a new panner node.
|
535 | 526 | setupPanner(sound, 'spatial');
|
| 527 | + panner = sound._panner |
536 | 528 | }
|
| 529 | + |
| 530 | + // Update the panner values or create a new panner if none exists. |
| 531 | + panner.coneInnerAngle = pa.coneInnerAngle; |
| 532 | + panner.coneOuterAngle = pa.coneOuterAngle; |
| 533 | + panner.coneOuterGain = pa.coneOuterGain; |
| 534 | + panner.distanceModel = pa.distanceModel; |
| 535 | + panner.maxDistance = pa.maxDistance; |
| 536 | + panner.refDistance = pa.refDistance; |
| 537 | + panner.rolloffFactor = pa.rolloffFactor; |
| 538 | + panner.panningModel = pa.panningModel; |
537 | 539 | }
|
538 | 540 | }
|
539 | 541 |
|
|
0 commit comments