Ensure camera system correctly consumes events when it is active (#2346)
* add typename for struct initializer Signed-off-by: hultonha <hultonha@amazon.co.uk> * fix for ensuring while the camera is 'active', events are consumed and not propagated Signed-off-by: hultonha <hultonha@amazon.co.uk> * refactor how we decide which priority to repsond to events to Signed-off-by: hultonha <hultonha@amazon.co.uk> * also -> only Signed-off-by: hultonha <hultonha@amazon.co.uk>
This commit is contained in:
@@ -147,7 +147,9 @@ namespace AzFramework
|
||||
m_scrollDelta = scroll->m_delta;
|
||||
}
|
||||
|
||||
return m_cameras.HandleEvents(event, m_motionDelta, m_scrollDelta);
|
||||
m_handlingEvents = m_cameras.HandleEvents(event, m_motionDelta, m_scrollDelta);
|
||||
|
||||
return m_handlingEvents;
|
||||
}
|
||||
|
||||
Camera CameraSystem::StepCamera(const Camera& targetCamera, const float deltaTime)
|
||||
|
||||
@@ -262,12 +262,14 @@ namespace AzFramework
|
||||
public:
|
||||
bool HandleEvents(const InputEvent& event);
|
||||
Camera StepCamera(const Camera& targetCamera, float deltaTime);
|
||||
bool HandlingEvents() const { return m_handlingEvents; }
|
||||
|
||||
Cameras m_cameras; //!< Represents a collection of camera inputs that together provide a camera controller.
|
||||
|
||||
private:
|
||||
ScreenVector m_motionDelta; //!< The delta used for look/orbit/pan (rotation + translation) - two dimensional.
|
||||
float m_scrollDelta = 0.0f; //!< The delta used for dolly/movement (translation) - one dimensional.
|
||||
bool m_handlingEvents = false; //!< Is the camera system currently handling events (events are consumed and not propagated).
|
||||
};
|
||||
|
||||
//! A camera input to handle motion deltas that can rotate or orbit the camera.
|
||||
|
||||
Reference in New Issue
Block a user