Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/tools/atlas/GameInterface/ActorViewer.cpp
Show First 20 Lines • Show All 505 Lines • ▼ Show 20 Lines | void ActorViewer::Render() | ||||
g_Renderer.BeginFrame(); | g_Renderer.BeginFrame(); | ||||
// Find the centre of the interesting region, in the middle of the patch | // Find the centre of the interesting region, in the middle of the patch | ||||
// and half way up the model (assuming there is one) | // and half way up the model (assuming there is one) | ||||
CVector3D centre; | CVector3D centre; | ||||
CmpPtr<ICmpVisual> cmpVisual(m.Simulation2, m.Entity); | CmpPtr<ICmpVisual> cmpVisual(m.Simulation2, m.Entity); | ||||
if (cmpVisual) | if (cmpVisual) | ||||
cmpVisual->GetBounds().GetCentre(centre); | cmpVisual->GetBounds().GetCenter(centre); | ||||
else | else | ||||
centre.Y = 0.f; | centre.Y = 0.f; | ||||
centre.X = centre.Z = TERRAIN_TILE_SIZE * m.Terrain.GetPatchesPerSide()*PATCH_SIZE/2; | centre.X = centre.Z = TERRAIN_TILE_SIZE * m.Terrain.GetPatchesPerSide()*PATCH_SIZE/2; | ||||
CCamera camera = AtlasView::GetView_Actor()->GetCamera(); | CCamera camera = AtlasView::GetView_Actor()->GetCamera(); | ||||
camera.m_Orientation.Translate(centre.X, centre.Y, centre.Z); | camera.m_Orientation.Translate(centre.X, centre.Y, centre.Z); | ||||
camera.UpdateFrustum(); | camera.UpdateFrustum(); | ||||
Show All 35 Lines |
Wildfire Games · Phabricator