SLProject 4.0.000
SLPlane Class Reference

Defines a plane in 3D space with the equation ax + by + cy + d = 0. More...

#include <SLPlane.h>

Public Member Functions

 SLPlane (const SLVec3f &v1, const SLVec3f &v2, const SLVec3f &v3)
 
 SLPlane ()
 
 ~SLPlane ()
 
void setPoints (const SLVec3f &v1, const SLVec3f &v2, const SLVec3f &v3)
 
void setNormalAndPoint (const SLVec3f &N, const SLVec3f &P)
 
void setCoefficients (const SLfloat A, const SLfloat B, const SLfloat C, const SLfloat D)
 
SLfloat distToPoint (const SLVec3f &p)
 Returns distance between a point P and the plane. More...
 
void print (const char *name)
 

Public Attributes

SLVec3f N
 plane normal More...
 
SLfloat d
 d = -(ax+by+cy) = -normal.dot(point) More...
 

Detailed Description

Defines a plane in 3D space with the equation ax + by + cy + d = 0.

SLPlane defines a plane in 3D space with the equation ax + by + cy + d = 0 where [a,b,c] is the plane normal and d is the distance from [0,0,0]. The class is used to define the 6 planes of the view frustum.

Constructor & Destructor Documentation

◆ SLPlane() [1/2]

SLPlane::SLPlane ( const SLVec3f v0,
const SLVec3f v1,
const SLVec3f v2 
)

SLPlane::SLPlane ctor with 3 points

◆ SLPlane() [2/2]

SLPlane::SLPlane ( )
inline

◆ ~SLPlane()

SLPlane::~SLPlane ( )
inline

Member Function Documentation

◆ distToPoint()

SLfloat SLPlane::distToPoint ( const SLVec3f p)
inline

Returns distance between a point P and the plane.

◆ print()

void SLPlane::print ( const char *  name)

SLPlane::print prints the normal and the coefficent d

◆ setCoefficients()

void SLPlane::setCoefficients ( const SLfloat  A,
const SLfloat  B,
const SLfloat  C,
const SLfloat  D 
)

SLPlane::setByCoefficients defines the plane by the coefficient A,B,C & D

◆ setNormalAndPoint()

void SLPlane::setNormalAndPoint ( const SLVec3f normal,
const SLVec3f P 
)

SLPlane::setByNormalAndPoint defines the plane by a normal N and a point P

◆ setPoints()

void SLPlane::setPoints ( const SLVec3f v0,
const SLVec3f v1,
const SLVec3f v2 
)

SLPlane::setFromPoints set the plane from 3 points

Member Data Documentation

◆ d

SLfloat SLPlane::d

d = -(ax+by+cy) = -normal.dot(point)

◆ N

SLVec3f SLPlane::N

plane normal


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