Skip to content

Core::Camera

Camera has following outputs 0 -> screen output 1 -> proj * view matrix output 2 -> mul output.

#include "Core/Nodes/Camera.h"

Inherits from Core::Node, std::enable_shared_from_this< Node >

Public Functions

Name
Camera()
voidcreateComponents()
const Ptr< Sequence > &getProj()
const Ptr< Sequence > &getView()
const Ptr< Sequence > &getViewport()
boolisEmpty() const<br>Whether the camera has any transformations in it.
virtual voidupdateValues(int inputIndex) override<br>Computes new values of outputs based on inputs.

Public Attributes

Name
CameraCoordSystemm_coordinateSystem <br>Coordinate system used during camera tracking.
glm::mat4m_projectionMatrix <br>Latest projection matrix value.
glm::mat4m_viewMatrix <br>Latest view matrix value.
boolm_viewportEnabled <br>Whether the viewport transformation should be taken into account (it is optional)
glm::mat4m_viewportMatrix <br>Latest viewport matrix value.

Friends

Name
classGraphManager

Additional inherited members

Public Functions inherited from Core::Node

Name
virtual voidaddDeleteCallback(std::function< void(Node *)> callback)<br> The callback parameters:
virtual voidaddPlugCallback(std::function< void(Node *, Node *, size_t, size_t)> callback)<br>Registers a callback that gets called when the node's output pins get plugged in.
virtual voidaddUnplugCallback(std::function< void(Node *, Node *, size_t, size_t)> callback)<br>Registers a callback that gets called when the node's input pins get unplugged.
virtual voidaddUpdateCallback(std::function< void(Node *)> callback)<br>Registers a callback that gets called on any updateValues() call.
voidappendChildNode(Ptr< Node > node)
boolareAllInputsPlugged()
boolareAllInputsUnplugged() const
boolareInputsPlugged(int numInputs)
template <typename T &gt; <br>Ptr< T >as()
template <typename T &gt; <br>T *asRaw()
const Data &data(size_t index =0) const<br>Get Node contents, read only.
Data &dataMut(size_t index)
voidfinalize()<br>Prepares node for its destruction, after that the destructor can be called.
IDgetId() const
Pin &getInput(size_t i)
std::vector< Pin > &getInputPins()
Data &getInternalData(size_t index =0)<br>Get data storage for read and write purposes.
const char *getLabel() const
const Operation &getOperation() const
Pin &getOutput(size_t i)
std::vector< Pin > &getOutputPins()
Ptr< Node >getOwner() const<br>Get direct owner of this node.
Ptr< Node >getPtr()<br>Get reference to this node instance.
Ptr< Node >getRootOwner()<br>Get the topmost owner of this node.
std::stringgetSignature()<br>"{node type} #{node ID}"
EValueStategetState(size_t pinIndex =0)
TrackedNodeData *getTrackingData()
voidinit()<br>Initialize node id, inputs, and outputs according to the preset node type.
voidnotifyOwner()
virtual voidonInit()
booloperator!=(const Node & other) const
booloperator==(const Node & other) const
ENodePlugResultplug(const Ptr< Node > & childNode, unsigned fromIndex, unsigned toIndex)<br>Connect this (parent) node output to the childNode input.
voidpulse(size_t index)
virtual voidreceiveSignal(int inputIndex)<br>Implements the operator reaction to the change of its inputIndex input.
virtual SetValueResultsetValue(const glm::mat4 & mat)
virtual SetValueResultsetValue(const glm::mat4 & mat, const DataMap & map)<br>Smart set function, used with constrained transformation for value checking.
virtual SetValueResultsetValue(const glm::quat & q)
virtual SetValueResultsetValue(const glm::vec3 & vec)
virtual SetValueResultsetValue(const glm::vec4 & vec)
template <typename T &gt; <br>SetValueResultsetValue(const T & value, unsigned index)
virtual SetValueResultsetValue(float val)<br>Set the value of the node.
virtual SetValueResultsetValue(float val, glm::ivec2 coords)
virtual SetValueResultsetValue(void * ptr)
voidspreadSignal()<br>Spread signal to all outputs.
voidspreadSignal(size_t outIndex)<br>Spread signal to the selected output outIndex only.

Protected Functions inherited from Core::Node

Name
Node(const Operation & operation)<br>Node is never constructed directory.
virtual~Node()
ENodePlugResultisPlugCorrect(const Pin & input, const Pin & output)
virtual voidonPlug(Node * fromNode, Node * toNode, size_t fromIndex, size_t toIndex)
virtual voidonUnplug(Node * fromNode, Node * toNode, size_t fromIndex, size_t toIndex)
virtual voidonUpdate()
template <typename T &gt; <br>voidsetInternalValue(const T & value, size_t index =0)<br>Sets the node value without validation.
voidsetInternalValue(float value, glm::ivec2 coordinates, size_t index =0)
boolshouldPulse(size_t inputIndex, size_t updatedInputIndex)<br>Tests if the updatedInputIndex should be pulsed.
voidtriggerDeleteCallback(Node * node)
voidtriggerPlugCallback(Node * fromNode, Node * toNode, size_t fromIndex, size_t toIndex)
voidtriggerUnplugCallback(Node * fromNode, Node * toNode, size_t fromIndex, size_t toIndex)
voidtriggerUpdateCallback(Node * node)

Public Attributes inherited from Core::Node

Name
std::vector< EValueState >m_OperatorState

Protected Attributes inherited from Core::Node

Name
boolfinalized
std::vector< Node * >m_children <br>Nested nodes.
IDm_id
std::vector< Pin >m_inputs <br>Inputs of the box: Input tabs with glyphs.
std::vector< Data >m_internalData <br>Results of operations.
Operationm_operation <br>Operator node properties.
std::vector< Pin >m_outputs <br>Outputs of the box: output tabs with glyphs.
Node *m_owner <br>Owner of the node, used in complex type of nodes, such as sequence or camera.
TrackedNodeData *m_trackingData <br>Reference to additional tracking data if applicable, nullptr indicates no active tracking operation.

Friends inherited from Core::Node

Name
classMatrixTracker
classPin

Public Functions Documentation

function Camera

cpp
Camera()
Camera()

function createComponents

cpp
void createComponents()
void createComponents()

function getProj

cpp
inline const Ptr< Sequence > & getProj()
inline const Ptr< Sequence > & getProj()

function getView

cpp
inline const Ptr< Sequence > & getView()
inline const Ptr< Sequence > & getView()

function getViewport

cpp
inline const Ptr< Sequence > & getViewport()
inline const Ptr< Sequence > & getViewport()

function isEmpty

cpp
bool isEmpty() const
bool isEmpty() const

Whether the camera has any transformations in it.

function updateValues

cpp
virtual void updateValues(
    int inputIndex
) override
virtual void updateValues(
    int inputIndex
) override

Computes new values of outputs based on inputs.

Parameters:

  • inputIndex Index of the modified input.

Reimplements: Core::Node::updateValues

Encodes the box function by updating the output values for a given inputIndex - fired by receiveSignal().

The base class method calls update callbacks registered with addUpdateCallback(). So derived methods should also call their base method if they want to inform any outside observers.

Public Attributes Documentation

variable m_coordinateSystem

cpp
CameraCoordSystem m_coordinateSystem {g_openGL};
CameraCoordSystem m_coordinateSystem {g_openGL};

Coordinate system used during camera tracking.

variable m_projectionMatrix

cpp
glm::mat4 m_projectionMatrix {1.f};
glm::mat4 m_projectionMatrix {1.f};

Latest projection matrix value.

variable m_viewMatrix

cpp
glm::mat4 m_viewMatrix {1.f};
glm::mat4 m_viewMatrix {1.f};

Latest view matrix value.

variable m_viewportEnabled

cpp
bool m_viewportEnabled = false;
bool m_viewportEnabled = false;

Whether the viewport transformation should be taken into account (it is optional)

variable m_viewportMatrix

cpp
glm::mat4 m_viewportMatrix {1.f};
glm::mat4 m_viewportMatrix {1.f};

Latest viewport matrix value.

Friends

friend GraphManager

cpp
friend class GraphManager(
    GraphManager 
);
friend class GraphManager(
    GraphManager 
);

Updated on 2025-05-31 at 12:55:31 +0000