NDEVR
API Documentation
Camera.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Design
28File: Camera
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Model.h>
34#include <NDEVR/SelectionInfo.h>
35#include <NDEVR/SnapLocation.h>
36#include <NDEVR/CameraBackground.h>
37#include <NDEVR/AutoZoomFocus.h>
38#include <NDEVR/CameraAnimation.h>
39#include <NDEVR/Resource.h>
40#include <NDEVR/Time.h>
41#include <NDEVR/TimeSpan.h>
42#include <NDEVR/BaseValues.h>
43#include <NDEVR/Vector.h>
44#include <NDEVR/Angle.h>
45#include <NDEVR/Set.h>
46#include <NDEVR/BasicResourceListener.h>
47#include <functional>
48#if NDEVR_VIEWPORT
49namespace NDEVR
50{
51 class ViewportFormat;
57 {
58 public:
67 ScreenshotRequest(std::function<void(const StringView& image_id)> callback)
69 {}
70
74 bool operator==(const ScreenshotRequest&) const
75 {
76 return false;
77 }
78
82 bool operator!=(const ScreenshotRequest&) const
83 {
84 return true;
85 }
86 std::function<void(const StringView& image_id)> callback;
87 };
88
94 class NDEVR_DESIGN_API Camera : public Model
95 {
96 public:
110
121
124 public:
129 Camera(const Model& camera);
134 Camera(const Camera& camera);
146 bool refreshMovement(const Time& current_time, const DesignObjectLookup* lookup = nullptr, const TimeSpan& time_out = TimeSpan(0.2));
152 void refreshFocusBounds(const DesignObjectLookup* lookup, TimeSpan animation_time);
161 void move(const Ray<3, fltp08>& distance);
167 void move(const Ray<3, fltp08>& distance, const CameraAnimation& original);
173 void zoom(fltp08 distance_mult, const CameraAnimation& original);
178 void moveForward(fltp08 distance);
183 void moveHorizontal(fltp08 distance);
188 void moveVertical(fltp08 distance);
194 void move(fltp08 horizontal_distance, fltp08 vertical_distance);
201 void move(fltp08 horizontal_distance, fltp08 vertical_distance, const CameraAnimation& original);
206 void lookHorizontal(fltp08 percent);
211 void lookVertical(fltp08 percent);
217 void look(fltp08 horz_percent, fltp08 vert_percent);
224 void look(fltp08 horz_percent, fltp08 vert_percent, const CameraAnimation& original);
229 void addObjectToVisible(const Model& model);
251 void movePercent(fltp08 horizontal_percent, fltp08 vertical_percent);
258 void movePercent(fltp08 horizontal_percent, fltp08 vertical_percent, const CameraAnimation& original);
265 void panPercent(fltp08 horizontal_percent, fltp08 vertical_percent, const CameraAnimation& original);
271 void addAnimation(CameraAnimation animation, bool clear_current_animations = true);
278 void addZoomAnimation(fltp08 distance_mult, const TimeSpan& time, bool clear_animations = true);
285 void addLookatAnimation(Vector<3, fltp08> lookat, const TimeSpan& time, bool clear_animations = true);
292 void addIsOrthographicAnimation(bool is_orthographic, const TimeSpan& time, bool clear_animations = true);
302 void addOrbitAnimation(Vector<3, fltp08> target, Vector<3, Angle<fltp08>> orient, fltp08 zoom, bool face_target, const TimeSpan& time, bool clear_animations = true);
317 void addZoomToExtentsAnimation(SnapLocation location, Bounds<3, fltp08> object, const TimeSpan& time, bool use_true_extents = true, bool clear_animations = true, Vector<3, Angle<fltp08>> angle_offsets = Vector<3, Angle<fltp08>>(Angle<fltp08>(0)));
326 void addZoomToExtentsAnimation(Bounds<3, fltp08> object, const TimeSpan& time, bool use_true_extents = true, bool clear_animations = true, Vector<3, Angle<fltp08>> angle_offsets = Vector<3, Angle<fltp08>>(Angle<fltp08>(0)));
335 void addZoomToExtentsAnimation(Vector<3, Angle<fltp08>> orientation, Bounds<3, fltp08> object, const TimeSpan& time, bool use_true_extents = true, bool clear_animations = true);
342 void addZoomMultiplierAnimation(fltp08 multiplier, const TimeSpan& time, bool clear_animations = true);
355 void copyFrom(const Camera& object);
364 [[nodiscard]] bool hasFullAutoFocus() const;
382 [[nodiscard]] const Ray<3, fltp08>& getLookat() const;
387 [[nodiscard]] SnapLocation currentSnapLocation() const;
392 [[nodiscard]] SnapLocation preferredSnapLocation() const;
397 [[nodiscard]] bool hasWorldGridAlignment() const;
398
403 [[nodiscard]] bool isUserCamera() const;
413 [[nodiscard]] ViewportFormat format() const;
419 [[nodiscard]] bool isObjectPotentiallyVisibleToCamera(const UUID& id) const;
420
426 [[nodiscard]] Vertex<2, fltp08> toScreenSpace(const Vector<2, fltp04>& pixel_location) const;
431 [[nodiscard]] Vertex<3, fltp08> computedOffset() const { return m_computed_offset; };
438 [[nodiscard]] Vertex<3, fltp08> toWorldSpaceFromPixelSpace(const Vector<2, fltp04>& pixel_location, fltp08 depth_percent) const;
445 [[nodiscard]] Vertex<3, fltp08> toWorldSpaceFromViewSpace(const Vector<2, fltp08>& view_location, fltp08 depth_percent) const;
450 [[nodiscard]] SelectionInfo createSelectionInfo() const;
456 void updateSelectionInfo(const Vector<2, fltp04>& pixel_location, SelectionInfo& info) const;
462 void updateSelectionInfo(const Bounds<2, fltp04>& pixel_location, SelectionInfo& info) const;
468 void updateSelectionInfo(const Polygon<fltp04>& pixel_location, SelectionInfo& info) const;
478 [[nodiscard]] Vector<2, Angle<fltp08>> activeFOV() const;
483 [[nodiscard]] Vector<2, fltp08> activeOrthoSize() const;
488 [[nodiscard]] Vector<3, fltp08> gotoLocation() const;
503 [[nodiscard]] Vector<2, uint04> windowSize() const;
508 void setNearPlaneBounds(const Bounds<1, fltp08>& near_plane_bounds) { m_near_plane_bounds = near_plane_bounds; }
513 void setFarPlaneBounds(const Bounds<1, fltp08>& near_plane_bounds) { m_far_plane_bounds = near_plane_bounds; }
518 [[nodiscard]] const Bounds<1, fltp08>& nearPlaneBounds() const { return m_near_plane_bounds; }
523 [[nodiscard]] const Bounds<1, fltp08>& farPlaneBounds() const { return m_far_plane_bounds; }
524
534 [[nodiscard]] Matrix<fltp08> viewToWorldSpace() const;
539 [[nodiscard]] Matrix<fltp08> worldToViewSpace() const;
544 [[nodiscard]] Matrix<fltp08> viewMatrix() const;
549 [[nodiscard]] Matrix<fltp08> projectionMatrix() const;
564 void setUseReferenceSize(bool use_reference_size);
569 [[nodiscard]] fltp08 calculatedReferenceSize() const;
585 [[nodiscard]] Bounds<3, fltp08> getFocusBounds() const { return m_autozoom_focus.bounds; }
590 void setFocusBounds(const Bounds<3, fltp08>& bounds) { m_autozoom_focus.bounds = bounds; }
591 //Vector<3, fltp08> lastReference() const { return m_last_refrence; }
596 [[nodiscard]] const CameraBackground& cameraBackground() const { return m_camera_background; }
601 [[nodiscard]] CameraBackground& cameraBackground() { return m_camera_background; }
606 static constexpr StringView TypeName() { return "camera"; }
617 private:
623 void _zoomToTargetModel(const Model& model, const DesignObjectLookup* lookup);
627 void _setupListeners();
632 void executeAnimations(Time current_time);
638 [[nodiscard]] Bounds<3, fltp08> boundsOfTargets(const DesignObjectLookup* lookup) const;
639 private:
640
641 Ray<2, uint04> m_window_size;
642 fltp08 m_reference_size;
643
644 Bounds<1, fltp08> m_near_plane_bounds;
645 Bounds<1, fltp08> m_far_plane_bounds;
646
647 Ray<3, fltp08> m_lookat;
648 Ray<3, fltp08> m_up_direction;
649 Vertex<3, fltp08> m_computed_offset = Constant<Vertex<3, fltp08>>::Invalid;
650 Vertex<3, fltp08> m_goto_initial_offset;
651 Vertex<3, fltp08> m_goto_initial_target;
652 Vector<3, Angle<fltp08>> m_goto_initial_orientation;
653 fltp08 m_goto_initial_ortho_bounds;
654 fltp08 m_goto_initial_zoom_extent_mult;
655 AutoZoomFocus m_autozoom_focus;
656 CameraBackground m_camera_background;
657 Matrix<fltp08> m_custom_transform;
658 Buffer<CameraAnimation> m_animations;
659 BasicResourceListener m_units_listener;
660 SnapLocation m_default_snap = SnapLocation::e_no_snap;
661 bool m_use_reference_size = true;
662 bool m_refresh_background = false;
663 };
664};//End namespace NDEVR
665#endif
666
667
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
Definition Angle.h:83
Simple version of ResourceListener which allows for a simple function callback that will be executed ...
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:54
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Logic for rendering the background to a 3D user view.
void setFarPlaneBounds(const Bounds< 1, fltp08 > &near_plane_bounds)
Sets the allowable range for the far clipping plane distance.
Definition Camera.h:513
const CameraBackground & cameraBackground() const
Gets the camera background settings (const).
Definition Camera.h:596
void moveHorizontalPercent(fltp08 percent)
Moves the camera horizontally by a normalized percentage of the viewport width.
Resource< String > camera_format
Format descriptor for the camera source (e.g., resolution, codec).
Definition Camera.h:106
Bounds< 2, Angle< fltp08 > > getPerspectiveBounds() const
Computes the angular bounds visible in perspective mode.
void lookHorizontal(fltp08 percent)
Rotates the camera horizontally by a normalized percentage of the view.
Resource< fltp08 > default_zoom_delta
The default incremental change applied during zoom operations.
Definition Camera.h:104
void setupFromFormat(const ViewportFormat &format)
Configures this camera from the given viewport format settings.
Resource< fltp08 > near_plane
The distance from the camera to the near clipping plane.
Definition Camera.h:101
void refreshFocusBounds(const DesignObjectLookup *lookup, TimeSpan animation_time)
Recomputes the auto-zoom focus bounds based on the current scene state.
void setReferenceSize(fltp08 size)
Sets the reference size used for scaling calculations.
void look(fltp08 horz_percent, fltp08 vert_percent, const CameraAnimation &original)
Rotates the camera by normalized horizontal and vertical percentages with animation parameters.
void addLookatAnimation(Vector< 3, fltp08 > lookat, const TimeSpan &time, bool clear_animations=true)
Adds an animation that transitions the camera to look at the specified direction.
Resource< fltp08 > zoom_extent_mult
Multiplier applied to the zoom extents calculation.
Definition Camera.h:103
fltp04 pixelThickness() const
Gets the current pixel thickness for rendering lines and points.
CameraBackground & cameraBackground()
Gets the camera background settings (mutable).
Definition Camera.h:601
bool isObjectPotentiallyVisibleToCamera(const UUID &id) const
Checks whether the given object is potentially visible from this camera's viewpoint.
Resource< fltp04 > pixel_thickness
The thickness of rendered lines and points in pixels.
Definition Camera.h:120
void updateSelectionInfo(const Vector< 2, fltp04 > &pixel_location, SelectionInfo &info) const
Updates the given SelectionInfo with a point-based selection at the specified pixel location.
void setProjectionTransform(const Matrix< fltp08 > &transform)
Sets a custom projection transform matrix, overriding the computed one.
void setUseReferenceSize(bool use_reference_size)
Sets whether the camera should use a reference size for scaling calculations.
void postUpdateBackground()
Signals that the camera background needs to be updated.
Vector< 3, Angle< fltp08 > > gotoOrientation() const
Gets the target orientation for a pending goto animation.
Resource< bool > rotation_lock
Whether the camera rotation is locked and cannot be changed.
Definition Camera.h:113
void addObjectToVisible(const Model &model)
Adds the given model to the set of objects visible to this camera.
Resource< Vertex< 3, fltp08 > > offset
The positional offset of the camera in 3D world space.
Definition Camera.h:97
void moveHorizontal(fltp08 distance)
Moves the camera horizontally (left/right) relative to its view direction.
Resource< String > camera_source
Identifier of the source providing the camera feed (e.g., device name).
Definition Camera.h:105
void moveVerticalPercent(fltp08 percent)
Moves the camera vertically by a normalized percentage of the viewport height.
Resource< Vector< 2, Angle< fltp08 > > > perspective_fov
The horizontal and vertical field of view angles for perspective projection.
Definition Camera.h:108
Resource< fltp08 > orthographic_perspective_ratio
The blend ratio between orthographic and perspective projection modes.
Definition Camera.h:118
Resource< fltp08 > orthographic_fov
The field of view size used for orthographic projection.
Definition Camera.h:109
Bounds< 3, fltp08 > getFocusBounds() const
Gets the current auto-zoom focus bounds.
Definition Camera.h:585
DynamicPointer< Set< UUID > > visible_items
Set of object UUIDs explicitly marked as visible to this camera.
Definition Camera.h:122
bool hasWorldGridAlignment() const
Checks whether the camera grid is aligned with the world coordinate system.
Camera(const Camera &camera)
Copy constructor.
~Camera()
Destructor.
fltp08 calculatedReferenceSize() const
Gets the calculated reference size based on the current viewport dimensions.
bool isUserCamera() const
Checks whether this camera represents a user-interactive viewport camera.
Matrix< fltp08 > projectionMatrix() const
Gets the current projection matrix, which may be custom or calculated.
Vertex< 2, fltp08 > toScreenSpace(const Vector< 2, fltp04 > &pixel_location) const
Converts a pixel location to normalized screen space in the range -1.0 to 1.0.
void addObjectsToVisible(const Buffer< UUID > &models, DesignObjectLookup *lookup)
Adds multiple objects to the set of objects visible to this camera.
void updateGridSpacing()
Recalculates the grid spacing based on the current zoom level and view parameters.
void updateSelectionInfo(const Polygon< fltp04 > &pixel_location, SelectionInfo &info) const
Updates the given SelectionInfo with a polygon-based selection at the specified pixel polygon.
Vector< 2, uint04 > windowSize() const
Gets the current window size in pixels.
void zoom(fltp08 distance_mult, const CameraAnimation &original)
Zooms the camera by a distance multiplier with animation parameters.
SnapLocation preferredSnapLocation() const
Gets the preferred snap location for this camera.
void move(const Ray< 3, fltp08 > &distance)
Moves the camera by a ray-defined offset and direction.
void setNearPlaneBounds(const Bounds< 1, fltp08 > &near_plane_bounds)
Sets the allowable range for the near clipping plane distance.
Definition Camera.h:508
void moveForward(fltp08 distance)
Moves the camera forward or backward along its look direction.
void move(const Ray< 3, fltp08 > &distance, const CameraAnimation &original)
Moves the camera by a ray-defined offset and direction with animation parameters.
void copyFrom(const Camera &object)
Copies all camera settings from the given camera into this one.
void moveVertical(fltp08 distance)
Moves the camera vertically (up/down) relative to its view direction.
fltp08 widthToHeightRatio() const
Computes the width-to-height ratio of the viewport.
Resource< bool > is_exposed
Whether the camera viewport is currently exposed and visible to the user.
Definition Camera.h:115
Resource< ScreenshotRequest > screenshot_request
The current pending screenshot request, if any.
Definition Camera.h:107
void setFocusBounds(const Bounds< 3, fltp08 > &bounds)
Sets the auto-zoom focus bounds directly.
Definition Camera.h:590
Vector< 2, fltp08 > activeOrthoSize() const
Gets the active orthographic view size in world units.
void addOrbitAnimation(Vector< 3, fltp08 > target, Vector< 3, Angle< fltp08 > > orient, fltp08 zoom, bool face_target, const TimeSpan &time, bool clear_animations=true)
Adds an orbit animation around a target point.
Matrix< fltp08 > viewMatrix() const
Gets the view matrix (camera transformation matrix).
Resource< bool > is_orthographic
Whether the camera uses orthographic projection instead of perspective.
Definition Camera.h:114
Vector< 2, Angle< fltp08 > > getRotateAroundPoint(const Vector< 3, fltp04 > &vCenter) const
Computes the rotation angles needed to rotate the camera around a given center point.
Resource< bool > location_lock
Whether the camera position is locked and cannot be moved.
Definition Camera.h:112
bool hasFullAutoFocus() const
Checks whether the camera has full auto-focus enabled on all axes.
Resource< SelectionInfo > selection_info
The current selection state associated with this camera view.
Definition Camera.h:119
void setAutoZoomFocus(AutoZoomFocus focus)
Sets the auto-zoom focus configuration for this camera.
Vertex< 3, fltp08 > toWorldSpaceFromPixelSpace(const Vector< 2, fltp04 > &pixel_location, fltp08 depth_percent) const
Converts a pixel-space location and depth to a 3D world-space position.
Vector< 2, Angle< fltp08 > > activeFOV() const
Gets the currently active field of view, accounting for projection mode.
void clearAutozoomFocus()
Clears the current auto-zoom focus settings.
fltp08 heightToWidthRatio() const
Computes the height-to-width ratio of the viewport.
Vertex< 3, fltp08 > computedOffset() const
Gets the computed camera offset in world space, accounting for animations.
Definition Camera.h:431
void addZoomMultiplierAnimation(fltp08 multiplier, const TimeSpan &time, bool clear_animations=true)
Adds an animation that scales the zoom level by a multiplier over the specified time.
SelectionInfo createSelectionInfo() const
Creates a new SelectionInfo based on the current camera state.
Matrix< fltp08 > viewToWorldSpace() const
Computes the transformation matrix from view space to world space.
DynamicPointer< Set< UUID > > hidden_items
Set of object UUIDs explicitly marked as hidden from this camera.
Definition Camera.h:123
Resource< Vector< 3, Angle< fltp08 > > > orientation
The rotational orientation of the camera as Euler angles.
Definition Camera.h:98
SnapLocation currentSnapLocation() const
Gets the current snap location that the camera is aligned to.
const Bounds< 1, fltp08 > & nearPlaneBounds() const
Gets the allowable range for the near clipping plane distance.
Definition Camera.h:518
Bounds< 3, fltp08 > getOrthographicBounds() const
Computes the 3D axis-aligned bounds visible in orthographic mode.
void clearAnimations()
Removes all queued camera animations.
Resource< fltp08 > plane_intercept_value
The depth value at which a cutting plane intercepts the view.
Definition Camera.h:117
void panPercent(fltp08 horizontal_percent, fltp08 vertical_percent, const CameraAnimation &original)
Pans the camera by normalized percentages, keeping the target point fixed while moving the offset.
Vector< 3, fltp08 > gotoLocation() const
Gets the target location for a pending goto animation.
void addZoomToExtentsAnimation(SnapLocation location, Bounds< 3, fltp08 > object, const TimeSpan &time, bool use_true_extents=true, bool clear_animations=true, Vector< 3, Angle< fltp08 > > angle_offsets=Vector< 3, Angle< fltp08 > >(Angle< fltp08 >(0)))
Adds an animation that zooms to fit the given bounds at a specific snap location.
void move(fltp08 horizontal_distance, fltp08 vertical_distance)
Moves the camera by the specified horizontal and vertical distances.
Matrix< fltp08 > worldToViewSpace() const
Computes the transformation matrix from world space to view space.
Resource< Vertex< 3, fltp08 > > target
The point in 3D world space the camera is looking at.
Definition Camera.h:99
bool refreshMovement(const Time &current_time, const DesignObjectLookup *lookup=nullptr, const TimeSpan &time_out=TimeSpan(0.2))
Advances any active camera animations and updates the camera position and orientation.
void writeMetaData()
Writes the current camera metadata to the underlying design object storage.
void lookVertical(fltp08 percent)
Rotates the camera vertically by a normalized percentage of the view.
void readMetaData()
Reads camera metadata from the underlying design object storage.
const Bounds< 1, fltp08 > & farPlaneBounds() const
Gets the allowable range for the far clipping plane distance.
Definition Camera.h:523
Vertex< 3, fltp08 > toWorldSpaceFromViewSpace(const Vector< 2, fltp08 > &view_location, fltp08 depth_percent) const
Converts a view-space location and depth to a 3D world-space position.
ViewportFormat format() const
Gets the viewport format descriptor for this camera.
const Ray< 3, fltp08 > & getLookat() const
Gets the current look-at ray describing the camera view direction and position.
Resource< bool > is_valid
Whether the camera is in a valid, usable state.
Definition Camera.h:116
static constexpr StringView TypeName()
Gets the type name identifier for Camera objects.
Definition Camera.h:606
Resource< fltp08 > far_plane
The distance from the camera to the far clipping plane.
Definition Camera.h:102
void addZoomToExtentsAnimation(Bounds< 3, fltp08 > object, const TimeSpan &time, bool use_true_extents=true, bool clear_animations=true, Vector< 3, Angle< fltp08 > > angle_offsets=Vector< 3, Angle< fltp08 > >(Angle< fltp08 >(0)))
Adds an animation that zooms to fit the given bounds using the current orientation.
Resource< Vertex< 2, fltp08 > > cross_hairs
The 2D position of the crosshair overlay on screen.
Definition Camera.h:100
void addAnimation(CameraAnimation animation, bool clear_current_animations=true)
Adds a camera animation to the queue.
void movePercent(fltp08 horizontal_percent, fltp08 vertical_percent)
Moves the camera by normalized horizontal and vertical percentages of the viewport.
void look(fltp08 horz_percent, fltp08 vert_percent)
Rotates the camera by normalized horizontal and vertical percentages.
void addIsOrthographicAnimation(bool is_orthographic, const TimeSpan &time, bool clear_animations=true)
Adds an animation that transitions between orthographic and perspective projection.
void move(fltp08 horizontal_distance, fltp08 vertical_distance, const CameraAnimation &original)
Moves the camera by the specified horizontal and vertical distances with animation parameters.
Matrix< fltp08 > calculateProjectionMatrix() const
Calculates the projection matrix from current camera parameters.
Resource< Time > last_visible_update_time
Timestamp of the last update to visible content.
Definition Camera.h:111
void addZoomAnimation(fltp08 distance_mult, const TimeSpan &time, bool clear_animations=true)
Adds a zoom animation that scales the view over the specified time.
void setWindowSize(const Vector< 2, uint04 > &size)
Sets the window size for this camera viewport.
void updateSelectionInfo(const Bounds< 2, fltp04 > &pixel_location, SelectionInfo &info) const
Updates the given SelectionInfo with a rectangle-based selection at the specified pixel bounds.
void addZoomToExtentsAnimation(Vector< 3, Angle< fltp08 > > orientation, Bounds< 3, fltp08 > object, const TimeSpan &time, bool use_true_extents=true, bool clear_animations=true)
Adds an animation that zooms to fit the given bounds at a specified orientation.
void movePercent(fltp08 horizontal_percent, fltp08 vertical_percent, const CameraAnimation &original)
Moves the camera by normalized horizontal and vertical percentages with animation parameters.
Camera(const Model &camera)
Constructs a Camera from an existing Model.
A core class where all Design Objects including models, materials, and geometries are stored.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
Templated logic for doing matrix multiplication.
Definition Matrix.hpp:182
Vector< 3, fltp08 > size() const
Returns the size (extents) of the model's bounding box.
Model()
Default constructor. Creates an uninitialized Model.
Definition Model.h:365
An N-sided polygon.
Definition Polygon.hpp:55
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
Definition Resource.h:42
Responsible for turning a user interaction into a selection within a DesignObjectLookup.
Definition Selector.h:52
The core String View class for the NDEVR API.
Definition StringView.h:58
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:62
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
A point in N-dimensional space, used primarily for spatial location information.
Definition Vertex.hpp:44
Stores information for how to construct a viewport, including camera identity, field of view,...
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
double fltp08
Defines an alias representing an 8 byte floating-point number.
SnapLocation
A list of directions that a view can be pointed relative to an object or scene.
@ e_no_snap
No snap applied; free camera orientation.
Logic for automatically zooming a Camera or Viewport to a certain location or having certain objects ...
A container for information relating to a Camera 3D animation such as zooming or rotating around a ta...
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
std::function< void(const StringView &image_id)> callback
Callback invoked with the screenshot image identifier upon completion.
Definition Camera.h:86
bool operator!=(const ScreenshotRequest &) const
Inequality operator.
Definition Camera.h:82
bool operator==(const ScreenshotRequest &) const
Equality operator.
Definition Camera.h:74
ScreenshotRequest(std::function< void(const StringView &image_id)> callback)
Constructs a ScreenshotRequest with the given completion callback.
Definition Camera.h:67
ScreenshotRequest()
Default constructor.
Definition Camera.h:62