Go to the documentation of this file. 1 #ifndef BALL_VIEW_RENDERING_CAMERA_H
2 #define BALL_VIEW_RENDERING_CAMERA_H
4 #ifndef BALL_COMMON_GLOBAL_H
8 #ifndef BALL_MATHS_VECTOR3_H
12 #ifndef BALL_MATHS_QUATERNION_H
58 { view_point_ += right_vector_*translation; look_at_ += right_vector_*translation; }
62 { view_point_ += look_up_vector_*translation; look_at_ += look_up_vector_*translation; }
67 Vector3 normal_view_vector(view_vector_);
69 view_point_ += normal_view_vector*translation;
70 look_at_ += normal_view_vector*translation;
75 {
return view_point_;}
79 { view_point_ = view_point; calculateVectors_();}
87 { look_at_ = look_at; calculateVectors_();}
91 {
return look_up_vector_;}
95 { look_up_vector_ = look_up_vector; calculateVectors_();}
102 {
return view_point_.getDistance(look_at_);}
106 {
return view_vector_;}
110 {
return right_vector_;}
130 { projection_mode_ = mode; }
134 {
return projection_mode_; }
161 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
194 #endif //BALL_VIEW_RENDERING_CAMERA_H
virtual ~Camera()
Destructor.
void setLookAtPosition(const Vector3 &look_at)
Set the direction of the camera.
void moveForward(float translation)
Move the camera along the view vector.
void rotateAboutView(float degree)
Rotate up and right around the view vector.
void moveUp(float translation)
Move the camera along the up vector.
BALL_EXPORT bool operator<(const String &s1, const String &s2)
void rotate(const Matrix4x4 &mat, const Vector3 &origin)
Rotate the camera.
void translate(const Vector3 &v)
Translate the view point and the point the camera is looking to by a given vector.
Vector3 getViewVector() const
Get the view vector.
ProjectionMode projection_mode_
virtual void clear()
Reset Camera to standard values.
const Vector3 & getLookUpVector() const
Get the look up vector.
Camera(const Vector3 &view_point, const Vector3 &look_at, const Vector3 &look_up_vector, const ProjectionMode &mode=PERSPECTIVE)
Camera(const Camera &camera)
Copy Constructor.
void moveRight(float translation)
Move the camera along the right vector.
const Vector3 & getViewPoint() const
Get the position of the camera.
float getDistance() const
Get the distance between the view point and the look at point.
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
Vector3 getRightVector() const
Get an vector orthogonal to the viewing vector and showing to the right.
void setProjectionMode(ProjectionMode const &mode)
Set the projection mode.
void rotate(const Quaternion &q, const Vector3 &origin)
Rotate the camera.
ProjectionMode
Enumeration of different projection modes.
void setViewPoint(const Vector3 &view_point)
Set the position of the camera.
void setLookUpVector(const Vector3 &look_up_vector)
Set the look up vector and compute the new right vector.
const Vector3 & getLookAtPosition() const
Get the direction of the camera.
ProjectionMode getProjectionMode() const
Get the projection mode.
BALL_EXPORT bool operator==(const String &s1, const String &s2)
bool readFromString(const String &data)
Vector3 convertCameraToSceneCoordinates(const Vector3 &v)
Convert the given vector from camera system to cartesian coordinates.