#include <VPlane.h>
Public Member Functions | |
VPlane () | |
VPlane (float n_x, float n_y, float n_z, float _d) | |
VPlane (VVector m_Vec1, VVector m_Vec2, VVector m_Vec3) | |
VPlane (VVector m_Normal, VVector m_Point) | |
VPlane & | normalize () |
VPlane & | operator= (const VPlane rhs) |
bool | isInFront (VVector &p) const |
float | distance (const VVector &p) const |
bool | intersect (const VVector &start, const VVector &dir, VVector &result) const |
bool | intersects (const VVector &start, const VVector &dir) const |
VVector | getNormal () |
std::string | toString () |
float * | getArray () |
Public Attributes | |
float & | nx |
float & | ny |
float & | nz |
float & | d |
float | values [4] |
VVector | mNormal |
Definition at line 14 of file VPlane.h.
VPlane::VPlane | ( | ) | [inline] |
VPlane::VPlane | ( | float | n_x, | |
float | n_y, | |||
float | n_z, | |||
float | _d | |||
) | [inline] |
constructor with 3 Points. Points must be given in counter clockwise order
m_Vec1 | Point1 of Plane | |
m_Vec2 | Point2 of Plane | |
m_Vec3 | Point3 of Plane |
Definition at line 63 of file VPlane.h.
References d, VVector::getCross(), VVector::getDot(), VVector::getX(), VVector::getY(), VVector::getZ(), mNormal, VVector::normalize(), nx, ny, and nz.
constructor with given Point and Normal
m_Normal | NormalVector of Plane | |
m_Point | Point on Plane |
Definition at line 83 of file VPlane.h.
References d, VVector::getDot(), VVector::getX(), VVector::getY(), VVector::getZ(), nx, ny, and nz.
VPlane& VPlane::normalize | ( | ) | [inline] |
bool VPlane::isInFront | ( | VVector & | p | ) | const [inline] |
Determine whether a point is at the "back" or in the "front" of the plane.
p | Vector to test |
Definition at line 129 of file VPlane.h.
References d, VVector::getX(), VVector::getY(), VVector::getZ(), nx, ny, and nz.
float VPlane::distance | ( | const VVector & | p | ) | const [inline] |
returns the signed distance.
p | Vector to test |
Definition at line 139 of file VPlane.h.
References d, VVector::getX(), VVector::getY(), VVector::getZ(), nx, ny, and nz.
bool VPlane::intersect | ( | const VVector & | start, | |
const VVector & | dir, | |||
VVector & | result | |||
) | const [inline] |
Intersect with a ray.
start | Start point of the ray. | |
dir | Direction of the ray. | |
result | The resulting intersection point. |
Definition at line 150 of file VPlane.h.
References d, EPSILON, VVector::getX(), VVector::getY(), VVector::getZ(), nx, ny, and nz.
Referenced by intersects().
Test for intersection. This works identically to Intersect(), except for the missing result parameter. This method is intended for use when you are only interested in whether there is an intersection, but not the actual intersection point.
Definition at line 178 of file VPlane.h.
References intersect().
VVector VPlane::getNormal | ( | ) | [inline] |
std::string VPlane::toString | ( | ) | [inline] |
float& VPlane::nx |
Definition at line 17 of file VPlane.h.
Referenced by distance(), getNormal(), intersect(), isInFront(), normalize(), operator=(), toString(), and VPlane().
float& VPlane::ny |
Definition at line 18 of file VPlane.h.
Referenced by distance(), getNormal(), intersect(), isInFront(), normalize(), operator=(), toString(), and VPlane().
float& VPlane::nz |
Definition at line 19 of file VPlane.h.
Referenced by distance(), getNormal(), intersect(), isInFront(), normalize(), operator=(), toString(), and VPlane().
float& VPlane::d |
Definition at line 20 of file VPlane.h.
Referenced by distance(), intersect(), isInFront(), normalize(), operator=(), toString(), and VPlane().
float VPlane::values[4] |