void rotateSelectionAboutAxis(axis_t axis, float deg)
{
	if (fabs(deg) == 90.0f)
	{
		GlobalSelectionSystem().rotateSelected(
			quaternion_for_axis90(axis, (deg > 0) ? eSignPositive : eSignNegative));
	}
	else
	{
		switch(axis)
		{
		case 0:
			GlobalSelectionSystem().rotateSelected(
				Quaternion::createForMatrix(Matrix4::getRotationAboutXDegrees(deg)));
			break;
		case 1:
			GlobalSelectionSystem().rotateSelected(
				Quaternion::createForMatrix(Matrix4::getRotationAboutYDegrees(deg)));
			break;
		case 2:
			GlobalSelectionSystem().rotateSelected(
				Quaternion::createForMatrix(Matrix4::getRotationAboutZDegrees(deg)));
			break;
		}
	}
}
Beispiel #2
0
inline void Select_RotateAxis (int axis, float deg)
{
	if (fabs(deg) == 90.f) {
		GlobalSelectionSystem().rotateSelected(quaternion_for_axis90((axis_t) axis, (deg > 0) ? eSignPositive
				: eSignNegative));
	} else {
		switch (axis) {
		case 0:
			GlobalSelectionSystem().rotateSelected(quaternion_for_matrix4_rotation(matrix4_rotation_for_x_degrees(deg)));
			break;
		case 1:
			GlobalSelectionSystem().rotateSelected(quaternion_for_matrix4_rotation(matrix4_rotation_for_y_degrees(deg)));
			break;
		case 2:
			GlobalSelectionSystem().rotateSelected(quaternion_for_matrix4_rotation(matrix4_rotation_for_z_degrees(deg)));
			break;
		}
	}
}