Cogs.Core
|
Contains common utility members for camera setup Other camera utilities: Interpolation utilities can be found in: Foundation/Geometry/EasingFn.h Foundation/Geometry/Interpolator.h Foundation/Geometry/Interpolation.hpp Component: CinematicCameraComponent Library: glm. More...
Functions | |
COGSCORE_DLL_API glm::dvec3 | getCenter (const Cogs::Geometry::DBoundingBox &boundingBox) |
Gets center of non-empty bounding box. | |
COGSCORE_DLL_API float | getFarDistance (const glm::dvec3 &position, const Cogs::Geometry::DBoundingBox &boundingBox) |
Gets camera far distance given bounding box. | |
COGSCORE_DLL_API float | getFocalDistance (const glm::dvec3 &position, const Cogs::Geometry::DBoundingBox &boundingBox) |
Gets distance from given position (camera position) to center of bounding box. | |
COGSCORE_DLL_API glm::quat | getOrientation (float horizontalAngle, float verticalAngle) |
Gets the camera orientation from the horizontal and vertical angle values. | |
COGSCORE_DLL_API float | getOrthoHeight (const Cogs::Geometry::DBoundingBox &boundingBox) |
Calculate Orthographic camera orthoHeight Field to view boundingbox. | |
COGSCORE_DLL_API float | getRadius (const Cogs::Geometry::DBoundingBox &boundingBox) |
Gets the radius of the bounding sphere. | |
COGSCORE_DLL_API glm::dvec3 | getFocalPosition (const glm::dvec3 &position, const glm::quat &orientation, float focalDistance) |
COGSCORE_DLL_API glm::dvec3 | getViewAllPosition (const Cogs::Geometry::DBoundingBox &boundingBox, const glm::quat &orientation, float fieldOfView, glm::vec2 viewport) |
Contains common utility members for camera setup Other camera utilities: Interpolation utilities can be found in: Foundation/Geometry/EasingFn.h Foundation/Geometry/Interpolator.h Foundation/Geometry/Interpolation.hpp Component: CinematicCameraComponent Library: glm.
glm::dvec3 Cogs::Utility::CameraHelper::getCenter | ( | const Cogs::Geometry::DBoundingBox & | boundingBox | ) |
Gets center of non-empty bounding box.
Definition at line 17 of file CameraHelper.cpp.
Referenced by getFocalDistance(), getViewAllPosition(), and Cogs::Utility::CameraUtils::viewAll().
float Cogs::Utility::CameraHelper::getFarDistance | ( | const glm::dvec3 & | position, |
const Cogs::Geometry::DBoundingBox & | boundingBox | ||
) |
Gets camera far distance given bounding box.
Definition at line 23 of file CameraHelper.cpp.
References getFocalDistance(), and getRadius().
Referenced by Cogs::Utility::CameraUtils::viewAll().
float Cogs::Utility::CameraHelper::getFocalDistance | ( | const glm::dvec3 & | position, |
const Cogs::Geometry::DBoundingBox & | boundingBox | ||
) |
Gets distance from given position (camera position) to center of bounding box.
Definition at line 29 of file CameraHelper.cpp.
References getCenter().
Referenced by getFarDistance(), and Cogs::Utility::CameraUtils::viewAll().
glm::dvec3 Cogs::Utility::CameraHelper::getFocalPosition | ( | const glm::dvec3 & | position, |
const glm::quat & | orientation, | ||
float | focalDistance | ||
) |
Calculate focal point given camera position, orientation and distance. Can be used to calculate any point aloing an orientation.
position | Start position |
orientation | Orientation of camera |
focalDistance | Distance along ray. |
Definition at line 61 of file CameraHelper.cpp.
glm::quat Cogs::Utility::CameraHelper::getOrientation | ( | float | horizontalAngle, |
float | verticalAngle | ||
) |
Gets the camera orientation from the horizontal and vertical angle values.
horizontalAngle | Horizontal rotation angle |
verticalAngle | Vertical rotation Angle |
Definition at line 36 of file CameraHelper.cpp.
Referenced by Cogs::Utility::CameraUtils::getCameraOrientation().
float Cogs::Utility::CameraHelper::getOrthoHeight | ( | const Cogs::Geometry::DBoundingBox & | boundingBox | ) |
Calculate Orthographic camera orthoHeight Field to view boundingbox.
Definition at line 44 of file CameraHelper.cpp.
References getRadius().
Referenced by Cogs::Utility::CameraUtils::viewAll().
float Cogs::Utility::CameraHelper::getRadius | ( | const Cogs::Geometry::DBoundingBox & | boundingBox | ) |
Gets the radius of the bounding sphere.
Definition at line 54 of file CameraHelper.cpp.
Referenced by getFarDistance(), getOrthoHeight(), and getViewAllPosition().
glm::dvec3 Cogs::Utility::CameraHelper::getViewAllPosition | ( | const Cogs::Geometry::DBoundingBox & | boundingBox, |
const glm::quat & | orientation, | ||
float | fieldOfView, | ||
glm::vec2 | viewport | ||
) |
Calculates a camera position where boundingbox given is shown on the screen.
2D viewport defaults to 0.0f, which would result in an assumed aspect ratio of 1.0f. Use the actual width and height, in pixels, of the 3D view to use the correct aspect ratio in calculations.
boundingBox | Must be a boundingbox with hasExtent(BoundingBoxType box) |
orientation | Camera orientation |
fieldOfView | Camera field of view (also used in ortho camera). |
viewport | Width/Height in pixels of the 3D view |
Definition at line 69 of file CameraHelper.cpp.
References getCenter(), and getRadius().
Referenced by Cogs::Utility::CameraUtils::viewAll().