-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpanner.js
37 lines (32 loc) · 1.11 KB
/
panner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from "react";
import RConnectableNode from "./../base/connectable-node.js";
export default class RPanner extends RConnectableNode {
constructor(props) {
super(props);
this.params = {
panningModel: this.props.panningModel,
distanceModel: this.props.distanceModel,
refDistance: this.props.refDistance,
maxDistance: this.props.maxDistance,
rolloffFactor: this.props.rolloffFactor,
coneInnerAngle: this.props.coneInnerAngle,
coneOuterAngle: this.props.coneOuterAngle,
coneOuterGain: this.props.coneOuterGain,
positionX: this.props.positionX,
positionY: this.props.positionY,
positionZ: this.props.positionZ,
orientationX: this.props.orientationX,
orientationY: this.props.orientationY,
orientationZ: this.props.orientationZ,
};
}
componentWillMount() {
super.componentWillMount();
if (!this.node) {
this.node = this.context.audio.createPanner();
this.context.nodes.set(this.props.identifier, this.node);
}
this.updateParams = this.updateParams.bind(this);
this.updateParams(this.props);
}
}