Skip to content

cf_endpoint

Category: collision
GitHub: cute_math.h


Returns the endpoint of a ray.

CF_V2 cf_endpoint(CF_Ray r) { return cf_add(r.p, cf_mul_v2_f(r.d, r.t)); }

Remarks

Rays are defined to have an endpoint as an optimization. Usually infinite rays are not needed in games, and cause unnecessarily large computations when doing raycasts.

CF_Ray
cf_impact