Object3d of type (infinite) Plane (position+normal). Analytically compute intersection with a ray. More...
Public Member Functions | |
plane (const vec3 &x0=vec3(), const vec3 &normal=vec3(0, 0, 1)) | |
direct constructor (position+normal) More... | |
virtual | ~plane () |
destructor More... | |
const vec3 & | normal () const |
get the normal of the plane More... | |
const vec3 & | position () const |
get the position of the plane More... | |
virtual bool | intersect (const ray &ray_data, intersection &intersection_data) const |
Analytic intersection between a ray and the plane. More... | |
![]() | |
object3d () | |
empty constructor More... | |
virtual | ~object3d () |
destructor More... | |
Private Attributes | |
const vec3 | x0 |
internal position of the plane (not unique for a given plane) More... | |
const vec3 | n |
internal normal of the plane More... | |
Object3d of type (infinite) Plane (position+normal). Analytically compute intersection with a ray.
direct constructor (position+normal)
|
virtual |
destructor
|
virtual |
Analytic intersection between a ray and the plane.
Implements cpe::object3d.
References cpe::vec3::dot(), n, cpe::vec3::normalized(), cpe::ray::u, cpe::vec3::x(), cpe::ray::x0, x0, cpe::vec3::y(), and cpe::vec3::z().
|
private |
internal normal of the plane
Referenced by intersect(), and normal().
|
private |
internal position of the plane (not unique for a given plane)
Referenced by intersect(), and position().