Skip to content

Commit

Permalink
Merge pull request #388 from acrilique/patch-2
Browse files Browse the repository at this point in the history
Access intersection.face.normal instead of intersection.normal
  • Loading branch information
bbohlender authored Jan 30, 2025
2 parents 640f89f + aadba80 commit c99b474
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/xr/src/pointer/cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ export function updatePointerCursorModel(

mesh.position.copy(intersection.pointOnFace)
mesh.scale.setScalar(options.size ?? 0.1)
if (intersection.normal != null) {
quaternionHelper.setFromUnitVectors(ZAxis, intersection.normal)

const normal = intersection.normal ?? intersection.face?.normal
if (normal != null) {
quaternionHelper.setFromUnitVectors(ZAxis, normal)
intersection.object.getWorldQuaternion(mesh.quaternion)
mesh.quaternion.multiply(quaternionHelper)
offsetHelper.set(0, 0, options.cursorOffset ?? 0.01)
Expand Down

0 comments on commit c99b474

Please sign in to comment.