API Documentation
Loading...
Searching...
No Matches
ViewportAutoZoomFocus.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/AutoZoomFocus.h>
3#include <NDEVR/TimeSpan.h>
4#include <NDEVR/UUID.h>
5#include <NDEVR/Buffer.h>
6#include <NDEVR/Bounds.h>
7#include <NDEVR/Angle.h>
8namespace NDEVR
9{
10 /**--------------------------------------------------------------------------------------------------
11 \brief Logic for automatically zooming a Camera or Viewport to a certain location or having certain objects in focus of the frame.
12 **/
14 {
16 AutoZoomFocus(const UUID& model)
17 : targets({ model })
18 {};
20 : targets(models)
21 {};
23 : snap(focus)
24 {};
26 : targets(models)
27 , snap(focus)
28 {};
29 AutoZoomFocus(SnapLocation focus, const UUID& model)
30 : targets({ model })
31 , snap(focus)
32 {};
43 bool operator==(const AutoZoomFocus& layout) const
44 {
45 if (layout.targets != targets)
46 return false;
47 if (memcmp(&layout.bounds, &layout, sizeof(Bounds<3, fltp08>)) != 0)
48 return false;
49 if (layout.angle_offsets != angle_offsets)
50 return false;
52 return false;
54 return false;
55 if (layout.snap != snap)
56 return false;
58 return false;
59 if (layout.lag_time != lag_time)
60 return false;
61 if (layout.grip_tolerance != grip_tolerance)
62 return false;
64 return false;
65 return true;
66 }
67 bool operator!=(const AutoZoomFocus& layout) const
68 {
69 return !(layout == *this);
70 }
79 Angle<fltp08> grip_tolerance = Angle<fltp08>(DEGREES, 0.5);//can help prevent camera jitter
80 fltp08 bounds_edge_tolerance_mult = 0.25;//can help prevent camera jitter
81 fltp08 bounds_center_tolerance = 1.0;//can help prevent camera jitter
82 bool use_true_extents = true;
83 bool clear_animations = true;
87 };
88}
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:540
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
SnapLocation
A list of directions that a view can be pointed relative to an object or scene.
Definition ViewLocation.h:40
@ DEGREES
Definition Angle.h:58
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Logic for automatically zooming a Camera or Viewport to a certain location or having certain objects ...
Definition ViewportAutoZoomFocus.h:14
AutoZoomFocus(SnapLocation focus, const Buffer< UUID > &models)
Definition ViewportAutoZoomFocus.h:25
Bounds< 3, fltp08 > bounds
Definition ViewportAutoZoomFocus.h:72
AutoZoomFocus(SnapLocation focus)
Definition ViewportAutoZoomFocus.h:22
AutoZoomFocus(const UUID &model)
Definition ViewportAutoZoomFocus.h:16
bool override_camera_lock_visible
Definition ViewportAutoZoomFocus.h:84
bool clear_animations
Definition ViewportAutoZoomFocus.h:83
fltp08 bounds_edge_tolerance_mult
Definition ViewportAutoZoomFocus.h:80
fltp08 zoom_bounds_expansion
Definition ViewportAutoZoomFocus.h:77
Angle< fltp08 > grip_tolerance
Definition ViewportAutoZoomFocus.h:79
bool override_camera_lock_invisible
Definition ViewportAutoZoomFocus.h:85
bool operator==(const AutoZoomFocus &layout) const
Definition ViewportAutoZoomFocus.h:43
TimeSpan lag_time
Definition ViewportAutoZoomFocus.h:78
Vector< 3, fltp08 > transformed_offsets
Definition ViewportAutoZoomFocus.h:74
AutoZoomFocus()
Definition ViewportAutoZoomFocus.h:15
bool override_default_snap
Definition ViewportAutoZoomFocus.h:86
bool operator!=(const AutoZoomFocus &layout) const
Definition ViewportAutoZoomFocus.h:67
AutoZoomFocus(SnapLocation focus, const UUID &model)
Definition ViewportAutoZoomFocus.h:29
Vector< 3, Angle< fltp08 > > angle_offsets
Definition ViewportAutoZoomFocus.h:73
Vector< 3, fltp08 > worldspace_offsets
Definition ViewportAutoZoomFocus.h:75
SnapLocation snap
Definition ViewportAutoZoomFocus.h:76
fltp08 bounds_center_tolerance
Definition ViewportAutoZoomFocus.h:81
Buffer< UUID > targets
Definition ViewportAutoZoomFocus.h:71
void clear()
Definition ViewportAutoZoomFocus.h:33
AutoZoomFocus(const Buffer< UUID > &models)
Definition ViewportAutoZoomFocus.h:19
bool use_true_extents
Definition ViewportAutoZoomFocus.h:82
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233