23 #include <tulip/Coord.h> 24 #include <tulip/Matrix.h> 25 #include <tulip/BoundingBox.h> 26 #include <tulip/Observable.h> 58 Camera(
GlScene *scene, Coord center = Coord(0, 0, 0), Coord eyes = Coord(0, 0, 10),
59 Coord up = Coord(0, -1, 0),
double zoomFactor = 0.5,
double sceneRadius = 10);
102 void move(
float speed);
106 void strafeLeftRight(
float speed);
110 void strafeUpDown(
float speed);
115 void rotate(
float angle,
float x,
float y,
float z);
127 Vector<int, 4> getViewport()
const;
141 void setZoomFactor(
double zoomFactor);
156 void setEyes(
const Coord &eyes);
171 void setCenter(
const Coord ¢er);
186 void setUp(
const Coord &up);
200 Coord viewportTo3DWorld(
const Coord &point)
const;
207 return viewportTo3DWorld(point);
214 Coord worldTo2DViewport(
const Coord &obj)
const;
221 return worldTo2DViewport(obj);
227 virtual void getXML(std::string &outString);
232 virtual void setWithXML(
const std::string &inString,
unsigned int ¤tPosition);
239 void getModelviewMatrix(Matrix<float, 4> &modelviewMatrix)
const {
240 modelviewMatrix = this->modelviewMatrix;
246 void getProjectionMatrix(Matrix<float, 4> &projectionMatrix)
const {
247 projectionMatrix = this->projectionMatrix;
253 void getTransformMatrix(Matrix<float, 4> &transformMatrix)
const {
254 transformMatrix = this->transformMatrix;
260 void getProjAndMVMatrix(
const Vector<int, 4> &viewport, Matrix<float, 4> &projectionMatrix,
261 Matrix<float, 4> &modelviewMatrix)
const;
266 void getTransformMatrix(
const Vector<int, 4> &viewport, Matrix<float, 4> &transformMatrix)
const;
281 void initProjection(
const Vector<int, 4> &viewport,
bool reset =
true);
286 void initProjection(
bool reset =
true);
291 void initModelView();
303 Coord center, eyes, up;
310 Matrix<float, 4> modelviewMatrix;
311 Matrix<float, 4> projectionMatrix;
312 Matrix<float, 4> transformMatrix;
double getSceneRadius() const
Return the scene radius.
Coord screenTo3DWorld(const Coord &point) const
Return the 3D world coordinate for the given viewport point.
void loadCameraParametersWith(const Camera &camera)
Load this camera parameters (eye, center, zoom factor) with an other camera parameters.
Coord getEyes() const
Return the eyes.
This class represents the 3D bounding box of an object. It is mostly used to determine whether or not...
double getZoomFactor() const
Return the zoom factor.
Tulip OpenGL camera object.
Coord worldTo2DScreen(const Coord &obj) const
Return the viewport position for the given 3D coordinate.
GlScene * getScene() const
Return the camera's scene.
bool is3D() const
Return if the camera is a 3D one.
The Observable class is the base of Tulip's observation system.
Coord getCenter() const
Return the center.
Coord getUp() const
Return the up vector.