Skip to content

Commit

Permalink
Compatible with Three R123
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh committed Jun 11, 2024
1 parent 623c39e commit 21314e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/interactivemarkers/InteractiveMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ ROS3D.InteractiveMarker.prototype.rotateAxis = function(control, origOrientation

// rotates from world to plane coords
var orientationWorld = this.dragStart.orientationWorld.clone().multiply(orientation);
var orientationWorldInv = orientationWorld.clone().inverse();
var orientationWorldInv = orientationWorld.clone().invert();

// rotate original and current intersection into local coords
intersection.sub(rotOrigin);
Expand Down
6 changes: 3 additions & 3 deletions src/interactivemarkers/InteractiveMarkerControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ ROS3D.InteractiveMarkerControl = function(options) {
var posInv = this.parent.position.clone().multiplyScalar(-1);
switch (message.orientation_mode) {
case ROS3D.INTERACTIVE_MARKER_INHERIT:
rotInv = this.parent.quaternion.clone().inverse();
rotInv = this.parent.quaternion.clone().invert();
break;
case ROS3D.INTERACTIVE_MARKER_FIXED:
break;
Expand Down Expand Up @@ -231,7 +231,7 @@ ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld = function (force) {
that.currentControlOri.normalize();
break;
case ROS3D.INTERACTIVE_MARKER_FIXED:
that.quaternion.copy(that.parent.quaternion.clone().inverse());
that.quaternion.copy(that.parent.quaternion.clone().invert());
that.updateMatrix();
that.matrixWorldNeedsUpdate = true;
ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(that, force);
Expand All @@ -247,7 +247,7 @@ ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld = function (force) {
ros2Gl.makeRotationFromEuler(rv);

var worldToLocal = new THREE.Matrix4();
worldToLocal.getInverse(that.parent.matrixWorld);
worldToLocal.copy(that.parent.matrixWorld).invert();

cameraRot.multiplyMatrices(cameraRot, ros2Gl);
cameraRot.multiplyMatrices(worldToLocal, cameraRot);
Expand Down

0 comments on commit 21314e9

Please sign in to comment.