mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
Plane Class Reference

Represents a plane in 3d space. More...

#include <Plane.h>

Public Member Functions

 Plane (void)
 
 Plane (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3)
 Constructs a plane defined by three points in 3d space.
 
 Plane (Vector3 normal, Vector3 point)
 Constructs a plane defined by a point on the plane and the normal.
 
 ~Plane (void)
 
void setPlane (const Vector3 &normal, const Vector3 &point)
 
void setPlane (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3)
 
void setPlane (float a, float b, float c, float d)
 
float distance (const Vector3 &p)
 
Vector3 getNormal (void)
 

Detailed Description

Represents a plane in 3d space.

Several methods of defining the plane are supported. The plane knows its normal and supports the operation of calculating the distance of a point to the plane.

Definition at line 18 of file Plane.h.

Constructor & Destructor Documentation

Plane::Plane ( void  )

Definition at line 22 of file Plane.cpp.

Plane::Plane ( const Vector3 v1,
const Vector3 v2,
const Vector3 v3 
)

Constructs a plane defined by three points in 3d space.

Definition at line 11 of file Plane.cpp.

Plane::Plane ( Vector3  normal,
Vector3  point 
)

Constructs a plane defined by a point on the plane and the normal.

Definition at line 18 of file Plane.cpp.

Plane::~Plane ( void  )

Definition at line 24 of file Plane.cpp.

Member Function Documentation

float Plane::distance ( const Vector3 p)

Calculates the signed distance between a point and the plane using the inner product.

Parameters
pthe point that should be tested.

Definition at line 80 of file Plane.cpp.

Vector3 Plane::getNormal ( void  )

Returns the normal of the plane.

Definition at line 87 of file Plane.cpp.

void Plane::setPlane ( const Vector3 normal,
const Vector3 point 
)

Sets up the plane defined through its normal and one point on the plane.

Parameters
normalthe planes normal
pointone point on the plane

Definition at line 49 of file Plane.cpp.

void Plane::setPlane ( const Vector3 v1,
const Vector3 v2,
const Vector3 v3 
)

Sets up the plane defined through three points on it.

Parameters
v1the first point
v2the second point
v3the third point

Definition at line 32 of file Plane.cpp.

void Plane::setPlane ( float  a,
float  b,
float  c,
float  d 
)

Sets up the plane defined through the four coefficients of an equation of the type ax_1 + b_x2 + cx_3 + d = 0.

Parameters
athe first parameter
bthe second parameter
cthe third parameter
dthe fourth parameter

Definition at line 64 of file Plane.cpp.


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