本文整理汇总了C++中Bound::Center方法的典型用法代码示例。如果您正苦于以下问题:C++ Bound::Center方法的具体用法?C++ Bound::Center怎么用?C++ Bound::Center使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bound
的用法示例。
在下文中一共展示了Bound::Center方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitialize
//----------------------------------------------------------------------------
bool EnvironmentMaps::OnInitialize ()
{
if ( !Application::OnInitialize() )
return false;
if ( !Setup() )
return true;
m_spkScene->UpdateGS(0.0f);
Bound kWBound = m_spkScene->WorldBound();
m_spkTrnNode->Translate() = -kWBound.Center();
ms_spkCamera->SetFrustum(1.0f,10000.0f,-0.55f,0.55f,0.4125f,-0.4125f);
Vector3f kCLeft(0.0f,0.0f,-1.0f);
Vector3f kCUp(0.0f,1.0f,0.0f);
Vector3f kCDir(1.0f,0.0f,0.0f);
Vector3f kCLoc = -3.0f*kWBound.Radius()*kCDir;
ms_spkCamera->SetFrame(kCLoc,kCLeft,kCUp,kCDir);
// initial update of objects
ms_spkCamera->Update();
m_spkScene->UpdateGS(0.0f);
m_spkScene->UpdateRS();
m_spkMotionObject = m_spkScene;
m_fTrnSpeed = 1.0f;
m_fRotSpeed = 0.01f;
m_bTurretActive = true;
SetTurretAxes();
m_bInitialized = true;
return true;
}
示例2: OnInitialize
//----------------------------------------------------------------------------
bool Rope::OnInitialize ()
{
if ( !Application::OnInitialize() )
return false;
CreateScene();
// center-and-fit for camera viewing
m_spkScene->UpdateGS(0.0f);
Bound kWBound = m_spkScene->WorldBound();
m_spkTrnNode->Translate() = -kWBound.Center();
ms_spkCamera->SetFrustum(1.0f,100.0f,-0.55f,0.55f,0.4125f,-0.4125f);
Vector3f kCLeft(1.0f,0.0f,0.0f);
Vector3f kCUp(0.0f,0.0f,1.0f);
Vector3f kCDir(0.0f,-1.0f,0.0f);
Vector3f kCLoc = -3.0f*kWBound.Radius()*kCDir - 0.5f*kCUp;
ms_spkCamera->SetFrame(kCLoc,kCLeft,kCUp,kCDir);
// initial update of objects
ms_spkCamera->Update();
m_spkScene->UpdateGS(0.0f);
m_spkScene->UpdateRS();
// camera turret and tumble mode
m_spkMotionObject = m_spkScene;
m_fTrnSpeed = 0.01f;
m_fRotSpeed = 0.01f;
m_bTurretActive = true;
SetTurretAxes();
return true;
}
示例3: OnInitialize
//----------------------------------------------------------------------------
bool WaterDropFormation::OnInitialize ()
{
if ( !Application::OnInitialize() )
return false;
// create scene
m_spkScene = new Node;
m_spkTrnNode = new Node(3);
m_spkScene->AttachChild(m_spkTrnNode);
CreatePlane();
CreateWall();
CreateWaterRoot();
// wireframe
m_spkWireframe = new WireframeState;
m_spkScene->SetRenderState(m_spkWireframe);
// depth buffer
ZBufferState* pkZBuffer = new ZBufferState;
pkZBuffer->Enabled() = true;
pkZBuffer->Writeable() = true;
pkZBuffer->Compare() = ZBufferState::CF_LEQUAL;
m_spkScene->SetRenderState(pkZBuffer);
Configuration0();
// center-and-fit for camera viewing
m_spkScene->UpdateGS(0.0f);
Bound kWBound = m_spkScene->WorldBound();
m_spkTrnNode->Translate() = -kWBound.Center();
ms_spkCamera->SetFrustum(0.1f,1000.0f,-0.055f,0.055f,0.04125f,-0.04125f);
float fAngle = 0.01f*Mathf::PI;
float fCos = Mathf::Cos(fAngle), fSin = Mathf::Sin(fAngle);
Vector3f kCUp(fSin,0.0f,-fCos);
Vector3f kCDir(-fCos,0.0f,-fSin);
Vector3f kCLeft(0.0f,1.0f,0.0f);
Vector3f kCLoc = -0.9f*kWBound.Radius()*kCDir;
ms_spkCamera->SetFrame(kCLoc,kCLeft,kCUp,kCDir);
// initial update of objects
ms_spkCamera->Update();
m_spkScene->UpdateGS(0.0f);
m_spkScene->UpdateRS();
m_spkMotionObject = m_spkScene;
m_bTurretActive = true;
SetTurretAxes();
m_fTrnSpeed = 0.01f;
m_fRotSpeed = 0.001f;
m_fLastSeconds = GetTimeInSeconds();
return true;
}
示例4: OnInitialize
//----------------------------------------------------------------------------
bool WrigglingSnake::OnInitialize ()
{
if ( !Application::OnInitialize() )
return false;
m_spkScene = new Node(1);
m_spkTrnNode = new Node(1);
m_spkScene->AttachChild(m_spkTrnNode);
m_spkWireframe = new WireframeState;
m_spkScene->SetRenderState(m_spkWireframe);
ZBufferState* pkZBuffer = new ZBufferState;
pkZBuffer->Enabled() = true;
pkZBuffer->Writeable() = true;
pkZBuffer->Compare() = ZBufferState::CF_LEQUAL;
m_spkScene->SetRenderState(pkZBuffer);
CreateSnake();
// center-and-fit for camera viewing
m_spkScene->UpdateGS(0.0f);
Bound kWBound = m_spkScene->WorldBound();
m_spkTrnNode->Translate() = -kWBound.Center();
ms_spkCamera->SetFrustum(1.0f,100.0f,-0.55f,0.55f,0.4125f,-0.4125f);
Vector3f kCLeft(1.0f,0.0f,0.0f);
Vector3f kCUp(0.0f,0.0f,1.0f);
Vector3f kCDir(0.0f,-1.0f,0.0f);
Vector3f kCLoc = -3.0f*kWBound.Radius()*kCDir;
ms_spkCamera->SetFrame(kCLoc,kCLeft,kCUp,kCDir);
// initial update of objects
ms_spkCamera->Update();
m_spkScene->UpdateGS(0.0f);
m_spkScene->UpdateRS();
// camera turret and tumble mode
m_spkMotionObject = m_spkScene;
m_fTrnSpeed = 0.01f;
m_fRotSpeed = 0.001f;
m_bTurretActive = true;
SetTurretAxes();
return true;
}