30#ifndef PXFOUNDATION_PXPLANE_H
31#define PXFOUNDATION_PXPLANE_H
37#include "foundation/PxMath.h"
38#include "foundation/PxVec3.h"
78 :
n(normal),
d(-point.dot(
n))
87 n = (p1 - p0).cross(p2 - p0).getNormalized();
96 return n == p.n &&
d == p.d;
106 return PxAbs(distance(p)) < (1.0e-7f);
114 return p -
n * distance(p);
Representation of a plane.
Definition PxPlane.h:49
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 project(const PxVec3 &p) const
projects p into the plane
Definition PxPlane.h:112
PX_CUDA_CALLABLE PX_INLINE bool operator==(const PxPlane &p) const
returns true if the two planes are exactly equal
Definition PxPlane.h:94
PX_CUDA_CALLABLE PX_FORCE_INLINE PxPlane(const PxVec3 &normal, float distance)
Constructor from a normal and a distance.
Definition PxPlane.h:70
PxVec3 n
The normal to the plane.
Definition PxPlane.h:152
PX_CUDA_CALLABLE PX_FORCE_INLINE PxPlane(const PxVec3 &p0, const PxVec3 &p1, const PxVec3 &p2)
Constructor from three points.
Definition PxPlane.h:85
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 pointInPlane() const
find an arbitrary point in the plane
Definition PxPlane.h:120
PX_CUDA_CALLABLE PX_FORCE_INLINE PxPlane()
Constructor.
Definition PxPlane.h:56
float d
The distance from the origin.
Definition PxPlane.h:153
PX_CUDA_CALLABLE PX_FORCE_INLINE PxPlane(const PxVec3 &point, const PxVec3 &normal)
Constructor from a point on the plane and a normal.
Definition PxPlane.h:77
PX_CUDA_CALLABLE PX_FORCE_INLINE void normalize()
equivalent plane with unit normal
Definition PxPlane.h:129
PX_CUDA_CALLABLE PX_FORCE_INLINE PxPlane(float nx, float ny, float nz, float distance)
Constructor from a normal and a distance.
Definition PxPlane.h:63
3 Element vector class.
Definition PxVec3.h:50
PX_CUDA_CALLABLE PX_FORCE_INLINE float dot(const PxVec3 &v) const
returns the scalar product of this and other.
Definition PxVec3.h:276
PX_CUDA_CALLABLE PX_FORCE_INLINE float magnitude() const
returns the magnitude
Definition PxVec3.h:183
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxAbs(float a)
abs returns the absolute value of its argument.
Definition PxMath.h:109