本文整理汇总了C++中WorldState::GetCurrentMap方法的典型用法代码示例。如果您正苦于以下问题:C++ WorldState::GetCurrentMap方法的具体用法?C++ WorldState::GetCurrentMap怎么用?C++ WorldState::GetCurrentMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldState
的用法示例。
在下文中一共展示了WorldState::GetCurrentMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateCamera
void CreateCamera(int width, int height, vector3df position, vector3df target)
{
//Build camera
ISceneManager* sm = g_GameGraph->GetSceneManager();
WorldState* worldState =
static_cast<WorldState*> (g_GameGraph->GetWorldState());
HexMap* hm = worldState->GetCurrentMap();
if (NULL != sm)
{
if (NULL != hm)
{
ICameraSceneNode* orthoCam = sm->addCameraSceneNode(
sm->getRootSceneNode(), position, target);
matrix4 projMat;
projMat.buildProjectionMatrixOrthoLH(width, height, -5, 5);
orthoCam->setProjectionMatrix(projMat, true);
orthoCam->bindTargetAndRotation(true);
if (orthoCam->isOrthogonal())
{
CameraAnimator* cameraAnim = new CameraAnimator(position, width,
height, hm->GetMapDimensions().Height,
hm->GetMapDimensions().Width, worldState->GetHero(),
hm->GetCoordinateTranslator());
orthoCam->addAnimator(cameraAnim);
cameraAnim->drop();
cameraAnim = NULL;
if (width > height)
{
LOGI("Creating a landscape camera.");
landscapeCamera = orthoCam;
}
else
{
LOGI("Creating a portrait camera");
portraitCamera = orthoCam;
}
}
else
{
LOGE("The created camera is not orthoganol, something is wrong with the perspective matrix.");
}
}
else
{
LOGE("The hex map created in the WorldState is NULL.");
}
}
else
{
LOGE("The scene manager cannot be loaded from the device.");
}
}