![]() |
Tulip
4.6.0
Better Visualization Through Research
|
#include <Camera.h>
Inheritance diagram for tlp::Camera:
Collaboration diagram for tlp::Camera:Public Member Functions | |
| Camera (GlScene *scene, Coord center=Coord(0, 0, 0), Coord eyes=Coord(0, 0, 10), Coord up=Coord(0,-1, 0), double zoomFactor=0.5, double sceneRadius=10) | |
| Camera (GlScene *scene, bool d3) | |
| ~Camera () | |
| BoundingBox | getBoundingBox () const |
| Coord | getCenter () const |
| Coord | getEyes () const |
| GlScene * | getScene () const |
| double | getSceneRadius () const |
| Coord | getUp () const |
| Vector< int, 4 > | getViewport () const |
| virtual void | getXML (std::string &outString) |
| double | getZoomFactor () const |
| bool | is3D () const |
| void | loadCameraParametersWith (const Camera &camera) |
| void | move (float speed) |
| Camera & | operator= (const Camera &camera) |
| void | rotate (float angle, float x, float y, float z) |
| Coord | screenTo3DWorld (const Coord &point) const |
| void | setCenter (const Coord ¢er) |
| void | setEyes (const Coord &eyes) |
| void | setScene (GlScene *scene) |
| void | setUp (const Coord &up) |
| virtual void | setWithXML (const std::string &inString, unsigned int ¤tPosition) |
| void | setZoomFactor (double zoomFactor) |
| void | strafeLeftRight (float speed) |
| void | strafeUpDown (float speed) |
| Coord | worldTo2DScreen (const Coord &obj) const |
Tulip OpenGL camera object.
This camera can be a 2D or 3D camera After setup you can do some basic operation :
| tlp::Camera::Camera | ( | GlScene * | scene, |
| Coord | center = Coord(0, 0, 0), |
||
| Coord | eyes = Coord(0, 0, 10), |
||
| Coord | up = Coord(0,-1, 0), |
||
| double | zoomFactor = 0.5, |
||
| double | sceneRadius = 10 |
||
| ) |
Constructor.
| scene | A layer is attached to a scene so we have to specify it in the constructor |
| center | 3D coordinates of point visualized by the camera |
| eye | 3D position of the camera |
| up | normalized up 3D coordinates of the camera |
| zoomFactor | level of zoom of the camera |
| sceneRadius | scene radius of the camera |
| tlp::Camera::Camera | ( | GlScene * | scene, |
| bool | d3 | ||
| ) |
Constructor : used to create a 2D camera.
Destructor.
| BoundingBox tlp::Camera::getBoundingBox | ( | ) | const |
Return the camera bounding box.
This bounding box is the part of the scene visualized by this camera.
| Coord tlp::Camera::getCenter | ( | ) | const [inline] |
| Coord tlp::Camera::getEyes | ( | ) | const [inline] |
| GlScene* tlp::Camera::getScene | ( | ) | const [inline] |
| double tlp::Camera::getSceneRadius | ( | ) | const [inline] |
| Coord tlp::Camera::getUp | ( | ) | const [inline] |
| Vector<int, 4> tlp::Camera::getViewport | ( | ) | const |
Return the viewport of the attached scene.
| virtual void tlp::Camera::getXML | ( | std::string & | outString | ) | [virtual] |
Function to export data in outString (in XML format)
| double tlp::Camera::getZoomFactor | ( | ) | const [inline] |
| bool tlp::Camera::is3D | ( | ) | const [inline] |
| void tlp::Camera::loadCameraParametersWith | ( | const Camera & | camera | ) | [inline] |
| void tlp::Camera::move | ( | float | speed | ) |
This function moves the camera forward or backward depending on the speed.
| void tlp::Camera::rotate | ( | float | angle, |
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
This function rotates the camera's eyes around the center depending on the values passed in.
| Coord tlp::Camera::screenTo3DWorld | ( | const Coord & | point | ) | const |
Return the 3D world coordinate for the given screen point.
| void tlp::Camera::setCenter | ( | const Coord & | center | ) |
Set the center.
3D coordinates of point visualized by the camera
| void tlp::Camera::setEyes | ( | const Coord & | eyes | ) |
Set the eye.
3D position of the camera
| void tlp::Camera::setScene | ( | GlScene * | scene | ) |
Set the camera's scene The viewport is store in the scene, so we must attach camera to a scene.
| void tlp::Camera::setUp | ( | const Coord & | up | ) |
Set the up vector.
normalized up 3D coordinates of the camera
| virtual void tlp::Camera::setWithXML | ( | const std::string & | inString, |
| unsigned int & | currentPosition | ||
| ) | [virtual] |
Function to set data with inString (in XML format)
| void tlp::Camera::setZoomFactor | ( | double | zoomFactor | ) |
Set the zoom factor.
level of zoom of the camera
| void tlp::Camera::strafeLeftRight | ( | float | speed | ) |
This function strafes the camera left and right depending on the speed (-/+)
| void tlp::Camera::strafeUpDown | ( | float | speed | ) |
This function strafes the camera up and down depending on the speed (-/+)
| Coord tlp::Camera::worldTo2DScreen | ( | const Coord & | obj | ) | const |
Return the screen position for the given 3D coordinate.