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);
104 void move(
float speed);
108 void strafeLeftRight(
float speed);
112 void strafeUpDown(
float speed);
117 void rotate(
float angle,
float x,
float y,
float z);
129 Vector<int, 4> getViewport()
const;
143 void setZoomFactor(
double zoomFactor);
158 void setEyes(
const Coord &eyes);
173 void setCenter(
const Coord ¢er);
188 void setUp(
const Coord &up);
202 Coord viewportTo3DWorld(
const Coord &point)
const;
209 return viewportTo3DWorld(point);
216 Coord worldTo2DViewport(
const Coord &obj)
const;
223 return worldTo2DViewport(obj);
229 virtual void getXML(std::string &outString);
234 virtual void setWithXML(
const std::string &inString,
unsigned int ¤tPosition);
241 void getModelviewMatrix(Matrix<float, 4> &modelviewMatrix)
const {
242 modelviewMatrix = this->modelviewMatrix;
248 void getProjectionMatrix(Matrix<float, 4> &projectionMatrix)
const {
249 projectionMatrix = this->projectionMatrix;
255 void getTransformMatrix(Matrix<float, 4> &transformMatrix)
const {
256 transformMatrix = this->transformMatrix;
262 void getProjAndMVMatrix(
const Vector<int, 4> &viewport, Matrix<float, 4> &projectionMatrix,
263 Matrix<float, 4> &modelviewMatrix)
const;
268 void getTransformMatrix(
const Vector<int, 4> &viewport, Matrix<float, 4> &transformMatrix)
const;
283 void initProjection(
const Vector<int, 4> &viewport,
bool reset =
true);
288 void initProjection(
bool reset =
true);
293 void initModelView();
305 Coord center, eyes, up;
312 Matrix<float, 4> modelviewMatrix;
313 Matrix<float, 4> projectionMatrix;
314 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.