MCPcopy Create free account
hub / github.com/crownengine/crown / ray_plane_intersection

Function ray_plane_intersection

src/core/math/intersection.cpp:17–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15namespace crown
16{
17f32 ray_plane_intersection(const Vector3 &from, const Vector3 &dir, const Plane3 &p)
18{
19 const f32 num = dot(from, p.n);
20 const f32 den = dot(dir, p.n);
21
22 if (fequal(den, 0.0f))
23 return -1.0f;
24
25 return (p.d - num) / den;
26}
27
28f32 ray_disc_intersection(const Vector3 &from, const Vector3 &dir, const Vector3 &center, f32 radius, const Vector3 &normal)
29{

Callers 2

ray_disc_intersectionFunction · 0.85
load_apiFunction · 0.85

Calls 1

dotFunction · 0.50

Tested by

no test coverage detected