61class cDirectionalLight;
142 virtual bool selectWorld(
const int a_windowPosX,
const int a_windowPosY,
143 const int a_windowWidth,
const int a_windowHeight,
148 virtual bool selectFrontLayer(
const int a_windowPosX,
const int a_windowPosY,
149 const int a_windowWidth,
const int a_windowHeight,
154 virtual bool selectBackLayer(
const int a_windowPosX,
const int a_windowPosY,
155 const int a_windowWidth,
const int a_windowHeight,
160 virtual bool selectLayers(
const int a_windowPosX,
const int a_windowPosY,
161 const int a_windowWidth,
const int a_windowHeight,
164 bool a_checkFrontLayer =
true,
165 bool a_checkBackLayer =
true);
197 const double& a_polarRad,
198 const double& a_azimuthRad);
202 const double& a_polarDeg,
203 const double& a_azimuthDeg);
341 virtual void renderView(
const int a_windowWidth,
342 const int a_windowHeight,
344 const bool a_defaultBuffer =
true);
Implements an audio device for listening to audio sources.
Implements a base class for all objects.
Implements a 2D image data structure.
Implements general math utility functions.
This class implements an audio device context.
Definition CAudioDevice.h:82
This class implements a virtual camera.
Definition CCamera.h:111
double m_posAzimuthRad
Camera azimuth position in radians (spherical coordinates).
Definition CCamera.h:496
cVector3d m_zenithReference
Camera zenith reference vector (spherical coordinates).
Definition CCamera.h:502
void setSphericalPolarRad(const double &a_polarRad)
This method sets the polar position of the camera in radians (spherical coordinates).
Definition CCamera.cpp:334
cWorld * m_frontLayer
Front plane scene graph which can be used to attach widgets.
Definition CCamera.h:417
void copyImageBuffer(cImagePtr a_image)
This method copies the output image data to an image structure.
Definition CCamera.cpp:1726
void setSphericalAzimuthRad(const double &a_azimuthRad)
This method sets the azimuth position of the camera in radians (spherical coordinates).
Definition CCamera.cpp:362
double getFieldViewAngleDeg()
This method returns the field of view angle (in degrees).
Definition CCamera.h:310
bool m_mirrorHorizontal
If true then the output image is mirrored horizontally.
Definition CCamera.h:478
bool m_mirrorStatus
If true then only one of the axes is mirrored.
Definition CCamera.h:484
cVector3d m_originReference
Camera origin (spherical coordinates).
Definition CCamera.h:508
cDirectionalLight * m_lightFrontLayer
Directional light for front plane.
Definition CCamera.h:423
int getDisplayHeight()
This method returns the height of the current window display in pixels.
Definition CCamera.h:359
bool getUseMultipassTransparency()
This method returns true if multipass rendering is enabled, false otherwise.
Definition CCamera.h:353
bool m_mirrorVertical
If true then the output image is mirrored vertically.
Definition CCamera.h:481
double getSphericalRadius()
This method returns the radius position of the camera (spherical coordinates).
Definition CCamera.h:214
unsigned int m_lastDisplayWidth
Last width size of the window.
Definition CCamera.h:469
double m_stereoEyeSeparation
Stereo eye separation.
Definition CCamera.h:463
double getFarClippingPlane()
This method returns the far clipping plane distance.
Definition CCamera.h:291
bool m_useMultipassTransparency
If true, then three rendering passes are performed to approximate back-front sorting (see comment).
Definition CCamera.h:454
void setClippingPlanes(const double a_distanceNear, const double a_distanceFar)
This method sets the near and far clipping plane distances.
Definition CCamera.cpp:643
double m_orthographicWidth
Width of orthographic view.
Definition CCamera.h:448
void adjustClippingPlanes()
This method automatically adjust back and front clipping planes.
Definition CCamera.cpp:1785
double getSphericalPolarDeg()
This method returns the polar position of the camera in degrees (spherical coordinates).
Definition CCamera.h:226
void setMirrorVertical(bool a_enabled)
This method enables or disables output image mirroring vertically.
Definition CCamera.cpp:606
virtual ~cCamera()
Destructor of cCamera.
Definition CCamera.cpp:165
cVector3d getRightVector() const
This method returns the "right direction" vector for this camera.
Definition CCamera.h:186
double getSphericalPolarRad()
This method returns the polar position of the camera in radians (spherical coordinates).
Definition CCamera.h:220
virtual void setStereoMode(cStereoMode a_stereoMode)
This method sets the desired stereo mode.
Definition CCamera.cpp:519
double getSphericalAzimuthRad()
This method returns the azimuth position of the camera in radians (spherical coordinates).
Definition CCamera.h:232
void renderLayer(cGenericObject *a_graph, int a_width, int a_height)
Renders a 2D layer within this camera's view.
Definition CCamera.cpp:1816
double getFieldViewAngleRad()
This method returns the field of view angle (in radians).
Definition CCamera.h:316
int getDisplayWidth()
This method returns the width of the current window display in pixels.
Definition CCamera.h:356
cVector3d getSphericalZenithReference()
This method returns the zenith reference direction vector of the camera (spherical coordinates).
Definition CCamera.h:244
virtual void renderView(const int a_windowWidth, const int a_windowHeight, const cEyeMode a_eyeMode=C_STEREO_LEFT_EYE, const bool a_defaultBuffer=true)
This method renders the the camera view in OpenGL.
Definition CCamera.cpp:982
bool m_useCustomModelViewMatrix
If true, then use projection matrix specified in m_projectionMatrix.
Definition CCamera.h:275
cVector3d getSphericalOriginReference()
This method returns the origin target point of the camera (spherical coordinates).
Definition CCamera.h:256
double getStereoEyeSeparation()
This method returns the stereo eye separation.
Definition CCamera.h:331
double m_fieldViewAngleDeg
Field of view angle expressed in degrees.
Definition CCamera.h:445
cTransform m_projectionMatrix
Projection matrix of camera.
Definition CCamera.h:266
void setSphericalRadius(const double &a_radius)
This method sets the radius position of the camera (spherical coordinates).
Definition CCamera.cpp:320
cWorld * m_backLayer
Black plane scene graph which can be used to attach widgets.
Definition CCamera.h:420
double getSphericalAzimuthDeg()
This method returns the azimuth position of the camera in degrees (spherical coordinates).
Definition CCamera.h:238
void setSphericalRad(const double &a_radius, const double &a_polarRad, const double &a_azimuthRad)
This method sets the position and orientation of the camera in spherical coordinates in radians.
Definition CCamera.cpp:240
double m_scaleV
Scale factor used for vertical mirroring. (-1.0 or 1.0)
Definition CCamera.h:490
void setSphericalOriginReference(const cVector3d &a_originReference)
This method sets the origin target point of the camera (spherical coordinates).
Definition CCamera.cpp:446
void setFieldViewAngleRad(double a_fieldViewAngleRad)
This method set the field of view angle (in radians).
Definition CCamera.h:313
virtual bool selectBackLayer(const int a_windowPosX, const int a_windowPosY, const int a_windowWidth, const int a_windowHeight, cCollisionRecorder &a_collisionRecorder, cCollisionSettings &a_collisionSettings)
This method queries whether the specified position is 'pointing at' any widget on the back layer.
Definition CCamera.cpp:836
cAudioDevice * m_audioDevice
Optionally attached audio device.
Definition CCamera.h:511
double m_scaleH
Scale factor used for horizontal mirroring. (-1.0 or 1.0)
Definition CCamera.h:487
double m_posRadius
Camera radius position (spherical coordinates).
Definition CCamera.h:499
cWorld * getParentWorld()
This method returns a pointer to the parent world.
Definition CCamera.h:132
double getNearClippingPlane()
This method returns the near clipping plane distance.
Definition CCamera.h:288
cVector3d getSphericalAzimuthReference()
This method returns the azimuth reference direction vector of the camera (spherical coordinates).
Definition CCamera.h:250
cVector3d getLookVector() const
This method returns the camera "look at" position vector for this camera.
Definition CCamera.h:180
bool m_perspectiveMode
If true, then camera operates in perspective mode. If false, then camera is in orthographic mode.
Definition CCamera.h:451
double getAspectRatio()
This method returns the aspect ratio.
Definition CCamera.cpp:491
void setStereoEyeSeparation(double a_stereoEyeSeparation)
This method sets the stereo eye separation.
Definition CCamera.cpp:558
void updateGPU()
This method resets textures and display lists for the world associated with this camera.
Definition CCamera.cpp:1896
cStereoMode getStereoMode()
This method returns the current stereo mode being used.
Definition CCamera.h:375
void setStereoFocalLength(double a_stereoFocalLength)
This method sets the stereo focal length.
Definition CCamera.cpp:539
void setSphericalDeg(const double &a_radius, const double &a_polarDeg, const double &a_azimuthDeg)
This method sets the position and orientation of the camera in spherical coordinates in degrees.
Definition CCamera.cpp:270
void setFieldViewAngleDeg(double a_fieldViewAngleDeg)
This method sets the field of view angle (in degrees).
Definition CCamera.cpp:476
cWorld * m_parentWorld
Parent world.
Definition CCamera.h:436
void setMirrorHorizontal(bool a_enabled)
This method enables or disables output image mirroring horizontally.
Definition CCamera.cpp:571
void setSphericalReferences(const cVector3d &a_originReference, const cVector3d &a_zenithReference, const cVector3d &a_azimuthReference)
This method sets the reference vectors that define the basis of the spherical coordinate system.
Definition CCamera.cpp:288
bool m_useShadowCasting
If true, then shadow casting is used.
Definition CCamera.h:457
bool getMirrorVertical()
This method returns true then output image is mirrored vertically, false otherwise.
Definition CCamera.h:394
unsigned int m_lastDisplayHeight
Last height size of the window.
Definition CCamera.h:472
virtual bool selectLayers(const int a_windowPosX, const int a_windowPosY, const int a_windowWidth, const int a_windowHeight, cCollisionRecorder &a_collisionRecorder, cCollisionSettings &a_collisionSettings, bool a_checkFrontLayer=true, bool a_checkBackLayer=true)
This method queries whether the specified position is 'pointing at' any widget on selected layers.
Definition CCamera.cpp:870
cStereoMode m_stereoMode
Stereo rendering mode.
Definition CCamera.h:466
void setSphericalAzimuthDeg(const double &a_azimuthDeg)
This method sets the azimuth position of the camera in degrees (spherical coordinates).
Definition CCamera.cpp:376
void setSphericalAzimuthReference(const cVector3d &a_azimuthReference)
This method sets the azimuth reference direction vector of the camera (spherical coordinates).
Definition CCamera.cpp:418
cVector3d getUpVector() const
This method returns the "up" vector for this camera.
Definition CCamera.h:183
double getStereoFocalLength()
This method returns the stereo focal length.
Definition CCamera.h:325
void setSphericalPolarDeg(const double &a_polarDeg)
This method sets the polar position of the camera in degrees (spherical coordinates).
Definition CCamera.cpp:348
virtual bool selectFrontLayer(const int a_windowPosX, const int a_windowPosY, const int a_windowWidth, const int a_windowHeight, cCollisionRecorder &a_collisionRecorder, cCollisionSettings &a_collisionSettings)
This method queries whether the specified position is 'pointing at' any widget on the front layer.
Definition CCamera.cpp:804
double m_distanceFar
Distance to far clipping plane.
Definition CCamera.h:442
void setOrthographicView(double a_viewWidth)
This method sets the camera in orthographic mode.
Definition CCamera.cpp:460
void setSphericalZenithReference(const cVector3d &a_zenithReference)
This method sets the zenith reference direction vector of the camera (spherical coordinates).
Definition CCamera.cpp:390
void attachAudioDevice(cAudioDevice *a_audioDevice)
This method attaches an audio device to the camera.
Definition CCamera.h:404
double m_posPolarRad
Camera polar position in radians (spherical coordinates).
Definition CCamera.h:493
virtual bool selectWorld(const int a_windowPosX, const int a_windowPosY, const int a_windowWidth, const int a_windowHeight, cCollisionRecorder &a_collisionRecorder, cCollisionSettings &a_collisionSettings)
This method queries whether the specified position is 'pointing at' any objects in the world.
Definition CCamera.cpp:671
cVector3d m_azimuthReference
Camera azimuth reference vector (spherical coordinates).
Definition CCamera.h:505
virtual void setUseMultipassTransparency(bool a_enabled)
This method enables or disables additional rendering passes for transparency.
Definition CCamera.cpp:1773
virtual bool set(const cVector3d &a_localPosition, const cVector3d &a_localLookAt, const cVector3d &a_localUp)
This method set the position and orientation of the camera.
Definition CCamera.cpp:196
bool m_markForUpdate
If true then a display reset has been requested.
Definition CCamera.h:475
cTransform m_modelViewMatrix
Modelview matrix of camera.
Definition CCamera.h:269
bool getMirrorHorizontal()
This method returns true then output image is mirrored horizontally, false otherwise.
Definition CCamera.h:391
cDirectionalLight * m_lightBackLayer
Directional light for back plane.
Definition CCamera.h:426
double m_stereoFocalLength
Stereo focal length.
Definition CCamera.h:460
void detachAudioDevice()
This method detaches the current audio device from the camera.
Definition CCamera.h:407
double m_distanceNear
Distance to near clipping plane.
Definition CCamera.h:439
bool m_useCustomProjectionMatrix
If true, then use projection matrix specified in m_projectionMatrix.
Definition CCamera.h:272
This class implements a collision detection recorder that stores all collision events that are report...
Definition CCollisionBasics.h:186
This class implements a directional light source.
Definition CDirectionalLight.h:82
This class implements a base class for all 2D or 3D objects in CHAI3D.
Definition CGenericObject.h:113
cMatrix3d m_localRot
The rotation matrix that rotates my reference frame into my parent's reference frame.
Definition CGenericObject.h:830
This class implements a virtual world.
Definition CWorld.h:93
Definition CAudioBuffer.cpp:57
cEyeMode
Definition CCamera.h:74
@ C_STEREO_LEFT_EYE
Definition CCamera.h:75
@ C_STEREO_RIGHT_EYE
Definition CCamera.h:76
double cRadToDeg(const double &a_angleRad)
This function converts an angle from radians to degrees.
Definition CMaths.h:716
double cDegToRad(const double &a_angleDeg)
This function converts an angle from degrees to radians.
Definition CMaths.h:696
std::shared_ptr< cImage > cImagePtr
Definition CImage.h:64
cStereoMode
Definition CCamera.h:65
@ C_STEREO_PASSIVE_LEFT_RIGHT
Definition CCamera.h:68
@ C_STEREO_PASSIVE_DUAL_DISPLAY
Definition CCamera.h:70
@ C_STEREO_PASSIVE_TOP_BOTTOM
Definition CCamera.h:69
@ C_STEREO_DISABLED
Definition CCamera.h:66
@ C_STEREO_ACTIVE
Definition CCamera.h:67
This structure stores the collision settings that are passed to a collision detector when querying fo...
Definition CCollisionBasics.h:243
cVector3d getCol0() const
This method returns column vector 0 of matrix.
Definition CMatrix3d.h:536
cVector3d getCol1() const
This method returns column vector 1 of matrix.
Definition CMatrix3d.h:557
cVector3d getCol2() const
This method returns column vector 2 of matrix.
Definition CMatrix3d.h:578
This class implements a 3D vector.
Definition CVector3d.h:89