use PlaneBufferGeometry with rotated X by -90° instead of BoxBufferGeometry #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To be able to work with raycaster, you need to rotate the geometry, not the mesh.
With mesh rotation, you get
intersects[0].face.normal
= x: 0 y: 0: z: 1 and so your isValidNormalsAngle function returns false.With the geometry rotation you get
intersects[0].face.normal
x: 0, y: 1, z: 1 and isValidNormalsAngle returns true.I'll do a similar PR to aframe-environment-component, the generated ground geometry is currently a plane with a mesh rotation. If I do a similar fix and rotate the geometry and not the meshs, I can teleport on the hills! So much fun. :)