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 committed Oct 28, 2024
1 parent 72f5afd commit 02a47ab
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 @@ -544,7 +544,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 02a47ab

Please sign in to comment.