SmallChange  1.0.0
A collection of extensions to Coin3D
Loading...
Searching...
No Matches
UTMCamera Class Reference

The UTMCamera class defines a camera node with perspective rendering and an UTM position. More...

#include <SmallChange/nodes/UTMCamera.h>

Inheritance diagram for UTMCamera:
SoPerspectiveCamera

Public Member Functions

virtual void audioRender (class SoAudioRenderAction *action)
 
virtual void callback (SoCallbackAction *action)
 
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
 
virtual void getMatrix (SoGetMatrixAction *action)
 
void getPosition (double &easting, double &northing, double &elevation)
 
virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)
 
virtual void GLRender (SoGLRenderAction *action)
 
virtual void handleEvent (SoHandleEventAction *action)
 
virtual void rayPick (SoRayPickAction *action)
 

Static Public Member Functions

static void initClass (void)
 

Public Attributes

SoSFBool moveTransform
 
SoSFVec3d utmposition
 

Protected Member Functions

virtual void notify (SoNotList *nl)
 

Detailed Description

The UTMCamera class defines a camera node with perspective rendering and an UTM position.

This node adds a field utmposition to the perspective camera node. utmposition is a vector which contains 3 values for easting, northing and elevation.

The position vector moves the camera relative to the UTM position. Use this camera instead of a normal SoPerspectiveCamera if you plan to operate on large floating point coordinates that might cause floating point precision to become too low. This is typically useful if you want to place objects using, for instance, UTM coordinates.

To perhaps better understand how it works, think of it this way: when scene graph traversal arrives at an UTMCamera, all transformation matrices will be set to identity, i.e. no transformations, so the camera position (for OpenGL) will be set at world origo (0,0,0). When a UTMPosition node is then later encountered during traversal, a transformation will be added which translates geometry to its correct position relative to the UTMCamera setting.

As the camera will always be positioned in (0,0,0) for OpenGL with this scheme, we get the advantage of maximum precision for floating point numbers.

See also
UTMPosition, UTMCoordinate

Member Function Documentation

◆ getPosition()

void UTMCamera::getPosition ( double & easting,
double & northing,
double & elevation )

This is a helper function to return the three components of the UTMCamera::utmposition vector field.

FIXME: function is redundant and should be made obsolete.

◆ notify()

void UTMCamera::notify ( SoNotList * nl)
protectedvirtual

Overridden to recalculate cached values when something change.

Member Data Documentation

◆ moveTransform

SoSFBool UTMCamera::moveTransform

This field is to enable a hack to move transforms in front of the camera to after an UTMPosition node.

Default value is FALSE.

◆ utmposition

SoSFVec3d UTMCamera::utmposition

First value of vector is easting (+X) position of the camera, second is northing (+Y) position, and third is the elevation (+Z) position of the camera.

Default value is [0, 0, 0].


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