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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user