away3d/away3d-core-fp11 — Issue #227: Away3D 4.0 ::: Sound3D ::: Update()
Author: redefy
Created: 2012-02-25 15:47:38+00:00
State: open

Why create additional Matrix3D object in the class Sound3D (_inv_ref_mtx = new Matrix3D;) ?

You can do without it...
Instead Of

public function update():void {
_inv_ref_mtx.rawData = _reference.sceneTransform.rawData;
_inv_ref_mtx.invert();
_refv = _inv_ref_mtx.deltaTransformVector(_reference.position);
_refv = this.scenePosition.subtract(_refv);
_driver.updateReferenceVector(_refv);
}

public function update():void {
_refv = this.scenePosition.subtract(_reference.inverseSceneTransform.deltaTransformVector(_reference.position));
_driver.updateReferenceVector(_refv);
}