本文整理汇总了C++中IObject::GetClass方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::GetClass方法的具体用法?C++ IObject::GetClass怎么用?C++ IObject::GetClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObject
的用法示例。
在下文中一共展示了IObject::GetClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
void CAppBase::Render()
{
// SDL_SysWMinfo wmi = { 0 };
// SDL_GetWMInfo(&wmi);
// SetWindowPos(wmi.window, HWND_TOPMOST, NULL, NULL, NULL, NULL, SWP_NOREPOSITION |SWP_NOSIZE);
CCamera Camera;
Camera.SetViewportDims(CVec2i(GetVideo()->GetWidth(), GetVideo()->GetHeight()));
GetRender()->SetCamera(&Camera);
CVec3f vDirection;
vDirection.Point(g_fAzimuth, g_fElevation);
Camera.SetDirection(-vDirection);
CVec3f vPosition(0,0,0);
vDirection *= g_fZoom;
Camera.SetPosition(vPosition+vDirection+CVec3f(160,0,160));
// Camera.SetFOV(60.0f);
// Camera.SetAspectRatio(4.0f/3.0f);
static ITube* s_pTube = NULL;
if ( !s_pTube )
{
s_pTube = ITube::Create();
s_pTube->SetShader("shaders/tube.shader");
CVec3f vPoint(0,0,0);
for ( int i = 0 ; i < 100 ; ++i )
{
s_pTube->AddControlPoint(CVec3f(160+20.0f*sin(float(i)/10.0f), i, (160+20.0f*cos(float(i)/10.0f))));
}
}
GetRender()->BeginProjection(eProjectionPerspective);
{
GetRender()->BeginRenderPass(eRenderPassAccum);
{
GetScene()->Render3d();
GetRender()->RenderTube(s_pTube);
}
GetRender()->EndRenderPass(eRenderPassAccum);
GetRender()->BeginRenderPass(eRenderPassNormal);
{
GetScene()->Render3d();
GetRender()->RenderTube(s_pTube);
static bool once = true;
static CVec3f vSrc;
static CVec3f vDest;
// if ( once )
{
vSrc = GetRender()->Unproject(NULL, g_vMousePos, 10.0f);
vDest = GetRender()->Unproject(NULL, g_vMousePos, 10000.0f);
once=false;
}
CVec3f vDir = vDest-vSrc; vDir.Normalize();
IObject* pObject = NULL;
if ( pObject = GetScene()->PickObject(vSrc, vDir) )
{
Debug("Picked %s", pObject->GetClass()->GetClassDef()->GetName().c_str());
}
CPlane3f plane(CVec3f(0,1,0), 0.0f);
if ( plane.IntersectRay(CRay3f(vSrc, vDir), &g_vCursor3d) )
{
// Debug("x,y,z = %f,%f,%f", g_vCursor3d.x, g_vCursor3d.y, g_vCursor3d.z);
}
else
{
// Debug("...");
}
// GetRender()->RenderLine(CVec3f(160,0,160), vDest, CRGBA(255,255,0,255));
// GetRender()->RenderLine(CVec3f(0,0,0), vDest, CRGBA(0,255,0,255));
// GetRender()->RenderModelSkinned(&s_ModelSkinned);
}
GetRender()->EndRenderPass(eRenderPassNormal);
}
GetRender()->EndProjection(eProjectionPerspective);
GetRender()->BeginProjection(eProjectionOrtho);
{
GetUi()->Render();
}
GetRender()->EndProjection(eProjectionOrtho);
GetRender()->SetCamera(NULL);
GetRender()->Swap();
}