Skip to content

Commit

Permalink
Fixed issue with ray being in front of plane (#7073)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpal81xd authored Oct 28, 2024
1 parent b4a76c9 commit 7dbbe31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/extras/gizmo/transform-gizmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,10 @@ class TransformGizmo extends Gizmo {
tmpR1.direction.sub2(mouseWPos, tmpR1.origin).normalize();
return tmpR1;
}
return tmpR1.set(mouseWPos, this._camera.entity.forward);
const orthoDepth = this._camera.farClip - this._camera.nearClip;
tmpR1.origin.sub2(mouseWPos, tmpV1.copy(this._camera.entity.forward).mulScalar(orthoDepth));
tmpR1.direction.copy(this._camera.entity.forward);
return tmpR1;
}

/**
Expand Down

0 comments on commit 7dbbe31

Please sign in to comment.