本文整理汇总了C++中Sample_TileMesh类的典型用法代码示例。如果您正苦于以下问题:C++ Sample_TileMesh类的具体用法?C++ Sample_TileMesh怎么用?C++ Sample_TileMesh使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Sample_TileMesh类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleClick
virtual void handleClick(const float* /*s*/, const float* p, bool shift)
{
m_hitPosSet = true;
rcVcopy(m_hitPos,p);
if (m_sample)
{
if (shift)
m_sample->removeTile(m_hitPos);
else
m_sample->buildTile(m_hitPos);
}
}
示例2: handleMenu
virtual void handleMenu()
{
imguiLabel("Create Tiles");
if (imguiButton("Create All"))
{
if (m_sample)
m_sample->buildAllTiles();
}
if (imguiButton("Remove All"))
{
if (m_sample)
m_sample->removeAllTiles();
}
}
示例3: handleMenu
virtual void handleMenu()
{
imguiLabel("Create Tiles");
if (imguiButton("Create All"))
{
if (m_sample)
m_sample->buildAllTiles();
}
if (imguiButton("Remove All"))
{
if (m_sample)
m_sample->removeAllTiles();
}
imguiValue("Click LMB to create a tile.");
imguiValue("Shift+LMB to remove a tile.");
}
示例4: handleRenderOverlay
virtual void handleRenderOverlay(double* proj, double* model, int* view)
{
GLdouble x, y, z;
if (m_hitPosSet && gluProject((GLdouble)m_hitPos[0], (GLdouble)m_hitPos[1], (GLdouble)m_hitPos[2],
model, proj, view, &x, &y, &z))
{
int tx=0, ty=0;
m_sample->getTilePos(m_hitPos, tx, ty);
char text[32];
snprintf(text,32,"(%d,%d)", tx,ty);
imguiDrawText((int)x, (int)y-25, IMGUI_ALIGN_CENTER, text, imguiRGBA(0,0,0,220));
}
}
示例5: handleRenderOverlay
virtual void handleRenderOverlay(double* proj, double* model, int* view)
{
GLdouble x, y, z;
if (m_hitPosSet && gluProject((GLdouble)m_hitPos[0], (GLdouble)m_hitPos[1], (GLdouble)m_hitPos[2],
model, proj, view, &x, &y, &z))
{
int tx=0, ty=0;
m_sample->getTilePos(m_hitPos, tx, ty);
char text[32];
snprintf(text,32,"(%d,%d)", tx,ty);
imguiDrawText((int)x, (int)y-25, IMGUI_ALIGN_CENTER, text, imguiRGBA(0,0,0,220));
}
// Tool help
const int h = view[3];
imguiDrawText(280, h-40, IMGUI_ALIGN_LEFT, "LMB: Rebuild hit tile. Shift+LMB: Clear hit tile.", imguiRGBA(255,255,255,192));
}
示例6: handleRender
virtual void handleRender()
{
if (m_hitPosSet)
{
const float s = m_sample->getAgentRadius();
glColor4ub(0,0,0,128);
glLineWidth(2.0f);
glBegin(GL_LINES);
glVertex3f(m_hitPos[0]-s,m_hitPos[1]+0.1f,m_hitPos[2]);
glVertex3f(m_hitPos[0]+s,m_hitPos[1]+0.1f,m_hitPos[2]);
glVertex3f(m_hitPos[0],m_hitPos[1]-s+0.1f,m_hitPos[2]);
glVertex3f(m_hitPos[0],m_hitPos[1]+s+0.1f,m_hitPos[2]);
glVertex3f(m_hitPos[0],m_hitPos[1]+0.1f,m_hitPos[2]-s);
glVertex3f(m_hitPos[0],m_hitPos[1]+0.1f,m_hitPos[2]+s);
glEnd();
glLineWidth(1.0f);
}
}