March 2017
Intermediate to advanced
480 pages
11h 3m
English
Much like testing a line and an axis aligned or OBB intersection, testing a line and triangle intersection utilizes the existing Raycast function. We are going to cast a ray against the triangle being tested. If the Raycast succeeds, we need to make sure that the t value is along the line segment being tested.
We are about to implement a new Linetest function, which will test if a line and a triangle intersect. This function returns a Boolean result.
Follow these steps to check if a line intersects a triangle:
Linetest function in Geometry3D.h:bool Linetest(const Triangle& triangle, const Line& line);
Linetest function in Geometry3D.cpp:bool Linetest(const Triangle& triangle, ...
Read now
Unlock full access