Skip to content

Commit

Permalink
set near for raycaster
Browse files Browse the repository at this point in the history
  • Loading branch information
cabanier committed Oct 19, 2023
1 parent 0829beb commit 56927e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions player.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ AFRAME.registerComponent("player", {
// apply velocity and collide with environment
velocityRaycaster.data.origin = this.camera.object3D.position;
velocityRaycaster.data.direction = this.velocity;
velocityRaycaster.raycaster.near = 0.01;
velocityRaycaster.raycaster.far = Math.max(this.velocity.length() * timeDeltaSec, this.data.padding);
velocityRaycaster.checkIntersections();
if (!velocityRaycaster.intersections.length) {
Expand Down

0 comments on commit 56927e3

Please sign in to comment.