Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/xr/intern/wm_xr_session.c
| Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | if (settings->base_pose_type == XR_BASE_POSE_CUSTOM) { | ||||
| axis_angle_to_quat_single(tmp_quatx, 'X', M_PI_2); | axis_angle_to_quat_single(tmp_quatx, 'X', M_PI_2); | ||||
| axis_angle_to_quat_single(tmp_quatz, 'Z', settings->base_pose_angle); | axis_angle_to_quat_single(tmp_quatz, 'Z', settings->base_pose_angle); | ||||
| mul_qt_qtqt(r_base_pose->orientation_quat, tmp_quatz, tmp_quatx); | mul_qt_qtqt(r_base_pose->orientation_quat, tmp_quatz, tmp_quatx); | ||||
| } | } | ||||
| else if (base_pose_object) { | else if (base_pose_object) { | ||||
| float tmp_quat[4]; | float tmp_quat[4]; | ||||
| float tmp_eul[3]; | float tmp_eul[3]; | ||||
| mat4_to_loc_quat(r_base_pose->position, tmp_quat, base_pose_object->obmat); | mat4_to_loc_quat(r_base_pose->position, tmp_quat, base_pose_object->object_to_world); | ||||
| /* Only use rotation around Z-axis to align view with floor. */ | /* Only use rotation around Z-axis to align view with floor. */ | ||||
| quat_to_eul(tmp_eul, tmp_quat); | quat_to_eul(tmp_eul, tmp_quat); | ||||
| tmp_eul[0] = M_PI_2; | tmp_eul[0] = M_PI_2; | ||||
| tmp_eul[1] = 0; | tmp_eul[1] = 0; | ||||
| eul_to_quat(r_base_pose->orientation_quat, tmp_eul); | eul_to_quat(r_base_pose->orientation_quat, tmp_eul); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 1,313 Lines • Show Last 20 Lines | |||||