35#include "foundation/PxVec3.h"
36#include "foundation/PxPlane.h"
37#include "foundation/PxVecMath.h"
62 PX_FORCE_INLINE PlaneV(
const aos::FloatVArg nx,
const aos::FloatVArg ny,
const aos::FloatVArg nz,
const aos::FloatVArg _d)
70 const Vec3V _n = V3LoadU(plane.n);
71 const FloatV _d = FLoad(plane.d);
72 nd = V4SetW(Vec4V_From_Vec3V(_n), _d);
89 nd = aos::V4SetW(aos::Vec4V_From_Vec3V(_n), _d);
115 PX_FORCE_INLINE PlaneV& set(
const aos::FloatVArg nx,
const aos::FloatVArg ny,
const aos::FloatVArg nz,
const aos::FloatVArg _d)
119 const Vec3V n= V3Merge(nx, ny, nz);
120 nd = V4SetW(Vec4V_From_Vec3V(n), _d);
126 nd = aos::V4SetW(aos::Vec4V_From_Vec3V(_normal), _d);
133 PlaneV&
set(
const aos::Vec3VArg p0,
const aos::Vec3VArg p1,
const aos::Vec3VArg p2)
136 const Vec3V edge0 = V3Sub(p1, p0);
137 const Vec3V edge1 = V3Sub(p2, p0);
139 const Vec3V n = V3Normalize(V3Cross(edge0, edge1));
141 const FloatV d = FNeg(V3Dot(p0, n));
142 nd = V4SetW(Vec4V_From_Vec3V(n), d);
154 const Vec3V n = Vec3V_From_Vec4V(
nd);
155 return FAdd(V3Dot(p, n), V4GetW(
nd));
161 const FloatV eps = FLoad(1.0e-7f);
162 return FIsGrtr(eps, FAbs(distance(p)));
173 const Vec3V n = Vec3V_From_Vec4V(
nd);
174 return V3Sub(p, V3Scale(n, V4GetW(
nd)));
181 const Vec3V n = Vec3V_From_Vec4V(
nd);
182 return FAdd(V3Dot(n, point), V4GetW(
nd));
187 return aos::Vec3V_From_Vec4V(
nd);
192 return aos::V4GetW(
nd);
203 const Vec3V n = Vec3V_From_Vec4V(
nd);
204 return V3Neg(V3Scale(n, V4GetW(
nd)));
210 const Vec3V n = Vec3V_From_Vec4V(
nd);
211 const FloatV denom = FRecip(V3Length(n));
Definition GuVecPlane.h:50
PX_FORCE_INLINE aos::Vec3V pointInPlane() const
find an arbitrary point in the plane
Definition GuVecPlane.h:198
PX_FORCE_INLINE PlaneV(const aos::FloatVArg nx, const aos::FloatVArg ny, const aos::FloatVArg nz, const aos::FloatVArg _d)
Constructor from a normal and a distance.
Definition GuVecPlane.h:62
PX_FORCE_INLINE ~PlaneV()
Destructor.
Definition GuVecPlane.h:102
aos::Vec4V nd
The normal to the plan , w store the distance from the origin.
Definition GuVecPlane.h:215
PX_FORCE_INLINE PlaneV(const aos::Vec3VArg _n, const aos::FloatVArg _d)
Constructor from a normal and a distance.
Definition GuVecPlane.h:87
PlaneV & set(const aos::Vec3VArg p0, const aos::Vec3VArg p1, const aos::Vec3VArg p2)
Computes the plane equation from 3 points.
Definition GuVecPlane.h:133
PX_FORCE_INLINE PlaneV & setZero()
Sets plane to zero.
Definition GuVecPlane.h:109
PX_FORCE_INLINE PlaneV(const aos::Vec3VArg p0, const aos::Vec3VArg p1, const aos::Vec3VArg p2)
Constructor from three points.
Definition GuVecPlane.h:79
PX_FORCE_INLINE aos::Vec3V project(const aos::Vec3VArg p) const
projects p into the plane
Definition GuVecPlane.h:168
PX_FORCE_INLINE PlaneV()
Constructor.
Definition GuVecPlane.h:55
PX_FORCE_INLINE PlaneV(const PlaneV &plane)
Copy constructor.
Definition GuVecPlane.h:95
Representation of a plane.
Definition PxPlane.h:49
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Definition PxVecMathAoSScalar.h:90
Definition PxVecMathAoSScalar.h:52
Definition PxVecMathAoSScalar.h:77
Definition PxVecMathAoSScalar.h:65