void ccGraphicalTransformationTool::reset()
{
	m_rotation.toIdentity();
	m_translation = CCVector3(0,0,0);

	updateAllGLTransformations();
}
Ejemplo n.º 2
0
void ccGraphicalTransformationTool::setRotationCenter(CCVector3d& center)
{
	m_translation += (m_rotationCenter-center) - m_rotation*(m_rotationCenter-center);
	m_rotationCenter = center;

	updateAllGLTransformations();
}
void ccGraphicalTransformationTool::glTranslate(const CCVector3& realT)
{
	CCVector3 t(realT.x * (TxCheckBox->isChecked() ? PC_ONE : 0),
				realT.y * (TyCheckBox->isChecked() ? PC_ONE : 0),
				realT.z * (TzCheckBox->isChecked() ? PC_ONE : 0));

	if (t.norm2() != 0)
	{
		m_translation += t;
		updateAllGLTransformations();
	}
}
void ccGraphicalTransformationTool::glRotate(const ccGLMatrix& rotMat)
{
	switch(rotComboBox->currentIndex())
	{
	case 0: //XYZ
		m_rotation = rotMat * m_rotation;
		break;
	case 1: //X
		m_rotation = rotMat.xRotation() * m_rotation;
		break;
	case 2: //Y
		m_rotation = rotMat.yRotation() * m_rotation;
		break;
	case 3: //Z
		m_rotation = rotMat.zRotation() * m_rotation;
		break;
	}

	updateAllGLTransformations();
}
void ccGraphicalTransformationTool::glRotate(const ccGLMatrix& rotMat)
{
	m_rotation = rotMat * m_rotation;

	updateAllGLTransformations();
}
void ccGraphicalTransformationTool::glTranslate(const CCVector3& t)
{
	m_translation += t;

	updateAllGLTransformations();
}