Add an Orthogonal Projection option to the Camera Gem (#2414)
* Add an Orthogonal Projection option to the Camera Gem This adds a check-box to opt into an ortho projection along with a half-width parameter to adjust the size of the visible area. Includes some light tweaks to ensure debug rendering looks OK and that we generate a correct camera state for these non-perspective views. Known issue: while in "Be this camera" mode in the Editor using an ortho projection manipulators aren't working correctly. This appears to be a downstream issue with CameraState consumers not actually checking the ortho flag. Signed-off-by: nvsickle <nvsickle@amazon.com> * Fix some typos Signed-off-by: nvsickle <nvsickle@amazon.com> * Account for reversed depth buffer Signed-off-by: nvsickle <nvsickle@amazon.com> * Clarify depth reversal for MakeOrthographicMatrixRH Signed-off-by: nvsickle <nvsickle@amazon.com>
This commit is contained in:
committed by
GitHub
parent
e81f59d1e1
commit
7f84a4318c
@@ -185,6 +185,15 @@ namespace AZ
|
||||
return m_componentConfig.m_depthFar * tanf(m_componentConfig.m_fovY / 2) * 2;
|
||||
}
|
||||
|
||||
bool CameraComponent::IsOrthographic()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
float CameraComponent::GetOrthographicHalfWidth()
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void CameraComponent::SetFovDegrees(float fov)
|
||||
{
|
||||
@@ -226,6 +235,16 @@ namespace AZ
|
||||
UpdateViewToClipMatrix();
|
||||
}
|
||||
|
||||
void CameraComponent::SetOrthographic(bool orthographic)
|
||||
{
|
||||
AZ_Assert(!orthographic, "DebugCamera does not support orthographic projection");
|
||||
}
|
||||
|
||||
void CameraComponent::SetOrthographicHalfWidth([[maybe_unused]] float halfWidth)
|
||||
{
|
||||
AZ_Assert(false, "DebugCamera does not support orthographic projection");
|
||||
}
|
||||
|
||||
void CameraComponent::MakeActiveView()
|
||||
{
|
||||
// do nothing
|
||||
|
||||
Reference in New Issue
Block a user