mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 06:33:57 -06:00
Follow-up of 2d9953069a
This commit is contained in:
parent
cd19756a1d
commit
5631b2cb7c
2 changed files with 6 additions and 6 deletions
|
@ -103,13 +103,13 @@ double Camera::get_fov() const
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera::apply_viewport(int x, int y, unsigned int w, unsigned int h) const
|
void Camera::apply_viewport(int x, int y, unsigned int w, unsigned int h)
|
||||||
{
|
{
|
||||||
glsafe(::glViewport(0, 0, w, h));
|
glsafe(::glViewport(0, 0, w, h));
|
||||||
glsafe(::glGetIntegerv(GL_VIEWPORT, const_cast<std::array<int, 4>*>(&m_viewport)->data()));
|
glsafe(::glGetIntegerv(GL_VIEWPORT, m_viewport.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera::apply_view_matrix() const
|
void Camera::apply_view_matrix()
|
||||||
{
|
{
|
||||||
glsafe(::glMatrixMode(GL_MODELVIEW));
|
glsafe(::glMatrixMode(GL_MODELVIEW));
|
||||||
glsafe(::glLoadIdentity());
|
glsafe(::glLoadIdentity());
|
||||||
|
|
|
@ -91,8 +91,8 @@ public:
|
||||||
|
|
||||||
double get_fov() const;
|
double get_fov() const;
|
||||||
|
|
||||||
void apply_viewport(int x, int y, unsigned int w, unsigned int h) const;
|
void apply_viewport(int x, int y, unsigned int w, unsigned int h);
|
||||||
void apply_view_matrix() const;
|
void apply_view_matrix();
|
||||||
// Calculates and applies the projection matrix tighting the frustrum z range around the given box.
|
// Calculates and applies the projection matrix tighting the frustrum z range around the given box.
|
||||||
// If larger z span is needed, pass the desired values of near and far z (negative values are ignored)
|
// If larger z span is needed, pass the desired values of near and far z (negative values are ignored)
|
||||||
void apply_projection(const BoundingBoxf3& box, double near_z = -1.0, double far_z = -1.0);
|
void apply_projection(const BoundingBoxf3& box, double near_z = -1.0, double far_z = -1.0);
|
||||||
|
@ -105,7 +105,7 @@ public:
|
||||||
#endif // ENABLE_CAMERA_STATISTICS
|
#endif // ENABLE_CAMERA_STATISTICS
|
||||||
|
|
||||||
// translate the camera in world space
|
// translate the camera in world space
|
||||||
void translate_world(const Vec3d& displacement) { this->set_target(m_target + displacement); }
|
void translate_world(const Vec3d& displacement) { set_target(m_target + displacement); }
|
||||||
|
|
||||||
// rotate the camera on a sphere having center == m_target and radius == m_distance
|
// rotate the camera on a sphere having center == m_target and radius == m_distance
|
||||||
// using the given variations of spherical coordinates
|
// using the given variations of spherical coordinates
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue