cpe::plane Class Reference

Object3d of type (infinite) Plane (position+normal). Analytically compute intersection with a ray. More...

+ Inheritance diagram for cpe::plane:
+ Collaboration diagram for cpe::plane:

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 vec3normal () const
 get the normal of the plane More...
 
const vec3position () 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...
 
- Public Member Functions inherited from cpe::object3d
 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...
 

Detailed Description

Object3d of type (infinite) Plane (position+normal). Analytically compute intersection with a ray.

Constructor & Destructor Documentation

cpe::plane::plane ( const vec3 x0 = vec3(),
const vec3 normal = vec3(0,0,1) 
)

direct constructor (position+normal)

cpe::plane::~plane ( )
virtual

destructor

Member Function Documentation

bool cpe::plane::intersect ( const ray ray_data,
intersection intersection_data 
) const
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().

+ Here is the call graph for this function:

const vec3 & cpe::plane::normal ( ) const

get the normal of the plane

References n.

const vec3 & cpe::plane::position ( ) const

get the position of the plane

References x0.

Member Data Documentation

const vec3 cpe::plane::n
private

internal normal of the plane

Referenced by intersect(), and normal().

const vec3 cpe::plane::x0
private

internal position of the plane (not unique for a given plane)

Referenced by intersect(), and position().


The documentation for this class was generated from the following files: