syBR::map2syBR::Plane Class Reference

Double-precision plane. More...

#include <Plane.hpp>

List of all members.

Public Types

enum  VectorPosition { VP_FRONT = 0, VP_BACK, VP_ON }
 Position of a vector compared to the position of a plane. More...

Public Member Functions

 Plane ()
 Constructor 1.
 Plane (Vector3 normal, double offset)
 Constructor 2.
 ~Plane ()
 Destructor.
const Vector3getNormal () const
 Get the normal.
const double getOffset () const
 Get the translation offset.
void set (const double a, const double b, const double c, const double d)
 Set the (a,b,c) and d components of the plane.
void set (const Vector3 &normal, const double offset)
 Set (a,b,c) and d components of the plane.
void from3Vectors (const Vector3 &vec1, const Vector3 &vec2, const Vector3 &vec3)
 Construct plane from three vectors.
const double calculateDistance (const Vector3 &vec) const
 Calculate the distance the plane and a vector.
const VectorPosition calculatePosition (const Vector3 &vec) const
 Calculate the position of a vector compared to the position of the plane.
const Plane normalize () const
 Normalize the plane.

Static Public Member Functions

static const bool getPlanesIntersection (const Plane &plane1, const Plane &plane2, const Plane &plane3, Vector3 &result)
 Get the intersection of three planes.

Private Attributes

Vector3 m_normal
 Plane normal.
double m_offset
 Plane translation offset.


Detailed Description

Double-precision plane.

A plane is commonly represented as ax+by+cz+d=0 where (a,b,c) is the normal vector and d is the translation offset.


Member Enumeration Documentation

enum syBR::map2syBR::Plane::VectorPosition

Position of a vector compared to the position of a plane.

Enumerator:
VP_FRONT  Vector is in front of the plane.
VP_BACK  Vector is at the back of the plane.
VP_ON  Vector is on the plane.


Constructor & Destructor Documentation

syBR::map2syBR::Plane::Plane (  ) 

Constructor 1.

syBR::map2syBR::Plane::Plane ( Vector3  normal,
double  offset 
)

Constructor 2.

syBR::map2syBR::Plane::~Plane (  ) 

Destructor.


Member Function Documentation

const bool syBR::map2syBR::Plane::getPlanesIntersection ( const Plane plane1,
const Plane plane2,
const Plane plane3,
Vector3 result 
) [static]

Get the intersection of three planes.

Parameters:
plane1 First plane to be checked for intersection
plane2 Second plane to be checked for intersection
plane3 Third plane to be checked for intersection
result Resulting intersection vector will be written here if the three planes are not parallel
Returns:
One of these:
  • true if there is an intersection between the tree planes
  • false otherwise

const Vector3 & syBR::map2syBR::Plane::getNormal (  )  const

Get the normal.

Returns:
Normal of the plane

const double syBR::map2syBR::Plane::getOffset (  )  const

Get the translation offset.

Returns:
Translation offset of the plane

void syBR::map2syBR::Plane::set ( const double  a,
const double  b,
const double  c,
const double  d 
)

Set the (a,b,c) and d components of the plane.

Parameters:
a x component of the plane normal
b y component of the plane normal
c z component of the plane normal
d translation offset of the plane

void syBR::map2syBR::Plane::set ( const Vector3 normal,
const double  offset 
)

Set (a,b,c) and d components of the plane.

Parameters:
normal plane normal
offset translation offset of the plane

void syBR::map2syBR::Plane::from3Vectors ( const Vector3 vec1,
const Vector3 vec2,
const Vector3 vec3 
)

Construct plane from three vectors.

Parameters:
vec1 First vector to use to the plane construction
vec2 Second vector to use to the plane construction
vec3 Third vector to use to the plane construction

const double syBR::map2syBR::Plane::calculateDistance ( const Vector3 vec  )  const

Calculate the distance the plane and a vector.

Parameters:
vec Vector whose distance to the plane must be calculated

const Plane::VectorPosition syBR::map2syBR::Plane::calculatePosition ( const Vector3 vec  )  const

Calculate the position of a vector compared to the position of the plane.

Parameters:
vec Vector whose position compared to the position of this plane must be calculated

const Plane syBR::map2syBR::Plane::normalize (  )  const

Normalize the plane.

Returns:
Normalized plane


Member Data Documentation

Vector3 syBR::map2syBR::Plane::m_normal [private]

Plane normal.

double syBR::map2syBR::Plane::m_offset [private]

Plane translation offset.


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

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:34 2008