#include <VCamera.h>
Definition at line 14 of file VCamera.h.
VCamera::VCamera | ( | ) |
StandardConstructor. Constructor for setting up the necessary Values sets the FOV to 45, the Nearplane to 0.1, the Farplane to 100
Definition at line 8 of file VCamera.cpp.
References mAspectRatio, and mFarPlane.
void VCamera::setProjection | ( | int | width, | |
int | height | |||
) |
Setup Method for Screensize. Sets the Screendimensions
width | integer describing the width of the window | |
height | integer describing the height of the window |
Definition at line 24 of file VCamera.cpp.
References mAspectRatio, mMustUpdateProjection, and updateProjMatrix().
Referenced by VFlowRenderer::resize().
void VCamera::updateProjMatrix | ( | ) |
Updates the Projection Matrix. Updates the Projection Matrix To be called everytime the Projection Changes
Definition at line 42 of file VCamera.cpp.
References VMatrix::clearMatrix(), mAspectRatio, mFarPlane, mFov, mMustUpdateProjection, mNearPlane, mOrthogonalCamera, mProjMatrix, and PI.
Referenced by setProjection(), VFlowRenderer::setShaderWrapperGlyph(), VFlowRenderer::setShaderWrapperGlyphTf(), VFlowRenderer::setShaderWrapperIcon(), VFlowRenderer::setShaderWrapperLIC(), VFlowRenderer::setShaderWrapperLICTexture(), VFlowRenderer::setShaderWrapperLICTextureTf(), VFlowRenderer::setShaderWrapperLICTf(), VFlowRenderer::setShaderWrapperOLICTexture(), VFlowRenderer::setShaderWrapperPressure(), VFlowRenderer::setShaderWrapperStreamLines(), VFlowRenderer::setShaderWrapperStreamLinesGlyph(), VFlowRenderer::setShaderWrapperStreamLinesTf(), VFlowRenderer::setShaderWrapperStreamLinesTfGlyph(), VFlowRenderer::setShaderWrapperVelocity(), VFlowRenderer::setShaderWrapperVorticity(), updateProjMatrixLeft(), and updateProjMatrixRight().
void VCamera::updateProjMatrixLeft | ( | ) |
Updates the Projection Matrix for Left Eye. Updates the Projection Matrix for Left Eye To be called everytime the Projection Changes
Definition at line 96 of file VCamera.cpp.
References mEyeSeparation, mLeftProjMatrix, mMustUpdateProjection, mProjMatrix, mScreenDistance, and updateProjMatrix().
void VCamera::updateProjMatrixRight | ( | ) |
Updates the Projection Matrix for Right Eye. Updates the Projection Matrix for Right Eye To be called everytime the Projection Changes
Definition at line 113 of file VCamera.cpp.
References mEyeSeparation, mMustUpdateProjection, mProjMatrix, mRightProjMatrix, mScreenDistance, and updateProjMatrix().
void VCamera::setProjectionToInfinity | ( | ) |
Sets the Projection to Infinity. Sets the Projection to Infinity, e.g. used for Shadow Volumes
Definition at line 130 of file VCamera.cpp.
References mNearPlane, and mProjMatrix.
void VCamera::setProjectionToNormal | ( | ) |
Sets the Projection to Normal again. Sets the Projection to a non-infinity projection. Used in a normal case
Definition at line 140 of file VCamera.cpp.
References mFarPlane, mNearPlane, and mProjMatrix.
void VCamera::rotateX | ( | float | m_degrees | ) |
Rotates the Camera around the local X-Axis.
m_degrees | float value for rotation angle |
Definition at line 150 of file VCamera.cpp.
References VQuaternion::applyRotationX(), mMustUpdateView, mOrientation, and VQuaternion::normalize().
void VCamera::rotateY | ( | float | m_degrees | ) |
Rotates the Camera around the local Y-Axis.
m_degrees | float value for rotation angle |
Definition at line 161 of file VCamera.cpp.
References VQuaternion::applyRotationY(), mMustUpdateView, mOrientation, and VQuaternion::normalize().
void VCamera::rotateZ | ( | float | m_degrees | ) |
Rotates the Camera around the local Z-Axis.
m_degrees | float value for rotation angle |
Definition at line 172 of file VCamera.cpp.
References VQuaternion::applyRotationZ(), mMustUpdateView, mOrientation, and VQuaternion::normalize().
void VCamera::rotate | ( | float | m_degrees, | |
float | ax, | |||
float | ay, | |||
float | az | |||
) |
Rotates the Camera around an arbitrary axis.
m_degrees | float value for rotation angle |
Definition at line 179 of file VCamera.cpp.
References VQuaternion::applyRotationZ(), mMustUpdateView, mOrientation, and VQuaternion::normalize().
Sets some lookDirection Camera Parameters.
eye | Vector3 position of eyepoint | |
view | Vector3 view direction | |
up | Vector3 the upvector of the camera |
Definition at line 193 of file VCamera.cpp.
References VMatrix::clearMatrix(), VVector::getCross(), VMatrix::getRotation(), VVector::getX(), VVector::getY(), VVector::getZ(), mMustUpdateView, mOrientation, mPosition, mViewMatrix, VQuaternion::normalize(), VVector::normalize(), and VMatrix::translate().
Referenced by VFlowRenderer::processGuiInput(), and VFlowRenderer::VFlowRenderer().
void VCamera::updateViewMatrix | ( | ) |
Updates the View Matrix. Updates the View Matrix To be called every frame even if stereo rendering is used
Updates the View Matrix. Updates the View Matrix To be called every frame
Definition at line 244 of file VCamera.cpp.
References VMatrix::clearMatrix(), VQuaternion::getInverse(), mMustUpdateView, mOrientation, mPosition, mViewMatrix, VQuaternion::normalize(), VMatrix::rotate(), and VMatrix::translate().
Referenced by VFlowRenderer::setShaderWrapperGlyph(), VFlowRenderer::setShaderWrapperGlyphTf(), VFlowRenderer::setShaderWrapperIcon(), VFlowRenderer::setShaderWrapperLIC(), VFlowRenderer::setShaderWrapperLICTexture(), VFlowRenderer::setShaderWrapperLICTextureTf(), VFlowRenderer::setShaderWrapperLICTf(), VFlowRenderer::setShaderWrapperOLICTexture(), VFlowRenderer::setShaderWrapperPressure(), VFlowRenderer::setShaderWrapperStreamLines(), VFlowRenderer::setShaderWrapperStreamLinesGlyph(), VFlowRenderer::setShaderWrapperStreamLinesTf(), VFlowRenderer::setShaderWrapperStreamLinesTfGlyph(), VFlowRenderer::setShaderWrapperVelocity(), VFlowRenderer::setShaderWrapperVorticity(), updateViewMatrixLeft(), and updateViewMatrixRight().
void VCamera::updateViewMatrixLeft | ( | ) |
Updates the View Matrix for the Left Eye. Updates the View Matrix for the Left Eye To be called every frame IMPORTANT: only works if updateViewMatrix is called beforehand
Updates the View Matrix for the Left Eye. Updates the View Matrix for the Left Eye To be called every frame
Definition at line 264 of file VCamera.cpp.
References mEyeSeparation, mLeftViewMatrix, mMustUpdateView, mScreenDistance, mViewMatrix, and updateViewMatrix().
void VCamera::updateViewMatrixRight | ( | ) |
Updates the View Matrix for the Right Eye. Updates the View Matrix for the Right Eye IMPORTANT: only works if updateViewMatrix is called beforehand To be called every frame
Updates the View Matrix for the Right Eye. Updates the View Matrix for the Right Eye To be called every frame
Definition at line 281 of file VCamera.cpp.
References mEyeSeparation, mMustUpdateView, mRightViewMatrix, mScreenDistance, mViewMatrix, and updateViewMatrix().
void VCamera::mouseMove | ( | float | x, | |
float | y, | |||
float | z | |||
) |
Method for Controlling the Camera with the Mouse. Used when doing Mouse Motion
x | float value of way in x direction | |
y | float value of way in y direction | |
z | float value of way in z direction |
Definition at line 300 of file VCamera.cpp.
References mMustUpdateView, and mOrientation.
void VCamera::moveForward | ( | float | way | ) |
Moves the Camera forward. Used if camera only moves in the lookat direction
way | float value of length of motion |
Definition at line 324 of file VCamera.cpp.
References VQuaternion::getForwardVector(), mMustUpdateView, mOrientation, and mPosition.
void VCamera::moveSideWards | ( | float | way | ) |
Moves the Camera sidewards. Used for strafing. movement orthogonal to up and lookat vector
way | float value of length of motion |
m_ScreenDistance | distance to Screen | |
m_EyeSeparation | eye separation of the two eyes |
Definition at line 336 of file VCamera.cpp.
References VQuaternion::getRightVector(), mMustUpdateView, mOrientation, and mPosition.
const VMatrix VCamera::getViewMatrix | ( | ) | const [inline] |
returns the current Viewmatrix.
Definition at line 148 of file VCamera.h.
References mViewMatrix.
Referenced by VFlowRenderer::getCameraSideVector(), VFlowRenderer::getCameraUpVector(), VFlowRenderer::getCameraViewMatrix(), VFlowRenderer::setShaderWrapperGlyph(), VFlowRenderer::setShaderWrapperGlyphTf(), VFlowRenderer::setShaderWrapperIcon(), VFlowRenderer::setShaderWrapperLIC(), VFlowRenderer::setShaderWrapperLICTexture(), VFlowRenderer::setShaderWrapperLICTextureTf(), VFlowRenderer::setShaderWrapperLICTf(), VFlowRenderer::setShaderWrapperOLICTexture(), VFlowRenderer::setShaderWrapperPressure(), VFlowRenderer::setShaderWrapperStreamLines(), VFlowRenderer::setShaderWrapperStreamLinesGlyph(), VFlowRenderer::setShaderWrapperStreamLinesTf(), VFlowRenderer::setShaderWrapperStreamLinesTfGlyph(), VFlowRenderer::setShaderWrapperVelocity(), and VFlowRenderer::setShaderWrapperVorticity().
void VCamera::setViewMatrix | ( | const VMatrix & | m | ) | [inline] |
sets the current Viewmatrix.
m | Matrix4x4 the new viewmatrix |
Definition at line 157 of file VCamera.h.
References mMustUpdateView, and mViewMatrix.
const VMatrix VCamera::getProjMatrix | ( | ) | const [inline] |
returns the current projectionmatrix.
Definition at line 167 of file VCamera.h.
References mProjMatrix.
Referenced by VFlowRenderer::getCameraProjMatrix().
void VCamera::setProjMatrix | ( | const VMatrix & | m | ) | [inline] |
sets the current projectionmatrix.
m | Matrix4x4 the new projectionmatrix |
Definition at line 176 of file VCamera.h.
References mProjMatrix.
const VQuaternion VCamera::getOrientation | ( | ) | const [inline] |
returns the current orientation.
Definition at line 185 of file VCamera.h.
References mOrientation.
void VCamera::setOrientation | ( | const VQuaternion & | q | ) | [inline] |
sets the current orientation.
q | Quaternion containg the new orientation |
Definition at line 194 of file VCamera.h.
References mOrientation.
const VVector VCamera::getPosition | ( | ) | const [inline] |
VVector VCamera::getUpVector | ( | ) | [inline] |
returns the current camera upt Vector
Definition at line 212 of file VCamera.h.
References VQuaternion::getUpVector(), and mOrientation.
VVector VCamera::getAtVector | ( | ) | [inline] |
returns the current camera at Vector
Definition at line 221 of file VCamera.h.
References VQuaternion::getForwardVector(), and mOrientation.
void VCamera::setPosition | ( | VVector & | v | ) | [inline] |
sets the current cameraposition.
v | Vector3 containing the new camera position |
Definition at line 230 of file VCamera.h.
References mMustUpdateView, and mPosition.
float* VCamera::getViewMatrix | ( | ) | [inline] |
returns a Pointer to the First View Matrix element
Definition at line 240 of file VCamera.h.
References mViewMatrix.
float* VCamera::getProjectionMatrix | ( | ) | [inline] |
returns a Pointer to the First Projection Matrix element
Definition at line 249 of file VCamera.h.
References mProjMatrix.
Referenced by VFlowRenderer::setShaderWrapperGlyph(), VFlowRenderer::setShaderWrapperGlyphTf(), VFlowRenderer::setShaderWrapperIcon(), VFlowRenderer::setShaderWrapperLIC(), VFlowRenderer::setShaderWrapperLICTexture(), VFlowRenderer::setShaderWrapperLICTextureTf(), VFlowRenderer::setShaderWrapperLICTf(), VFlowRenderer::setShaderWrapperOLICTexture(), VFlowRenderer::setShaderWrapperPressure(), VFlowRenderer::setShaderWrapperStreamLines(), VFlowRenderer::setShaderWrapperStreamLinesGlyph(), VFlowRenderer::setShaderWrapperStreamLinesTf(), VFlowRenderer::setShaderWrapperStreamLinesTfGlyph(), VFlowRenderer::setShaderWrapperVelocity(), and VFlowRenderer::setShaderWrapperVorticity().
float VCamera::getFov | ( | ) | const [inline] |
returns the field of view.
Definition at line 258 of file VCamera.h.
References mFov.
Referenced by VFlowRenderer::getCameraFOV().
void VCamera::setFov | ( | float | m_fov | ) | [inline] |
sets the field of view.
m_fov | float value containing the new field of view |
Definition at line 267 of file VCamera.h.
References mFov, and mMustUpdateProjection.
float VCamera::getAspecRatio | ( | ) | const [inline] |
returns the camera aspect ratio.
Definition at line 277 of file VCamera.h.
References mAspectRatio.
Referenced by VFlowRenderer::getCameraAspect().
void VCamera::setAspectRatio | ( | float | m_aspect | ) | [inline] |
sets the aspect ratio
m_aspect | float value containing the current aspect ratio |
Definition at line 286 of file VCamera.h.
References mAspectRatio, and mMustUpdateProjection.
void VCamera::setStereoParameters | ( | float | m_ScreenDistance, | |
float | m_EyeSeparation | |||
) |
sets up the necessary parameters for stereo rendering.
m_ScreenDistance | distance to Screen | |
m_EyeSeparation | eye separation of the two eyes |
m_ScreenDistance | focal length of the camera | |
m_EyeSeparation | eye separation of the two eyes |
Definition at line 348 of file VCamera.cpp.
References mEyeSeparation, mMustUpdateProjection, and mScreenDistance.
void VCamera::setOrthogonalCamera | ( | VVector | m_OrthogonalSize, | |
bool | m_OrthogonalCamera = true | |||
) | [inline] |
sets up the camera for orthogonal Projection
m_OrthogonalSize | Vector2 containing the EdgePoints | |
m_OrthogonalCamera | for activating |
Definition at line 304 of file VCamera.h.
References mMustUpdateProjection, mOrthogonalCamera, and mOrthogonalSize.
void VCamera::setAsShadowCamera | ( | bool | m_IsShadow | ) | [inline] |
sets if the camera is ShadowCamera
m_IsShadow | if it is ShadowCamera |
Definition at line 315 of file VCamera.h.
References mIsShadowCamera.
float VCamera::mFov [private] |
Camera Field of View.
Definition at line 323 of file VCamera.h.
Referenced by getFov(), setFov(), and updateProjMatrix().
float VCamera::mAspectRatio [private] |
Camera aspect ratio.
Definition at line 324 of file VCamera.h.
Referenced by getAspecRatio(), setAspectRatio(), setProjection(), updateProjMatrix(), and VCamera().
float VCamera::mNearPlane [private] |
Distance to NearPlane.
Definition at line 325 of file VCamera.h.
Referenced by setProjectionToInfinity(), setProjectionToNormal(), and updateProjMatrix().
float VCamera::mFarPlane [private] |
Distance to FarPlane.
Definition at line 326 of file VCamera.h.
Referenced by setProjectionToNormal(), updateProjMatrix(), and VCamera().
VQuaternion VCamera::mOrientation [private] |
Camera Orientation.
Definition at line 328 of file VCamera.h.
Referenced by getAtVector(), getOrientation(), getUpVector(), lookInDirection(), mouseMove(), moveForward(), moveSideWards(), rotate(), rotateX(), rotateY(), rotateZ(), setOrientation(), and updateViewMatrix().
VVector VCamera::mPosition [private] |
Camera Position.
Definition at line 329 of file VCamera.h.
Referenced by getPosition(), lookInDirection(), moveForward(), moveSideWards(), setPosition(), and updateViewMatrix().
VMatrix VCamera::mViewMatrix [private] |
Current View Matrix.
Definition at line 331 of file VCamera.h.
Referenced by getViewMatrix(), lookInDirection(), setViewMatrix(), updateViewMatrix(), updateViewMatrixLeft(), and updateViewMatrixRight().
VMatrix VCamera::mLeftViewMatrix [private] |
Current View Matrix for the left Eye.
Definition at line 332 of file VCamera.h.
Referenced by updateViewMatrixLeft().
VMatrix VCamera::mRightViewMatrix [private] |
Current View Matrix for the right Eye.
Definition at line 333 of file VCamera.h.
Referenced by updateViewMatrixRight().
VMatrix VCamera::mProjMatrix [private] |
Current Projection Matrix.
Definition at line 334 of file VCamera.h.
Referenced by getProjectionMatrix(), getProjMatrix(), setProjectionToInfinity(), setProjectionToNormal(), setProjMatrix(), updateProjMatrix(), updateProjMatrixLeft(), and updateProjMatrixRight().
VMatrix VCamera::mLeftProjMatrix [private] |
Current Projection Matrix for the left Eye.
Definition at line 335 of file VCamera.h.
Referenced by updateProjMatrixLeft().
VMatrix VCamera::mRightProjMatrix [private] |
Current Projection Matrix for the right Eye.
Definition at line 336 of file VCamera.h.
Referenced by updateProjMatrixRight().
float VCamera::mEyeSeparation [private] |
Eye Seperation.
Definition at line 340 of file VCamera.h.
Referenced by setStereoParameters(), updateProjMatrixLeft(), updateProjMatrixRight(), updateViewMatrixLeft(), and updateViewMatrixRight().
float VCamera::mScreenDistance [private] |
distance to screen.
Definition at line 341 of file VCamera.h.
Referenced by setStereoParameters(), updateProjMatrixLeft(), updateProjMatrixRight(), updateViewMatrixLeft(), and updateViewMatrixRight().
bool VCamera::mMustUpdateProjection [private] |
Bool Containing if Projection Matrix needs updating.
Definition at line 343 of file VCamera.h.
Referenced by setAspectRatio(), setFov(), setOrthogonalCamera(), setProjection(), setStereoParameters(), updateProjMatrix(), updateProjMatrixLeft(), and updateProjMatrixRight().
bool VCamera::mMustUpdateView [private] |
Bool Containing if View Matrix needs updating.
Definition at line 344 of file VCamera.h.
Referenced by lookInDirection(), mouseMove(), moveForward(), moveSideWards(), rotate(), rotateX(), rotateY(), rotateZ(), setPosition(), setViewMatrix(), updateViewMatrix(), updateViewMatrixLeft(), and updateViewMatrixRight().
bool VCamera::mOrthogonalCamera [private] |
if Camera is Orthogonal Camera.
Definition at line 346 of file VCamera.h.
Referenced by setOrthogonalCamera(), and updateProjMatrix().
VVector VCamera::mOrthogonalSize [private] |
Size of Orthogonal Camera.
Definition at line 347 of file VCamera.h.
Referenced by setOrthogonalCamera().
bool VCamera::mIsShadowCamera [private] |
if Camera is Shadow Camera.
Definition at line 348 of file VCamera.h.
Referenced by setAsShadowCamera().