本文整理汇总了C++中CCamera::GetAbsPos方法的典型用法代码示例。如果您正苦于以下问题:C++ CCamera::GetAbsPos方法的具体用法?C++ CCamera::GetAbsPos怎么用?C++ CCamera::GetAbsPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCamera
的用法示例。
在下文中一共展示了CCamera::GetAbsPos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawSky
void CSkyBox::DrawSky( Vector3f vSunDir, bool bReflection)
{
#if 0
if( !m_bSkyLoaded )
return;
m_pShader->Enable();
glDepthRange(1.0, 1.0);
GetGLStateSaver()->Enable(GL_DEPTH_TEST);
GetGLStateSaver()->DepthFunc(GL_EQUAL);
glDepthMask( GL_FALSE );
GetGLStateSaver()->Enable( GL_TEXTURE_2D );
GetMVStack().PushMatrix();
Vector3f vCamPos = g_RenderInterf->GetRenderer()->GetActiveCam()->GetAbsPos();
if( bReflection )
vCamPos.y = -vCamPos.y + g_RenderInterf->GetRenderer()->GetWaterHeight() * 2.0f;
GetMVStack().Translate( vCamPos );
GetShaderManager()->GetActiveShader()->UpdateMatrices();
float d = 1000.0f;
//Skybox vertexes:
float verts[] = {
//Right Face
1.0f, 1.0f, d, d, -d, //Top Left
1.0f, 0.0f, d, -d, -d, //Bottom Left
0.0f, 0.0f, d, -d, d, //Bottom Right
0.0f, 1.0f, d, d, d, //Top Right
//Left Face
1.0f, 1.0f, -d, d, d, //Top Left
1.0f, 0.0f, -d, -d, d, //Bottom Left
0.0f, 0.0f, -d, -d, -d, //Bottom Right
0.0f, 1.0f, -d, d, -d, //Top Right
//Up Face
0.0f, 1.0f, -d, d, d, //Top Left
0.0f, 0.0f, -d, d, -d, //Bottom Left
1.0f, 0.0f, d, d, -d, //Bottom Right
1.0f, 1.0f, d, d, d, //Top Right
//Down Face
1.0f, 1.0f, -d, -d, -d, //Top Left
1.0f, 0.0f, -d, -d, d, //Bottom Left
0.0f, 0.0f, d, -d, d, //Bottom Right
0.0f, 1.0f, d, -d, -d, //Top Right
//Back Face
1.0f, 1.0f, d, d, d, //Top Left
1.0f, 0.0f, d, -d, d, //Bottom Left
0.0f, 0.0f, -d, -d, d, //Bottom Right
0.0f, 1.0f, -d, d, d, //Top Right
//Front Face
1.0f, 1.0f,-d, d, -d, //Top Left
1.0f, 0.0f, -d, -d, -d, //Bottom Left
0.0f, 0.0f, d, -d, -d, //Bottom Right
0.0f, 1.0f, d, d, -d, //Top Right
};
rglPushClientAttrib( GL_CLIENT_VERTEX_ARRAY_BIT );
init_vertexbuffer_vars_uvcoord_pos( verts );
for( int i = 0; i < 6; i++ )
{
glBindTexture( GL_TEXTURE_2D, m_SkyTexs[i].index );
glDrawArrays( GL_QUADS, i*4, 4 );
}
rglPopClientAttrib();
GetMVStack().PopMatrix();
glDepthMask( GL_TRUE ); //Re-Enable Z-Buffer
GetGLStateSaver()->DepthFunc(GL_LESS);
glDepthRange(0.0, 1.0);
#else
if( !m_bSkyLoaded )
return;
m_pShaderSky->Enable();
m_pShaderSky->SetBrightness(render_sky_brightness.GetFloat());
glDepthRange(1.0, 1.0);
GetGLStateSaver()->Enable(GL_DEPTH_TEST);
GetGLStateSaver()->DepthFunc(GL_EQUAL);
glDepthMask( GL_FALSE );
GetGLStateSaver()->Enable( GL_TEXTURE_2D );
CCamera *cam = g_RenderInterf->GetRenderer()->GetActiveCam();
GetMVStack().PushMatrix();
GetMVStack().Translate( cam->GetAbsPos() );
//GetMVStack().Rotate(cam->GetAbsAngles().GetConjugate());
m_pShaderSky->UpdateMatrices();
float d = 1000.0f;
//.........这里部分代码省略.........