Skip to content

Commit

Permalink
fix: use THREE.MathUtils over deprec THREE.Math
Browse files Browse the repository at this point in the history
Rebuild aframe-physics-system
  • Loading branch information
hi-liang committed Aug 30, 2022
1 parent 683499f commit 14365c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/press-and-move.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ AFRAME.registerComponent('press-and-move', {
const xRotation = this.data.fly ? rotation.x : 0;

// Transform direction relative to heading.
rotationEuler.set(THREE.Math.degToRad(xRotation), THREE.Math.degToRad(rotation.y), 0);
rotationEuler.set(THREE.MathUtils.degToRad(xRotation), THREE.MathUtils.degToRad(rotation.y), 0);
directionVector.applyEuler(rotationEuler);
return directionVector;
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/vendor/aframe-physics-system.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/message-actions/create-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ export class CreateUpdate {
cameraSpinnerObj3D.quaternion.set(rotation.x, rotation.y, rotation.z, rotation.w);
} else { // otherwise its a rotation given in degrees
cameraSpinnerObj3D.rotation.set(
THREE.Math.degToRad(rotation.x),
THREE.Math.degToRad(rotation.y),
THREE.Math.degToRad(rotation.z),
THREE.MathUtils.degToRad(rotation.x),
THREE.MathUtils.degToRad(rotation.y),
THREE.MathUtils.degToRad(rotation.z),
);
}
}
Expand Down Expand Up @@ -365,7 +365,7 @@ export class CreateUpdate {
case 'rotation':
// rotation is set directly in the THREE.js object, for performance reasons
if (value.hasOwnProperty('w')) entityEl.object3D.quaternion.set(value.x, value.y, value.z, value.w); // has 'w' coordinate: a quaternion
else entityEl.object3D.rotation.set( THREE.Math.degToRad(value.x), THREE.Math.degToRad(value.y), THREE.Math.degToRad(value.z)); // otherwise its a rotation given in degrees
else entityEl.object3D.rotation.set( THREE.MathUtils.degToRad(value.x), THREE.MathUtils.degToRad(value.y), THREE.MathUtils.degToRad(value.z)); // otherwise its a rotation given in degrees
break;
case 'position':
// position is set directly in the THREE.js object, for performance reasons
Expand Down

0 comments on commit 14365c9

Please sign in to comment.