Public Member Functions | Public Attributes

bl7::geometry2::Plane Class Reference

#include <Plane.h>

Inheritance diagram for bl7::geometry2::Plane:
bl7::geometry2::Geometry bl7::geometry2::CollisionPlane

List of all members.

Public Member Functions

 Plane (void)
virtual ~Plane (void)
 Plane (const Plane &rhs)
Planeoperator= (const Plane &rhs)
 Plane (const float a, const float b, const float d)
 Plane (const ml7::Vector2 &n, const float d)
Planefrom_points (const ml7::Vector2 &p, const ml7::Vector2 &q)
Planefrom_point_normal (const ml7::Vector2 &v, const ml7::Vector2 &n)
Plane inverted () const
Plane normalized () const
const float operator[] (unsigned index) const
float & operator[] (unsigned index)
float get_distance (const ml7::Vector2 &v) const
float get_x (const float y) const
float get_y (const float x) const
Planeinvert ()
Planenormalize ()
bool operator== (const Plane &rhs) const
bool operator!= (const Plane &rhs) const
bool operator== (const ml7::Vector2 &v) const
bool operator!= (const ml7::Vector2 &v) const
bool operator< (const ml7::Vector2 &v) const
bool operator> (const ml7::Vector2 &v) const
bool operator<= (const ml7::Vector2 &v) const
bool operator>= (const ml7::Vector2 &v) const
 operator const float * () const
 operator float * ()

Public Attributes

union {
   struct {
      float   a
      float   b
      float   d
   } 
   struct {
      ml7::Vector2   n
      float   d
   } 
   float   data [3]
}; 

Detailed Description

A plane devides the space in three regions: the upper and the lower space as well as the center space. It is defined by a normal n and a distance d from the origin, where all points p with n*p = d are located right on the plane (center space), points p with n*p > d belong to the upper space and points o with n*p < d fall into to the lower space.


Constructor & Destructor Documentation

bl7::geometry2::Plane::Plane ( void   )  [inline]

Default constructor.

virtual bl7::geometry2::Plane::~Plane ( void   )  [inline, virtual]

Destructor.

bl7::geometry2::Plane::Plane ( const Plane rhs  )  [inline]

Copy constructor.

bl7::geometry2::Plane::Plane ( const float  a,
const float  b,
const float  d 
) [inline]

Explicit constructor with the equation parameters.

bl7::geometry2::Plane::Plane ( const ml7::Vector2 n,
const float  d 
) [inline]

Explicit constructor with the normal and the distance from the origin.


Member Function Documentation

Plane & bl7::geometry2::Plane::from_point_normal ( const ml7::Vector2 v,
const ml7::Vector2 n 
)

Creates the plane from a point located right on it and the normal defining the alignment of the plane.

Creates a plane defined by a point located right on it and the normal defining the alignment of the plane.

Plane & bl7::geometry2::Plane::from_points ( const ml7::Vector2 p,
const ml7::Vector2 q 
)

Creates the plane from two points located right on the plane.

Creates a plane defined by two points located right on the plane.

float bl7::geometry2::Plane::get_distance ( const ml7::Vector2 v  )  const

Returns the distance of a given point v to this plane. The function max return a negative distance, if the point is located in the lower space.

float bl7::geometry2::Plane::get_x ( const float  y  )  const

Returns the x component of a point with the given y component located right on the plane. If the plane is horizontally aligned, the result is undefined. However, in that case the function returns 0.

float bl7::geometry2::Plane::get_y ( const float  x  )  const

Returns the y component of a point with the given x component located right on the plane. If the plane is vertically aligned, the result is undefined. However, in that case the function returns 0.

Plane & bl7::geometry2::Plane::invert (  ) 

Inverts the sign of the equation parameters of this plane.

Plane bl7::geometry2::Plane::inverted (  )  const [inline]

Returns a copy of this plane inverted.

Plane & bl7::geometry2::Plane::normalize (  ) 

Normalizes this plane that the normal has a magnitude of 1.

Plane bl7::geometry2::Plane::normalized (  )  const

Returns a copy of this plane normalized.

bl7::geometry2::Plane::operator const float * (  )  const [inline]
bl7::geometry2::Plane::operator float * (  )  [inline]
bool bl7::geometry2::Plane::operator!= ( const ml7::Vector2 v  )  const [inline]

Checks whether a given point is not located right on the plane (center space).

bool bl7::geometry2::Plane::operator!= ( const Plane rhs  )  const [inline]

Checks whether a given plane and this have non-identical equation parameters.

bool bl7::geometry2::Plane::operator< ( const ml7::Vector2 v  )  const [inline]

Checks whether a given point is located below the plane (lower space).

bool bl7::geometry2::Plane::operator<= ( const ml7::Vector2 v  )  const [inline]

Checks whether a given point is located below or right on the plane (lower or center space).

Plane& bl7::geometry2::Plane::operator= ( const Plane rhs  )  [inline]

Copy assignment operator.

bool bl7::geometry2::Plane::operator== ( const ml7::Vector2 v  )  const [inline]

Checks whether a given point is located right on the plane (center space).

bool bl7::geometry2::Plane::operator== ( const Plane rhs  )  const [inline]

Checks whether a given plane and this have identical equation parameters.

bool bl7::geometry2::Plane::operator> ( const ml7::Vector2 v  )  const [inline]

Checks whether a given point is located above the plane (upper space).

bool bl7::geometry2::Plane::operator>= ( const ml7::Vector2 v  )  const [inline]

Checks whether a given point is located above or right on the plane (upper or center space).

float& bl7::geometry2::Plane::operator[] ( unsigned  index  )  [inline]

Indexed component access.

const float bl7::geometry2::Plane::operator[] ( unsigned  index  )  const [inline]

Indexed component access.


Member Data Documentation

union { ... }

The x component.

The y component.

The distance from the origin.

Array of the equation parameters.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines