Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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