Camera Component, Editor Viewport Widget refactoring.

- Handle changing of active camera entirely inside CameraComponentController
- Remove a LOT of legacy Cry things related to cameras
- Add a CameraSystemComponent to handle ActiveCameraRequestBus and CameraSystemRequestBus

Signed-off-by: Yuriy Toporovskyy <toporovskyy.y@gmail.com>
This commit is contained in:
Yuriy Toporovskyy
2021-08-04 10:39:57 -04:00
parent 6d2765ef42
commit 73fee0c57e
47 changed files with 1126 additions and 6046 deletions
+11 -8
View File
@@ -161,16 +161,19 @@ void CCommentNodeAnimator::Render(CTrackViewAnimNode* pNode, [[maybe_unused]] co
Vec2 CCommentNodeAnimator::GetScreenPosFromNormalizedPos(const Vec2& unitPos)
{
const CCamera& cam = gEnv->pSystem->GetViewCamera();
float width = (float)cam.GetViewSurfaceX();
int height = cam.GetViewSurfaceZ();
float fAspectRatio = gSettings.viewports.fDefaultAspectRatio;
float camWidth = height * fAspectRatio;
(void)unitPos;
AZ_Error("CryLegacy", false, "CCommentNodeAnimator::GetScreenPosFromNormalizedPos not supported");
return Vec2(0, 0);
//const CCamera& cam = gEnv->pSystem->GetViewCamera();
//float width = (float)cam.GetViewSurfaceX();
//int height = cam.GetViewSurfaceZ();
//float fAspectRatio = gSettings.viewports.fDefaultAspectRatio;
//float camWidth = height * fAspectRatio;
float x = 0.5f * width + 0.5f * camWidth * unitPos.x;
float y = 0.5f * height * (1.f - unitPos.y);
//float x = 0.5f * width + 0.5f * camWidth * unitPos.x;
//float y = 0.5f * height * (1.f - unitPos.y);
return Vec2(x, y);
//return Vec2(x, y);
}
void CCommentNodeAnimator::DrawText(const char* szFontName, float fSize, const Vec2& unitPos, const ColorF col, const char* szText, int align)