Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzFramework::MultiViewportController< TViewportControllerInstance, Priority > Class Template Reference

#include <MultiViewportController.h>

Inherits AzFramework::ViewportControllerInterface.

Public Member Functions

bool HandleInputChannelEvent (const ViewportControllerInputEvent &event) override
 
void ResetInputChannels () override
 
void UpdateViewport (const ViewportControllerUpdateEvent &event) override
 
void RegisterViewportContext (ViewportId viewport) override
 
void UnregisterViewportContext (ViewportId viewport) override
 
ViewportControllerPriority GetPriority () const override
 
virtual bool HandleInputChannelEvent (const ViewportControllerInputEvent &event)
 
virtual void ResetInputChannels ()
 
virtual void UpdateViewport (const ViewportControllerUpdateEvent &event)
 
virtual void RegisterViewportContext (ViewportId viewport)=0
 
virtual void UnregisterViewportContext (ViewportId viewport)=0
 
virtual ViewportControllerPriority GetPriority () const
 

Detailed Description

template<class TViewportControllerInstance, ViewportControllerPriority Priority = ViewportControllerPriority::Normal>
class AzFramework::MultiViewportController< TViewportControllerInstance, Priority >

MultiViewportController defines an interface for a many-to-many viewport controller interface that automatically assigns a specific TViewportControllerInstance to each registered viewport. Subclasses of MultiViewportController will be provided with one instance of TViewportControllerInstance per registered viewport, where TViewportControllerInstance must implement the interface of MultiViewportControllerInstance and provide a TViewportControllerInstance(ViewportId) constructor.

Parameters
TViewportControllerInstanceis the instance type of the controller, one shall be instantiated per registered viewport. This child should conform to the MultiViewportControllerInstanceInterface
Priorityis the priority at which this controller should be dispatched events. Input events may not be received if a higher prioririty controller consumes the event. To receive events at all priorities, DispatchToAllPriorities may be specified.

Member Function Documentation

◆ GetPriority()

template<class TViewportControllerInstance , ViewportControllerPriority Priority>
ViewportControllerPriority AzFramework::MultiViewportController< TViewportControllerInstance, Priority >::GetPriority
overridevirtual

Gets the priority at which this controller will receive input events. If set to DispatchToAllPriorities, the controller will receive events multiple times for each available priority level. This typically is only needed in the case of a list of other viewport controllers, each with their own priority (handled by ViewportControllerList for most cases).

Reimplemented from AzFramework::ViewportControllerInterface.

◆ HandleInputChannelEvent()

template<class TViewportControllerInstance , ViewportControllerPriority Priority>
bool AzFramework::MultiViewportController< TViewportControllerInstance, Priority >::HandleInputChannelEvent ( const ViewportControllerInputEvent event)
overridevirtual

Handles an input event dispatched to a given viewportContext.

Returns
A "handled" flag. If OnInputChannelEvent returns true, the event is considered handled and all further input handling in the containing ViewportControllerList halts.

Reimplemented from AzFramework::ViewportControllerInterface.

◆ RegisterViewportContext()

template<class TViewportControllerInstance , ViewportControllerPriority Priority>
void AzFramework::MultiViewportController< TViewportControllerInstance, Priority >::RegisterViewportContext ( ViewportId  viewport)
overridevirtual

Registers a ViewportContext to be handled by this controller. The controller will receive OnInputChannelEvent and OnUpdateViewport notifications for the viewports.

Implements AzFramework::ViewportControllerInterface.

◆ ResetInputChannels()

template<class TViewportControllerInstance , ViewportControllerPriority Priority>
void AzFramework::MultiViewportController< TViewportControllerInstance, Priority >::ResetInputChannels
overridevirtual

Called to notify this controller that its input state should be reset. This is called when input events, such as key up events, may have been missed and it should be assumed that all input channels are in their default (i.e. no buttons pressed or other input provided) state.

Reimplemented from AzFramework::ViewportControllerInterface.

◆ UnregisterViewportContext()

template<class TViewportControllerInstance , ViewportControllerPriority Priority>
void AzFramework::MultiViewportController< TViewportControllerInstance, Priority >::UnregisterViewportContext ( ViewportId  viewport)
overridevirtual

Unregisters a viewport from being handled by this controller. No further events will be received from this viewport after this is called.

Implements AzFramework::ViewportControllerInterface.

◆ UpdateViewport()

template<class TViewportControllerInstance , ViewportControllerPriority Priority>
void AzFramework::MultiViewportController< TViewportControllerInstance, Priority >::UpdateViewport ( const ViewportControllerUpdateEvent event)
overridevirtual

Updates the current state of the viewport. This should be used to update e.g. the camera transform and will be called every frame for each registered viewport.

Reimplemented from AzFramework::ViewportControllerInterface.


The documentation for this class was generated from the following files: