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:
Nicholas Van Sickle
2021-07-26 13:58:50 -07:00
committed by GitHub
parent e81f59d1e1
commit 7f84a4318c
12 changed files with 232 additions and 33 deletions
@@ -102,7 +102,7 @@ namespace Camera
using EditorCameraNotificationBus = AZ::EBus<EditorCameraNotifications>;
/**
* This bus is for requesting any camera-view-related changes
* This bus is for requesting any camera-view-related changes or information
*/
class EditorCameraViewRequests : public AZ::ComponentBus
{
@@ -115,6 +115,11 @@ namespace Camera
* Sets this camera as the active view in the scene, otherwise restores the default editor camera if it was already active
*/
virtual void ToggleCameraAsActiveView() = 0;
/**
* Gets the camera state associated with this view.
*/
virtual bool GetCameraState(AzFramework::CameraState& cameraState) = 0;
};
using EditorCameraViewRequestBus = AZ::EBus<EditorCameraViewRequests>;