* ============================================================================================= * BtDebugDrawer * ============================================================================================= */ ------------------------------------------------------------------------------------------------
| 863 | */ |
| 864 | //------------------------------------------------------------------------------------------------ |
| 865 | void DebugDrawer::drawLine(const btVector3& from, const btVector3& to, const btVector3& color) |
| 866 | { |
| 867 | if (mLines.getSections().empty()) |
| 868 | { |
| 869 | const char* matName = "Ogre/Debug/LinesMat"; |
| 870 | auto mat = MaterialManager::getSingleton().getByName(matName, RGN_INTERNAL); |
| 871 | if (!mat) |
| 872 | { |
| 873 | mat = MaterialManager::getSingleton().create(matName, RGN_INTERNAL); |
| 874 | auto p = mat->getTechnique(0)->getPass(0); |
| 875 | p->setLightingEnabled(false); |
| 876 | p->setVertexColourTracking(TVC_AMBIENT); |
| 877 | } |
| 878 | mLines.setBufferUsage(HBU_CPU_TO_GPU); |
| 879 | mLines.begin(mat, RenderOperation::OT_LINE_LIST); |
| 880 | } |
| 881 | else if (mLines.getCurrentVertexCount() == 0) |
| 882 | mLines.beginUpdate(0); |
| 883 | |
| 884 | ColourValue col(color.x(), color.y(), color.z()); |
| 885 | mLines.position(convert(from)); |
| 886 | mLines.colour(col); |
| 887 | mLines.position(convert(to)); |
| 888 | mLines.colour(col); |
| 889 | } |
| 890 | |
| 891 | struct DeepPenetrationContactResultCallback : public btManifoldResult |
| 892 | { |
nothing calls this directly
no test coverage detected