FIX:ban modify camera distance
jira: none Change-Id: Ic1750df45dd82acc32ce4ede9572690ad0b8911d
This commit is contained in:
parent
ae8baf02a9
commit
9aebcdbdd0
|
@ -524,7 +524,7 @@ std::pair<double, double> Camera::calc_tight_frustrum_zs_around(const BoundingBo
|
|||
{
|
||||
std::pair<double, double> ret;
|
||||
auto& [near_z, far_z] = ret;
|
||||
set_distance(DefaultDistance);
|
||||
|
||||
// box in eye space
|
||||
const BoundingBoxf3 eye_box = box.transformed(m_view_matrix);
|
||||
near_z = -eye_box.max(2);
|
||||
|
@ -544,7 +544,6 @@ std::pair<double, double> Camera::calc_tight_frustrum_zs_around(const BoundingBo
|
|||
|
||||
if (near_z < FrustrumMinNearZ) {
|
||||
const double delta = FrustrumMinNearZ - near_z;
|
||||
set_distance(m_distance + delta);
|
||||
near_z += delta;
|
||||
far_z += delta;
|
||||
}
|
||||
|
@ -667,16 +666,6 @@ double Camera::calc_zoom_to_volumes_factor(const GLVolumePtrs& volumes, Vec3d& c
|
|||
return std::min((double)m_viewport[2] / dx, (double)m_viewport[3] / dy);
|
||||
}
|
||||
|
||||
void Camera::set_distance(double distance)
|
||||
{
|
||||
if (m_distance != distance) {
|
||||
m_view_matrix.translate((distance - m_distance) * get_dir_forward());
|
||||
m_distance = distance;
|
||||
|
||||
update_target();
|
||||
}
|
||||
}
|
||||
|
||||
void Camera::load_camera_view(Camera& cam)
|
||||
{
|
||||
m_target = cam.get_target();
|
||||
|
|
|
@ -164,7 +164,6 @@ private:
|
|||
std::pair<double, double> calc_tight_frustrum_zs_around(const BoundingBoxf3& box);
|
||||
double calc_zoom_to_bounding_box_factor(const BoundingBoxf3& box, double margin_factor = DefaultZoomToBoxMarginFactor) const;
|
||||
double calc_zoom_to_volumes_factor(const GLVolumePtrs& volumes, Vec3d& center, double margin_factor = DefaultZoomToVolumesMarginFactor) const;
|
||||
void set_distance(double distance);
|
||||
|
||||
void set_default_orientation();
|
||||
void set_iso_orientation();
|
||||
|
|
Loading…
Reference in New Issue