Refactored sample code. Separated navmesh test code to a tool class.

This commit is contained in:
Mikko Mononen
2009-12-30 08:49:46 +00:00
parent 5daf3f8157
commit 4934dc2065
15 changed files with 2843 additions and 1648 deletions

View File

@@ -55,13 +55,27 @@ void DebugDrawGL::end()
Sample::Sample() :
m_verts(0), m_nverts(0), m_tris(0), m_trinorms(0), m_ntris(0)
m_verts(0),
m_nverts(0),
m_tris(0),
m_trinorms(0),
m_ntris(0),
m_tool(0)
{
resetCommonSettings();
}
Sample::~Sample()
{
delete m_tool;
}
void Sample::setTool(SampleTool* tool)
{
delete m_tool;
m_tool = tool;
if (tool)
m_tool->init(this);
}
void Sample::handleSettings()
@@ -162,12 +176,10 @@ void Sample::handleCommonSettings()
imguiSeparator();
}
void Sample::setToolStartPos(const float* p)
{
}
void Sample::setToolEndPos(const float* p)
void Sample::handleClick(const float* p, bool shift)
{
if (m_tool)
m_tool->handleClick(p, shift);
}
bool Sample::handleBuild()