MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ bind_viewport_preset() [1/2]

MAYAFLUX_API void MayaFlux::bind_viewport_preset ( const std::shared_ptr< Core::Window > &  window,
const std::shared_ptr< Buffers::RenderProcessor > &  processor,
ViewportPresetMode  mode = ViewportPresetMode::Fly,
const std::string &  name = "default" 
)

Bind a navigation preset to a window and render processor using default settings.

Convenience wrapper that constructs a default config for the selected mode and forwards to the corresponding bind_*_preset function. To tune the controller, call bind_fly_preset(), bind_orbit_preset(), or bind_pan_zoom_preset() directly.

Registers event handlers under the prefix "vp_<name>_".

Mode defaults: Fly - WASD/QE translate, RMB drag yaw/pitch, scroll dolly, KP ortho snaps Orbit - MMB rotate around focal point, Shift+MMB pan, scroll dolly, KP ortho snaps PanZoom2D - MMB drag pan, scroll zoom, orthographic projection

Parameters
windowWindow supplying input events
processorRenderProcessor that receives the ViewTransform source
modeNavigation controller to install, defaults to Fly
nameUnique prefix for registered events; must be unique per window

Definition at line 34 of file ViewportPreset.cpp.

39{
40 switch (mode) {
41 case ViewportPresetMode::Fly:
42 bind_fly_preset(window, processor, {}, {}, name);
43 return;
44 case ViewportPresetMode::Orbit:
45 bind_orbit_preset(window, processor, {}, {}, name);
46 return;
47 case ViewportPresetMode::PanZoom2D:
48 bind_pan_zoom_preset(window, processor, {}, {}, name);
49 return;
50 case ViewportPresetMode::Screenspace:
51 bind_screenspace_preset(window, processor, {}, {}, name);
52 default:
53 MF_RT_ERROR(Journal::Component::API, Journal::Context::EventDispatch,
54 "ViewportPresetMode {} is not yet implemented",
55 static_cast<int>(mode));
56 }
57}
#define MF_RT_ERROR(comp, ctx,...)
void bind_screenspace_preset(const std::shared_ptr< Core::Window > &window, const std::shared_ptr< Buffers::RenderProcessor > &processor, const Kinesis::NavigationConfig &config, const Kinesis::ScreenspaceKeyMap &key_map, const std::string &name)
Bind the screenspace navigation controller to a window and render processor.
void bind_pan_zoom_preset(const std::shared_ptr< Core::Window > &window, const std::shared_ptr< Buffers::RenderProcessor > &processor, const Kinesis::PanZoom2DConfig &config, const Kinesis::PanZoom2DKeyMap &key_map, const std::string &name)
Bind the 2D pan/zoom controller to a window and render processor.
void bind_orbit_preset(const std::shared_ptr< Core::Window > &window, const std::shared_ptr< Buffers::RenderProcessor > &processor, const Kinesis::OrbitConfig &config, const Kinesis::OrbitKeyMap &key_map, const std::string &name)
Bind the orbit navigation controller to a window and render processor.
void bind_fly_preset(const std::shared_ptr< Core::Window > &window, const std::shared_ptr< Buffers::RenderProcessor > &processor, const ViewportPresetConfig &config, const Kinesis::FlyKeyMap &key_map, const std::string &name)
Bind the fly navigation controller to a window and render processor.

References MayaFlux::Journal::API, bind_fly_preset(), bind_orbit_preset(), bind_pan_zoom_preset(), bind_screenspace_preset(), MayaFlux::Journal::EventDispatch, Fly, MF_RT_ERROR, Orbit, PanZoom2D, and Screenspace.

Referenced by bind_viewport_preset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: