54 minMargin = PX_MAX_REAL;
55 sweepMargin = PX_MAX_REAL;
71 const FloatV num = FLoad(0.25f);
72 center = V3Scale(V3Add(V3Add(p0, p1), V3Add(p2, p3)), num);
74 vertsX = V4SetW(V4SetZ(V4SetY(Vec4V_From_Vec3V(p0), V3GetX(p1)), V3GetX(p2)), V3GetX(p3));
76 vertsY = V4SetW(V4SetZ(V4SetY(V4Splat(V3GetY(p0)), V3GetY(p1)), V3GetY(p2)), V3GetY(p3));
78 vertsZ = V4SetW(V4SetZ(V4SetY(V4Splat(V3GetZ(p0)), V3GetZ(p1)), V3GetZ(p2)), V3GetZ(p3));
82 minMargin = PX_MAX_REAL;
83 sweepMargin = PX_MAX_REAL;
89 const Vec3V p0 = V3LoadU(pts[0]);
90 const Vec3V p1 = V3LoadU(pts[1]);
91 const Vec3V p2 = V3LoadU(pts[2]);
92 const Vec3V p3 = V3LoadU(pts[3]);
93 const FloatV num = FLoad(0.25f);
94 center = V3Scale(V3Add(V3Add(p0, p1), V3Add(p2, p3)), num);
96 vertsX = V4SetW(V4SetZ(V4SetY(Vec4V_From_Vec3V(p0), V3GetX(p1)), V3GetX(p2)), V3GetX(p3));
97 vertsY = V4SetW(V4SetZ(V4SetY(V4Splat(V3GetY(p0)), V3GetY(p1)), V3GetY(p2)), V3GetY(p3));
98 vertsZ = V4SetW(V4SetZ(V4SetY(V4Splat(V3GetZ(p0)), V3GetZ(p1)), V3GetZ(p2)), V3GetZ(p3));
102 minMargin = PX_MAX_REAL;
103 sweepMargin = PX_MAX_REAL;
114 vertsX = tetrahedron.vertsX;
115 vertsY = tetrahedron.vertsY;
116 vertsZ = tetrahedron.vertsZ;
123 center = tetrahedron.center;
125 minMargin = PX_MAX_REAL;
126 sweepMargin = PX_MAX_REAL;
144 Vec3V offset = V3Sub(_center, center);
146 vertsX = V4Add(vertsX, V4Splat(V3GetX(offset)));
147 vertsY = V4Add(vertsY, V4Splat(V3GetY(offset)));
148 vertsZ = V4Add(vertsZ, V4Splat(V3GetZ(offset)));
156 PX_FORCE_INLINE aos::Vec4V getProjection(
const aos::Vec3VArg dir)
const
160 const Vec4V dx = V4Scale(vertsX, V3GetX(dir));
161 const Vec4V dy = V4Scale(vertsY, V3GetY(dir));
162 const Vec4V dz = V4Scale(vertsZ, V3GetZ(dir));
164 return V4Add(dx, V4Add(dy, dz));
172 const Vec4V d = getProjection(dir);
174 const FloatV d0 = V4GetX(d);
175 const FloatV d1 = V4GetY(d);
176 const FloatV d2 = V4GetZ(d);
177 const FloatV d3 = V4GetW(d);
179 const BoolV con0 = BAnd(BAnd(FIsGrtr(d0, d1), FIsGrtr(d0, d2)), FIsGrtr(d0, d3));
180 const BoolV con1 = BAnd(FIsGrtr(d1, d2), FIsGrtr(d1, d3));
181 const BoolV con2 = FIsGrtr(d2, d3);
187 PX_FORCE_INLINE aos::Vec3V supportRelative(
const aos::Vec3VArg dir,
const aos::PxMatTransformV& aToB,
const aos::PxMatTransformV& aTobT)
const
192 const Vec3V _dir = aTobT.rotate(dir);
193 const Vec3V maxPoint = supportLocal(_dir);
194 return aToB.transform(maxPoint);
197 PX_FORCE_INLINE aos::Vec3V supportLocal(
const aos::Vec3VArg dir, PxI32& index)
const
202 const Vec4V d = getProjection(dir);
203 const FloatV d0 = V4GetX(d);
204 const FloatV d1 = V4GetY(d);
205 const FloatV d2 = V4GetZ(d);
206 const FloatV d3 = V4GetW(d);
208 const BoolV con0 = BAnd(BAnd(FIsGrtr(d0, d1), FIsGrtr(d0, d2)), FIsGrtr(d0, d3));
209 const BoolV con1 = BAnd(FIsGrtr(d1, d2), FIsGrtr(d1, d3));
210 const BoolV con2 = FIsGrtr(d2, d3);
213 const VecI32V vIndex = VecI32V_Sel(con0, I4Load(0), VecI32V_Sel(con1, I4Load(1), VecI32V_Sel(con2, I4Load(2), I4Load(3))));
214 PxI32_From_VecI32V(vIndex, &index);
220 PX_FORCE_INLINE aos::Vec3V supportRelative(
const aos::Vec3VArg dir,
const aos::PxMatTransformV& aToB,
221 const aos::PxMatTransformV& aTobT, PxI32& index)
const
227 const Vec3V _dir = aTobT.rotate(dir);
228 return aToB.transform(supportLocal(_dir, index));