Camera fixes follow-up (#5703)
* allow unconstrained camera when tracking transform and fix some camera interpolation issues Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * tests for interpolation fixes Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add test for camera constraints change Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * updates following review feeedback Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9f9aa8f2a6
commit
593f03efb4
+2
-1
@@ -112,7 +112,8 @@ namespace AtomToolsFramework
|
||||
void UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) override;
|
||||
|
||||
// ModularViewportCameraControllerRequestBus overrides ...
|
||||
void InterpolateToTransform(const AZ::Transform& worldFromLocal) override;
|
||||
bool InterpolateToTransform(const AZ::Transform& worldFromLocal) override;
|
||||
bool IsInterpolating() const override;
|
||||
void StartTrackingTransform(const AZ::Transform& worldFromLocal) override;
|
||||
void StopTrackingTransform() override;
|
||||
bool IsTrackingTransform() const override;
|
||||
|
||||
+8
-1
@@ -23,13 +23,20 @@ namespace AtomToolsFramework
|
||||
class ModularViewportCameraControllerRequests : public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
static inline constexpr float InterpolateToTransformDuration = 1.0f;
|
||||
|
||||
using BusIdType = AzFramework::ViewportId;
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
|
||||
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
|
||||
//! Begin a smooth transition of the camera to the requested transform.
|
||||
//! @param worldFromLocal The transform of where the camera should end up.
|
||||
virtual void InterpolateToTransform(const AZ::Transform& worldFromLocal) = 0;
|
||||
//! @return Returns true if the call began an interpolation and false otherwise. Calls to InterpolateToTransform
|
||||
//! will have no effect if an interpolation is currently in progress.
|
||||
virtual bool InterpolateToTransform(const AZ::Transform& worldFromLocal) = 0;
|
||||
|
||||
//! Returns if the camera is currently interpolating to a new transform.
|
||||
virtual bool IsInterpolating() const = 0;
|
||||
|
||||
//! Start tracking a transform.
|
||||
//! Store the current camera transform and move to the next camera transform.
|
||||
|
||||
Reference in New Issue
Block a user