MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / plane_ray_intersect

Function plane_ray_intersect

StereoKitC/intersect.cpp:10–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace sk {
9
10bool32_t plane_ray_intersect (plane_t plane, ray_t ray, vec3 *out_pt) {
11 // t = -(Pi . N + d) / (V . N)
12 // Pf = Pi + tV
13 float t =
14 -(vec3_dot(ray.pos, plane.normal) + plane.d) /
15 vec3_dot(ray.dir, plane.normal);
16 *out_pt = ray.pos + ray.dir * t;
17 return t >= 0;
18}
19
20///////////////////////////////////////////
21

Callers 1

tex_gen_cubemap_shFunction · 0.85

Calls 1

vec3_dotFunction · 0.85

Tested by

no test coverage detected