| 1763 | } |
| 1764 | |
| 1765 | void RigidShape::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat ) |
| 1766 | { |
| 1767 | // Box for the center of Mass |
| 1768 | GFXStateBlockDesc desc; |
| 1769 | desc.setBlend(false, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha); |
| 1770 | desc.setZReadWrite(false); |
| 1771 | desc.fillMode = GFXFillWireframe; |
| 1772 | |
| 1773 | GFX->getDrawUtil()->drawCube( desc, Point3F(0.1f,0.1f,0.1f), mDataBlock->massCenter, ColorI(255, 255, 255), &mRenderObjToWorld ); |
| 1774 | |
| 1775 | // Collision points... |
| 1776 | for (S32 i = 0; i < mCollisionList.getCount(); i++) |
| 1777 | { |
| 1778 | const Collision& collision = mCollisionList[i]; |
| 1779 | GFX->getDrawUtil()->drawCube( desc, Point3F(0.05f,0.05f,0.05f), collision.point, ColorI(0, 0, 255) ); |
| 1780 | } |
| 1781 | |
| 1782 | // Render the normals as one big batch... |
| 1783 | PrimBuild::begin(GFXLineList, mCollisionList.getCount() * 2); |
| 1784 | for (S32 i = 0; i < mCollisionList.getCount(); i++) |
| 1785 | { |
| 1786 | |
| 1787 | const Collision& collision = mCollisionList[i]; |
| 1788 | PrimBuild::color3f(1, 1, 1); |
| 1789 | PrimBuild::vertex3fv(collision.point); |
| 1790 | PrimBuild::vertex3fv(collision.point + collision.normal * 0.05f); |
| 1791 | } |
| 1792 | PrimBuild::end(); |
| 1793 | |
| 1794 | // Build and render the collision polylist which is returned |
| 1795 | // in the server's world space. |
| 1796 | ClippedPolyList polyList; |
| 1797 | polyList.mPlaneList.setSize(6); |
| 1798 | polyList.mPlaneList[0].set(getWorldBox().minExtents,VectorF(-1,0,0)); |
| 1799 | polyList.mPlaneList[1].set(getWorldBox().minExtents,VectorF(0,-1,0)); |
| 1800 | polyList.mPlaneList[2].set(getWorldBox().minExtents,VectorF(0,0,-1)); |
| 1801 | polyList.mPlaneList[3].set(getWorldBox().maxExtents,VectorF(1,0,0)); |
| 1802 | polyList.mPlaneList[4].set(getWorldBox().maxExtents,VectorF(0,1,0)); |
| 1803 | polyList.mPlaneList[5].set(getWorldBox().maxExtents,VectorF(0,0,1)); |
| 1804 | Box3F dummyBox; |
| 1805 | SphereF dummySphere; |
| 1806 | buildPolyList(PLC_Collision, &polyList, dummyBox, dummySphere); |
| 1807 | //polyList.render(); |
| 1808 | } |
| 1809 | |
| 1810 | void RigidShape::reset() |
| 1811 | { |
nothing calls this directly
no test coverage detected