Camera locking when its transform is locked (#5996)

* Locking the camera when its entity transform is locked

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Added function to unposses camera when transform locks

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Basic camera behaviour

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Addressed codereview suggestions

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>
This commit is contained in:
AMZN-Igarri
2021-11-30 10:39:07 +01:00
committed by GitHub
parent 3922280cec
commit 271004635c
3 changed files with 23 additions and 2 deletions
@@ -70,6 +70,9 @@ namespace Camera
//! Used by the Editor to disable undesirable camera changes in edit mode.
void SetShouldActivateFunction(AZStd::function<bool()> shouldActivateFunction);
//! Defines a callback for determining whether this camera is currently locked by its transform.
void SetIsLockedFunction(AZStd::function<bool()> isLockedFunction);
// Controller interface
static void Reflect(AZ::ReflectContext* context);
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
@@ -136,5 +139,6 @@ namespace Camera
bool m_isActiveView = false;
AZStd::function<bool()> m_shouldActivateFn;
AZStd::function<bool()> m_isLockedFn = []{ return false; };
};
} // namespace Camera