AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxOSG::NeoCamera Class Reference

A new (as of 2026) extended camera type, allowing for more "cinematic"-like effects. More...

#include <NeoCamera.h>

+ Inheritance diagram for agxOSG::NeoCamera:

Public Member Functions

 NeoCamera ()
 Initializes the camera with a set of default parameters.
 
 ~NeoCamera ()
 
bool add (NeoCameraOutput *output)
 Add the given output to the camera.
 
bool add (osg::Node *node)
 Add the given OpenSceneGraph node locally to the camera view.
 
bool contains (NeoCameraOutput *output)
 Checks if the camera contains the given output.
 
bool contains (osg::Node *node)
 Checks if the camera local view contains the given node.
 
agxSDK::Simulation * getConnectedSimulation () const
 
NeoCameraLens * getLens () const
 
agx::Real getReferenceIlluminance () const
 
NeoCameraSensor * getSensor () const
 
void registerToSceneGraph (osg::Group *sceneGraph, osg::Node *sceneNode)
 Registers this camera to the given scene graph for processing.
 
bool remove (NeoCameraOutput *output)
 Remove the given output from the camera.
 
bool remove (osg::Node *node)
 Remove the given OpenSceneGraph node from the camera local view.
 
void setConnectedSimulation (agxSDK::Simulation *simulation)
 Set the simulation to which this camera is connected and will sample the time from.
 
void setReferenceIlluminance (agx::Real illuminance)
 Set the reference illuminance value that a fully white pixel will correspond to.
 
void setViewMatrix (const osg::Matrixd &viewMatrix)
 Set the view matrix of the camera.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Static Public Member Functions

static void addPreviewTo (agxOSG::SceneDecorator *sceneDecorator, NeoCameraColorTextureOutput *output, const agx::Vec2 &position, const agx::Vec2 &size)
 Add a preview of the given camera output in the given scene decorator.
 
static void addPreviewTo (agxOSG::SceneDecorator *sceneDecorator, NeoCameraDepthTextureOutput *output, const agx::Vec2 &position, const agx::Vec2 &size)
 Add a preview of the given camera output in the given scene decorator.
 
static bool isSupported ()
 
static void removePreviewFrom (agxOSG::SceneDecorator *sceneDecorator, NeoCameraColorTextureOutput *output)
 Removes the preview of the given output from the given scene decorator.
 
static void removePreviewFrom (agxOSG::SceneDecorator *sceneDecorator, NeoCameraDepthTextureOutput *output)
 Removes the preview of the given output from the given scene decorator.
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Additional Inherited Members

- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

A new (as of 2026) extended camera type, allowing for more "cinematic"-like effects.

Note
This camera must be registered with a scene graph to actually perform any rendering.
This camera requires support for at least OpenGL 4.5 to function.

Definition at line 58 of file NeoCamera.h.

Constructor & Destructor Documentation

◆ NeoCamera()

agxOSG::NeoCamera::NeoCamera ( )

Initializes the camera with a set of default parameters.

◆ ~NeoCamera()

agxOSG::NeoCamera::~NeoCamera ( )

Member Function Documentation

◆ add() [1/2]

bool agxOSG::NeoCamera::add ( NeoCameraOutput *  output)

Add the given output to the camera.

Parameters
output- output to add to the camera
Returns
true if the output was added or false if it has already been added

◆ add() [2/2]

bool agxOSG::NeoCamera::add ( osg::Node *  node)

Add the given OpenSceneGraph node locally to the camera view.

Parameters
node- node to add
Returns
true if the node was added or false if it has already been added

◆ addPreviewTo() [1/2]

static void agxOSG::NeoCamera::addPreviewTo ( agxOSG::SceneDecorator *  sceneDecorator,
NeoCameraColorTextureOutput *  output,
const agx::Vec2 &  position,
const agx::Vec2 &  size 
)
static

Add a preview of the given camera output in the given scene decorator.

Parameters
sceneDecorator- scene decorator to add the preview to
output- preview output to visualize in the preview
position- position of the preview in unit screen coordinates
size- size of the preview in unit screen coordinates

◆ addPreviewTo() [2/2]

static void agxOSG::NeoCamera::addPreviewTo ( agxOSG::SceneDecorator *  sceneDecorator,
NeoCameraDepthTextureOutput *  output,
const agx::Vec2 &  position,
const agx::Vec2 &  size 
)
static

Add a preview of the given camera output in the given scene decorator.

Parameters
sceneDecorator- scene decorator to add the preview to
output- preview output to visualize in the preview
position- position of the preview in unit screen coordinates
size- size of the preview in unit screen coordinates

◆ contains() [1/2]

bool agxOSG::NeoCamera::contains ( NeoCameraOutput *  output)

Checks if the camera contains the given output.

Parameters
output- output to look for
Returns
true if the camera contains this output

◆ contains() [2/2]

bool agxOSG::NeoCamera::contains ( osg::Node *  node)

Checks if the camera local view contains the given node.

Parameters
node- node to look for
Returns
true if the camera local view contains this node

◆ getConnectedSimulation()

agxSDK::Simulation * agxOSG::NeoCamera::getConnectedSimulation ( ) const
Returns
the currently connected simulation or nullptr if no such simulation exists, or if it has been destroyed

◆ getLens()

NeoCameraLens * agxOSG::NeoCamera::getLens ( ) const
Returns
the lens (and aperture/diaphragm) parameter specification for the camera

◆ getReferenceIlluminance()

agx::Real agxOSG::NeoCamera::getReferenceIlluminance ( ) const
Returns
the illuminance value of a fully white pixel, as used if exposure effects are enabled

◆ getSensor()

NeoCameraSensor * agxOSG::NeoCamera::getSensor ( ) const
Returns
the sensor (and shutter) parameter specification for the camera

◆ isSupported()

static bool agxOSG::NeoCamera::isSupported ( )
static
Note
This function should be called after initialization of an OpenGL context.
Returns
true if the camera is supported on this system.

◆ registerToSceneGraph()

void agxOSG::NeoCamera::registerToSceneGraph ( osg::Group *  sceneGraph,
osg::Node *  sceneNode 
)

Registers this camera to the given scene graph for processing.

Note
If this camera is already registered to a scene graph, it will be switched to the new one.
Parameters
sceneGraph- OpenSceneGraph scene graph group to register this camera to
sceneNode- the node housing the scene that this camera should see

◆ remove() [1/2]

bool agxOSG::NeoCamera::remove ( NeoCameraOutput *  output)

Remove the given output from the camera.

Parameters
output- output to remove
Returns
true if the output was removed or false if the camera does not contain the output

◆ remove() [2/2]

bool agxOSG::NeoCamera::remove ( osg::Node *  node)

Remove the given OpenSceneGraph node from the camera local view.

Parameters
node- node to remove
Returns
true if the node was removed or false if the camera does not contain the output

◆ removePreviewFrom() [1/2]

static void agxOSG::NeoCamera::removePreviewFrom ( agxOSG::SceneDecorator *  sceneDecorator,
NeoCameraColorTextureOutput *  output 
)
static

Removes the preview of the given output from the given scene decorator.

Parameters
sceneDecorator- scene decorator to remove the preview from
output- preview output to whose preview to remove from the scene decorator

◆ removePreviewFrom() [2/2]

static void agxOSG::NeoCamera::removePreviewFrom ( agxOSG::SceneDecorator *  sceneDecorator,
NeoCameraDepthTextureOutput *  output 
)
static

Removes the preview of the given output from the given scene decorator.

Parameters
sceneDecorator- scene decorator to remove the preview from
output- preview output to whose preview to remove from the scene decorator

◆ setConnectedSimulation()

void agxOSG::NeoCamera::setConnectedSimulation ( agxSDK::Simulation *  simulation)

Set the simulation to which this camera is connected and will sample the time from.

Parameters
simulation- simulation to connect this camera to (nullptr to detach)

◆ setReferenceIlluminance()

void agxOSG::NeoCamera::setReferenceIlluminance ( agx::Real  illuminance)

Set the reference illuminance value that a fully white pixel will correspond to.

This value allows the OpenSceneGraph rendered linear RGB to be interpreted as brightness values, stemming from the sensor illuminance, and which can be used for the exposure calculation.

Note
This is only used if exposure effects are used.
Parameters
illuminance- illuminance value of a fully white pixel

◆ setViewMatrix()

void agxOSG::NeoCamera::setViewMatrix ( const osg::Matrixd &  viewMatrix)

Set the view matrix of the camera.

Parameters
viewMatrix- view matrix

The documentation for this class was generated from the following file: