提交 bdd753eb 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #9845 from plan8/listener-audioparam-attributes

AudioListener: use AudioParam attributes if supported.
......@@ -101,8 +101,25 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), {
orientation.set( 0, 0, - 1 ).applyQuaternion( quaternion );
listener.setPosition( position.x, position.y, position.z );
listener.setOrientation( orientation.x, orientation.y, orientation.z, up.x, up.y, up.z );
if ( listener.positionX ) {
listener.positionX.setValueAtTime( position.x, this.context.currentTime );
listener.positionY.setValueAtTime( position.y, this.context.currentTime );
listener.positionZ.setValueAtTime( position.z, this.context.currentTime );
listener.forwardX.setValueAtTime( orientation.x, this.context.currentTime );
listener.forwardY.setValueAtTime( orientation.y, this.context.currentTime );
listener.forwardZ.setValueAtTime( orientation.z, this.context.currentTime );
listener.upX.setValueAtTime( up.x, this.context.currentTime );
listener.upY.setValueAtTime( up.y, this.context.currentTime );
listener.upZ.setValueAtTime( up.z, this.context.currentTime );
}
else {
listener.setPosition( position.x, position.y, position.z );
listener.setOrientation( orientation.x, orientation.y, orientation.z, up.x, up.y, up.z );
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册