|
@@ -885,20 +885,11 @@ export class ArcRotateCamera extends TargetCamera {
|
|
|
|
|
|
// Panning inertia
|
|
// Panning inertia
|
|
if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) {
|
|
if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) {
|
|
- this._viewMatrix.invertToRef(this._cameraTransformMatrix);
|
|
|
|
- this._transformedDirection.set(this._cameraTransformMatrix.m[0], this._cameraTransformMatrix.m[1], this._cameraTransformMatrix.m[2]);
|
|
|
|
-
|
|
|
|
- // panning on X Axis
|
|
|
|
- this._transformedDirection.x *= this.panningAxis.x * this.inertialPanningX;
|
|
|
|
- this._transformedDirection.y *= this.panningAxis.x * this.inertialPanningX;
|
|
|
|
- this._transformedDirection.z *= this.panningAxis.x * this.inertialPanningX;
|
|
|
|
|
|
+ let localDirection = new Vector3(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY);
|
|
|
|
|
|
- // panning on Y axis
|
|
|
|
- this._transformedDirection.y += this.panningAxis.y * this.inertialPanningY;
|
|
|
|
-
|
|
|
|
- // panning on Z axis
|
|
|
|
- this._transformedDirection.x -= Math.cos(this.alpha) * this.panningAxis.z * this.inertialPanningY;
|
|
|
|
- this._transformedDirection.z -= Math.sin(this.alpha) * this.panningAxis.z * this.inertialPanningY;
|
|
|
|
|
|
+ this._viewMatrix.invertToRef(this._cameraTransformMatrix);
|
|
|
|
+ localDirection.multiplyInPlace(this.panningAxis);
|
|
|
|
+ Vector3.TransformNormalToRef(localDirection, this._cameraTransformMatrix, this._transformedDirection);
|
|
|
|
|
|
if (!this._targetHost) {
|
|
if (!this._targetHost) {
|
|
if (this.panningDistanceLimit) {
|
|
if (this.panningDistanceLimit) {
|