Skip to content

Commit

Permalink
fix and improve
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhang95 committed Jul 15, 2023
1 parent b263830 commit 05d19be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ui/zenoedit/viewport/cameracontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ void CameraControl::setPhi(float phi) {
auto *scene = m_zenovis->getSession()->get_scene();
scene->camera->m_phi = phi;
}
glm::vec3 CameraControl::getCenter() const {
zeno::vec3f CameraControl::getCenter() const {
auto *scene = m_zenovis->getSession()->get_scene();
return scene->camera->m_center;
}
void CameraControl::setCenter(glm::vec3 center) {
void CameraControl::setCenter(zeno::vec3f center) {
auto *scene = m_zenovis->getSession()->get_scene();
scene->camera->m_center = center;
}
Expand Down Expand Up @@ -297,7 +297,7 @@ void CameraControl::fakeMouseMoveEvent(QMouseEvent *event)
setCenter({float(center.x()), float(center.y()), float(center.z())});
} else {
setTheta(getTheta() - dy * M_PI);
setPhi(getTheta() + dx * M_PI);
setPhi(getPhi() + dx * M_PI);
}
m_lastPos = QPointF(xpos, ypos);
} else if (event->buttons() & Qt::LeftButton) {
Expand Down
4 changes: 2 additions & 2 deletions ui/zenoedit/viewport/cameracontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class CameraControl : public QObject
void setTheta(float theta);
float getPhi() const;
void setPhi(float phi);
glm::vec3 getCenter() const;
void setCenter(glm::vec3 center);
zeno::vec3f getCenter() const;
void setCenter(zeno::vec3f center);
bool getOrthoMode() const;
void setOrthoMode(bool OrthoMode);
float getRadius() const;
Expand Down
2 changes: 1 addition & 1 deletion zenovis/include/zenovis/Camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct Camera {

float m_theta = 0;
float m_phi = 0;
glm::vec3 m_center = {};
zeno::vec3f m_center = {};
bool m_ortho_mode = false;
float m_radius = 5;

Expand Down

0 comments on commit 05d19be

Please sign in to comment.