Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Designs and reviews game spatial queries such as ray-triangle hits, picking, containment, and distance tests.
91% 95%+5 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 20 of 22 without it.
I am designing a C++ API header for collision query primitives like point-in-triangle and ray-mesh testing. What pattern should I follow for naming these functions to prevent edge cases and ambiguity across team members?
Function names explicitly state the boundary policy in the identifier
3 of 3 safety checks passed
Use this skill to turn game picking, collision, containment, and distance questions into small geometric systems with explicit constraints and failure cases.
Primary source: Geometry for Programmers by Oleksandr Kaleniuk (https://www.manning.com/books/geometry-for-programmers), transformed and paraphrased, especially chapters 3, 4, and 9. Additional source: "Fast, Minimum Storage Ray-Triangle Intersection" by Tomas Moller and Ben Trumbore (https://dl.acm.org/doi/10.1145/1198555.1198746).
Model the ray as R = P + t*d with t >= 0. Model triangle points as
S = A + u*AB + v*AC with u >= 0, v >= 0, and u + v <= 1.
Solve R = S, then:
t < 0.u < 0, v < 0, or u + v > 1.t, barycentric-like parameters u and v, and the hit
point when needed.Next to this one in the catalogue, plus more from the same author.