NDEVR
API Documentation
GraphicsCameraManager.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: Graphics
28File: GraphicsCameraManager
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Matrix.h>
35#include <NDEVR/Vector.h>
36#include <NDEVR/UUID.h>
37#include <NDEVR/RGBColor.h>
38#include <NDEVR/Time.h>
39namespace NDEVR
40{
42 class Camera;
48 {
53 fltp04 dpi = 1.0f;
55
59 bool operator!=(const CameraUniformObject& object) const
60 {
61 return !AreSame(transform, object.transform)
62 || origin != object.origin
63 || !AreSame(sun_pos, object.sun_pos)
64 || !AreSame(camera_pos, object.camera_pos)
65 || !AreSame(dpi, object.dpi)
66 || background_color != object.background_color;
67 }
68 };
69
116}
A core object representing a user view as well as convenience functions for moving this view through ...
Definition Camera.h:95
GraphicsCameraManager(const GraphicsCameraManager &m_pipeline)
Copy constructor.
GraphicsCameraManager()
Default constructor.
bool m_needs_pipeline_update
Whether the pipeline needs rebuilding.
UUID m_camera
UUID of the managed camera.
bool useCameraMaterial() const
Checks whether the camera material override is active.
bool m_needs_uniform_commit
Whether the uniform buffer needs committing.
virtual ~GraphicsCameraManager()
Destructor.
UUID m_override_material
UUID of the material override (if any).
bool m_uses_origin
Whether origin-based precision is active.
const CameraUniformObject & uniformObject() const
Returns the current camera uniform data.
void setCamera(const UUID &camera)
Sets the camera to manage.
CameraUniformObject m_camera_uniform
Current uniform data for the GPU.
Time m_last_updated_time
Last time the uniform was updated.
virtual void updateUniformBuffer(GraphicsUpdateArguments &args)
Updates the GPU uniform buffer from the current camera state.
bool m_use_anisotropy
Whether anisotropic filtering is enabled.
bool m_use_camera_material
Whether camera-specific material is used.
CameraUniformObject getCameraUniformObject(const Camera &camera, GraphicsUpdateArguments &args) const
Builds a CameraUniformObject from a Camera and update arguments.
UUID overrideMaterial() const
Returns the override material UUID.
Time m_visible_update_time
Last time a visible change was detected.
Options that are used for performing an update on a Graphics Engine call.
Templated logic for doing matrix multiplication.
Definition Matrix.hpp:182
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:57
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
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...
A structure containing common information pushed to the video card for NDEVR Rendering Engine operati...
RGBColor background_color
Viewport background color.
Vector< 4, fltp04 > camera_pos
Camera position in world space.
Vector< 4, sint04 > origin
Origin offset for large-coordinate precision.
Matrix< fltp04 > transform
Combined view-projection matrix.
fltp04 dpi
Display DPI scaling factor.
Vector< 4, fltp04 > sun_pos
Sun direction for lighting.
bool operator!=(const CameraUniformObject &object) const
Inequality comparison.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...