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_();}
98 void rotateAboutView(
float degree);
102 {
return view_point_.getDistance(look_at_);}
106 {
return view_vector_;}
110 {
return right_vector_;}
113 void translate(
const Vector3& v);
130 { projection_mode_ = mode; }
134 {
return projection_mode_; }
140 bool readFromString(
const String& data);
161 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
165 void calculateVectors_();
194 #endif //BALL_VIEW_RENDERING_CAMERA_H
void moveForward(float translation)
Move the camera along the view vector.
Vector3 getViewVector() const
Get the view vector.
ProjectionMode projection_mode_
void setProjectionMode(ProjectionMode const &mode)
Set the projection mode.
ProjectionMode
Enumeration of different projection modes.
virtual void clear()
Reset Camera to standard values.
void setViewPoint(const Vector3 &view_point)
Set the position of the camera.
const Vector3 & getLookAtPosition() const
Get the direction of the camera.
void moveUp(float translation)
Move the camera along the up vector.
BALL_EXPORT bool operator<(const String &s1, const String &s2)
void setLookAtPosition(const Vector3 &look_at)
Set the direction of the camera.
const Vector3 & getViewPoint() const
Get the position of the camera.
void moveRight(float translation)
Move the camera along the right vector.
const Vector3 & getLookUpVector() const
Get the look up vector.
BALL_EXPORT bool operator==(const String &s1, const String &s2)
float getDistance() const
Get the distance between the view point and the look at point.
Vector3 getRightVector() const
Get an vector orthogonal to the viewing vector and showing to the right.
virtual ~Camera()
Destructor.
void setLookUpVector(const Vector3 &look_up_vector)
Set the look up vector and compute the new right vector.
ProjectionMode getProjectionMode() const
Get the projection mode.