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

Method drawArc

physx/source/physxextensions/src/ExtD6Joint.cpp:663–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661 struct Local
662 {
663 static void drawArc(PxConstraintVisualizer& _viz, const PxTransform& _cA2w, float ymin, float ymax, float zmin, float zmax, PxU32 color)
664 {
665 // PT: we use 32 segments for the cone case, so that's 32/4 segments per arc in the pyramid case
666 const PxU32 nb = 32/4;
667 PxVec3 prev(0.0f);
668 for(PxU32 i=0;i<nb;i++)
669 {
670 const float coeff = float(i)/float(nb-1);
671 const float y = coeff*ymax + (1.0f-coeff)*ymin;
672 const float z = coeff*zmax + (1.0f-coeff)*zmin;
673
674 const float r = 1.0f;
675 PxMat33 my; _setRotZ(my, z);
676 PxMat33 mz; _setRotY(mz, y);
677 const PxVec3 p0 = (my*mz).transform(PxVec3(r, 0.0f, 0.0f));
678 const PxVec3 p0w = _cA2w.transform(p0);
679 _viz.visualizeLine(_cA2w.p, p0w, color);
680 if(i)
681 _viz.visualizeLine(prev, p0w, color);
682 prev = p0w;
683 }
684 }
685 };
686
687 const PxJointLimitPyramid& l = data.pyramidSwingLimit;

Callers

nothing calls this directly

Calls 5

_setRotZFunction · 0.85
_setRotYFunction · 0.85
PxVec3Class · 0.50
transformMethod · 0.45
visualizeLineMethod · 0.45

Tested by

no test coverage detected