Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fix curved mode intersection precision issues that make the laser poi…
Browse files Browse the repository at this point in the history
…nter too sensitive. (#1475)
  • Loading branch information
MortimerGoro authored and keianhzo committed Jul 30, 2019
1 parent 0298c68 commit 8e847aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/cpp/Cylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,10 @@ Cylinder::TestIntersection(const vrb::Vector& aStartPoint, const vrb::Vector& aD
vrb::Matrix modelView = worldTransform.AfineInverse();
vrb::Vector start = modelView.MultiplyPosition(aStartPoint);
vrb::Vector direction = modelView.MultiplyDirection(aDirection);
start = start - direction * 1000.0f;
if (vrb::Vector(start.x(), 0.0f, start.z()).Magnitude() <= m.radius) {
// Ensure that start of the ray is outside of the cylinder
start = start - direction * m.radius * 3.0f;
}

const float radius = this->GetCylinderRadius();

Expand Down

0 comments on commit 8e847aa

Please sign in to comment.