Commit 2effd50f authored by Sylvain Thery's avatar Sylvain Thery

add resetCenterOfRotation in SimpleQT

parent 7de7491c
......@@ -197,6 +197,8 @@ public:
*/
void setParamObject(float width, float* pos) { m_glWidget->setParamObject(width, pos); }
void resetCenterOfRotation(float width, float* pos) { m_glWidget->resetCenterOfRotation(width, pos); }
/**
* make the contex of glWidget current
*/
......
......@@ -106,6 +106,8 @@ protected:
void changeCenterOfRotation(const glm::vec3& newCenter);
public:
void resetCenterOfRotation(float width, float* pos);
void setParamObject(float width, float* pos);
void setRotation(bool b);
......
......@@ -71,6 +71,21 @@ void GLWidget::setParamObject(float width, float* pos)
m_obj_pos = glm::vec3(-pos[0], -pos[1], -pos[2]);
}
void GLWidget::resetCenterOfRotation(float width, float* pos)
{
m_cbs->trans_x() = 0.;
m_cbs->trans_y() = 0.;
m_cbs->trans_z() = -FAR_PLANE / 5.0f;
// float Z[3] = { 0.0f, 0.0f, 1.0f };
// axis_to_quat(Z, 0.0f, m_cbs->curquat());
setParamObject(width,pos);
recalcModelView();
}
void GLWidget::setRotation(bool b)
{
allow_rotation = b;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment