MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / transformNoEmptyTestV

Function transformNoEmptyTestV

physx/source/geomutils/src/GuBounds.cpp:68–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68static PX_FORCE_INLINE void transformNoEmptyTestV(Vec3p& c, Vec3p& ext, const PxMat33Padded& rot, const PxVec3& pos, const CenterExtentsPadded& bounds)
69{
70 const Vec4V boundsCenterV = V4LoadU(&bounds.mCenter.x); // PT: this load is safe since extents follow center in the class
71
72 // PT: unfortunately we can't V4LoadU 'pos' directly (it can come directly from users!). So we have to live with this for now:
73 const Vec4V posV = Vec4V_From_Vec3V(V3LoadU(&pos.x));
74 // PT: but eventually we'd like to use the "unsafe" version (e.g. by switching p&q in PxTransform), which would save 6 instructions on Win32
75 const Vec4V cV = V4Add(multiply3x3V(boundsCenterV, rot), posV);
76// const Vec4V cV = V4Add(multiply3x3V(boundsCenterV, rot), V4LoadU(&pos.x)); // ### unsafe
77 V4StoreU(cV, &c.x);
78
79 // extended basis vectors
80 const Vec4V boundsExtentsV = V4LoadU(&bounds.mExtents.x); // PT: this load is safe since bounds are padded
81 const Vec4V c0V = V4Scale(V4LoadU(&rot.column0.x), V4GetX(boundsExtentsV));
82 const Vec4V c1V = V4Scale(V4LoadU(&rot.column1.x), V4GetY(boundsExtentsV));
83 const Vec4V c2V = V4Scale(V4LoadU(&rot.column2.x), V4GetZ(boundsExtentsV));
84
85 // find combination of base vectors that produces max. distance for each component = sum of abs()
86 Vec4V extentsV = V4Add(V4Abs(c0V), V4Abs(c1V));
87 extentsV = V4Add(extentsV, V4Abs(c2V));
88 V4StoreU(extentsV, &ext.x);
89}
90
91static PX_FORCE_INLINE PxU32 isNonIdentity(const PxVec3& scale)
92{

Callers 1

transformNoEmptyTestFunction · 0.85

Calls 11

multiply3x3VFunction · 0.70
V4LoadUFunction · 0.50
Vec4V_From_Vec3VFunction · 0.50
V3LoadUFunction · 0.50
V4AddFunction · 0.50
V4StoreUFunction · 0.50
V4ScaleFunction · 0.50
V4GetXFunction · 0.50
V4GetYFunction · 0.50
V4GetZFunction · 0.50
V4AbsFunction · 0.50

Tested by

no test coverage detected