- added debug line drawing in gameengine (handy for debugging physics problems)

- added #ifdef for a visual studio 8 crashing problems
- added scaling and tolerances to triangle meshes
This commit is contained in:
Erwin Coumans
2005-07-27 09:30:53 +00:00
parent b8142515ce
commit 411123b250
23 changed files with 183 additions and 24 deletions

View File

@@ -401,6 +401,21 @@ void RAS_OpenGLRasterizer::ClearCachingInfo(void)
void RAS_OpenGLRasterizer::EndFrame()
{
//DrawDebugLines
glBegin(GL_LINES);
for (unsigned int i=0;i<m_debugLines.size();i++)
{
glColor4f(m_debugLines[i].m_color[0],m_debugLines[i].m_color[1],m_debugLines[i].m_color[2],1.f);
const MT_Scalar* fromPtr = &m_debugLines[i].m_from.x();
const MT_Scalar* toPtr= &m_debugLines[i].m_to.x();
glVertex3dv(fromPtr);
glVertex3dv(toPtr);
}
glEnd();
m_debugLines.clear();
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
m_2DCanvas->EndFrame();
}

View File

@@ -44,6 +44,13 @@ using namespace std;
#include "RAS_MaterialBucket.h"
#include "RAS_ICanvas.h"
struct OglDebugLine
{
MT_Vector3 m_from;
MT_Vector3 m_to;
MT_Vector3 m_color;
};
/**
* 3D rendering device context.
*/
@@ -226,6 +233,17 @@ public:
);
virtual void SetPolygonOffset(float mult, float add);
virtual void DrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,const MT_Vector3& color)
{
OglDebugLine line;
line.m_from = from;
line.m_to = to;
line.m_color = color;
m_debugLines.push_back(line);
}
std::vector <OglDebugLine> m_debugLines;
};
#endif //__RAS_OPENGLRASTERIZER