|
Blender
V2.93
|
Go to the source code of this file.
Classes | |
| struct | RotOrderInfo |
Typedefs | |
| typedef struct RotOrderInfo | RotOrderInfo |
Functions | |
| void | unit_axis_angle (float axis[3], float *angle) |
| void | unit_qt (float q[4]) |
| void | copy_qt_qt (float q[4], const float a[4]) |
| bool | is_zero_qt (const float q[4]) |
| void | mul_qt_qtqt (float q[4], const float a[4], const float b[4]) |
| void | mul_qt_v3 (const float q[4], float r[3]) |
| void | conjugate_qt_qt (float q1[4], const float q2[4]) |
| void | conjugate_qt (float q[4]) |
| float | dot_qtqt (const float a[4], const float b[4]) |
| void | invert_qt (float q[4]) |
| void | invert_qt_qt (float q1[4], const float q2[4]) |
| void | invert_qt_normalized (float q[4]) |
| void | invert_qt_qt_normalized (float q1[4], const float q2[4]) |
| void | mul_qt_fl (float q[4], const float f) |
| void | sub_qt_qtqt (float q[4], const float a[4], const float b[4]) |
| void | pow_qt_fl_normalized (float q[4], const float fac) |
| void | quat_to_compatible_quat (float q[4], const float a[4], const float old[4]) |
| static void | quat_to_mat3_no_error (float m[3][3], const float q[4]) |
| void | quat_to_mat3 (float m[3][3], const float q[4]) |
| void | quat_to_mat4 (float m[4][4], const float q[4]) |
| void | mat3_normalized_to_quat (float q[4], const float mat[3][3]) |
| void | mat3_to_quat (float q[4], const float m[3][3]) |
| void | mat4_normalized_to_quat (float q[4], const float m[4][4]) |
| void | mat4_to_quat (float q[4], const float m[4][4]) |
| void | mat3_to_quat_is_ok (float q[4], const float wmat[3][3]) |
| float | normalize_qt (float q[4]) |
| float | normalize_qt_qt (float r[4], const float q[4]) |
| void | rotation_between_vecs_to_mat3 (float m[3][3], const float v1[3], const float v2[3]) |
| void | rotation_between_vecs_to_quat (float q[4], const float v1[3], const float v2[3]) |
| void | rotation_between_quats_to_quat (float q[4], const float q1[4], const float q2[4]) |
| float | quat_split_swing_and_twist (const float q_in[4], int axis, float r_swing[4], float r_twist[4]) |
| void | vec_to_quat (float q[4], const float vec[3], short axis, const short upflag) |
| void | interp_dot_slerp (const float t, const float cosom, float r_w[2]) |
| void | interp_qt_qtqt (float q[4], const float a[4], const float b[4], const float t) |
| void | add_qt_qtqt (float q[4], const float a[4], const float b[4], const float t) |
| void | tri_to_quat_ex (float quat[4], const float v1[3], const float v2[3], const float v3[3], const float no_orig[3]) |
| float | tri_to_quat (float q[4], const float a[3], const float b[3], const float c[3]) |
| void | print_qt (const char *str, const float q[4]) |
| void | axis_angle_normalized_to_quat (float r[4], const float axis[3], const float angle) |
| void | axis_angle_to_quat (float r[4], const float axis[3], const float angle) |
| void | quat_to_axis_angle (float axis[3], float *angle, const float q[4]) |
| void | axis_angle_to_eulO (float eul[3], const short order, const float axis[3], const float angle) |
| void | eulO_to_axis_angle (float axis[3], float *angle, const float eul[3], const short order) |
| void | axis_angle_normalized_to_mat3_ex (float mat[3][3], const float axis[3], const float angle_sin, const float angle_cos) |
| void | axis_angle_normalized_to_mat3 (float R[3][3], const float axis[3], const float angle) |
| void | axis_angle_to_mat3 (float R[3][3], const float axis[3], const float angle) |
| void | axis_angle_to_mat4 (float R[4][4], const float axis[3], const float angle) |
| void | mat3_normalized_to_axis_angle (float axis[3], float *angle, const float mat[3][3]) |
| void | mat3_to_axis_angle (float axis[3], float *angle, const float mat[3][3]) |
| void | mat4_normalized_to_axis_angle (float axis[3], float *angle, const float mat[4][4]) |
| void | mat4_to_axis_angle (float axis[3], float *angle, const float mat[4][4]) |
| void | axis_angle_to_mat4_single (float R[4][4], const char axis, const float angle) |
| void | axis_angle_to_mat3_single (float R[3][3], const char axis, const float angle) |
| void | angle_to_mat2 (float R[2][2], const float angle) |
| void | axis_angle_to_quat_single (float q[4], const char axis, const float angle) |
| void | quat_normalized_to_expmap (float expmap[3], const float q[4]) |
| void | quat_to_expmap (float expmap[3], const float q[4]) |
| void | expmap_to_quat (float r[4], const float expmap[3]) |
| void | eul_to_mat3 (float mat[3][3], const float eul[3]) |
| void | eul_to_mat4 (float mat[4][4], const float eul[3]) |
| static void | mat3_normalized_to_eul2 (const float mat[3][3], float eul1[3], float eul2[3]) |
| void | mat3_normalized_to_eul (float eul[3], const float mat[3][3]) |
| void | mat3_to_eul (float eul[3], const float mat[3][3]) |
| void | mat4_normalized_to_eul (float eul[3], const float m[4][4]) |
| void | mat4_to_eul (float eul[3], const float m[4][4]) |
| void | quat_to_eul (float eul[3], const float quat[4]) |
| void | eul_to_quat (float quat[4], const float eul[3]) |
| void | rotate_eul (float beul[3], const char axis, const float ang) |
| void | compatible_eul (float eul[3], const float oldrot[3]) |
| void | mat3_normalized_to_compatible_eul (float eul[3], const float oldrot[3], float mat[3][3]) |
| void | mat3_to_compatible_eul (float eul[3], const float oldrot[3], float mat[3][3]) |
| void | quat_to_compatible_eul (float eul[3], const float oldrot[3], const float quat[4]) |
| static const RotOrderInfo * | get_rotation_order_info (const short order) |
| void | eulO_to_quat (float q[4], const float e[3], const short order) |
| void | quat_to_eulO (float e[3], short const order, const float q[4]) |
| void | eulO_to_mat3 (float M[3][3], const float e[3], const short order) |
| static void | mat3_normalized_to_eulo2 (const float mat[3][3], float eul1[3], float eul2[3], const short order) |
| void | eulO_to_mat4 (float mat[4][4], const float e[3], const short order) |
| void | mat3_normalized_to_eulO (float eul[3], const short order, const float m[3][3]) |
| void | mat3_to_eulO (float eul[3], const short order, const float m[3][3]) |
| void | mat4_normalized_to_eulO (float eul[3], const short order, const float m[4][4]) |
| void | mat4_to_eulO (float eul[3], const short order, const float m[4][4]) |
| void | mat3_normalized_to_compatible_eulO (float eul[3], const float oldrot[3], const short order, const float mat[3][3]) |
| void | mat3_to_compatible_eulO (float eul[3], const float oldrot[3], const short order, const float mat[3][3]) |
| void | mat4_normalized_to_compatible_eulO (float eul[3], const float oldrot[3], const short order, const float m[4][4]) |
| void | mat4_to_compatible_eulO (float eul[3], const float oldrot[3], const short order, const float m[4][4]) |
| void | quat_to_compatible_eulO (float eul[3], const float oldrot[3], const short order, const float quat[4]) |
| void | rotate_eulO (float beul[3], const short order, char axis, float ang) |
| void | eulO_to_gimbal_axis (float gmat[3][3], const float eul[3], const short order) |
| void | mat4_to_dquat (DualQuat *dq, const float basemat[4][4], const float mat[4][4]) |
| void | dquat_to_mat4 (float R[4][4], const DualQuat *dq) |
| void | add_weighted_dq_dq (DualQuat *dq_sum, const DualQuat *dq, float weight) |
| void | normalize_dq (DualQuat *dq, float totweight) |
| void | mul_v3m3_dq (float r[3], float R[3][3], DualQuat *dq) |
| void | copy_dq_dq (DualQuat *r, const DualQuat *dq) |
| void | quat_apply_track (float quat[4], short axis, short upflag) |
| void | vec_apply_track (float vec[3], short axis) |
| float | focallength_to_fov (float focal_length, float sensor) |
| float | fov_to_focallength (float hfov, float sensor) |
| static float | mod_inline (float a, float b) |
| float | angle_wrap_rad (float angle) |
| float | angle_wrap_deg (float angle) |
| float | angle_compat_rad (float angle, float angle_compat) |
| BLI_INLINE int | _axis_signed (const int axis) |
| bool | mat3_from_axis_conversion (int src_forward, int src_up, int dst_forward, int dst_up, float r_mat[3][3]) |
| bool | mat3_from_axis_conversion_single (int src_axis, int dst_axis, float r_mat[3][3]) |
Quaternion Angle | |
Unlike the angle between vectors, this does NOT return the shortest angle. See signed functions below for this. | |
| float | angle_normalized_qt (const float q[4]) |
| float | angle_qt (const float q[4]) |
| float | angle_normalized_qtqt (const float q1[4], const float q2[4]) |
| float | angle_qtqt (const float q1[4], const float q2[4]) |
Quaternion Angle (Signed) | |
Angles with quaternion calculation can exceed 180d, Having signed versions of these functions allows 'fabsf(angle_signed_qtqt(...))' to give us the shortest angle between quaternions. With higher precision than subtracting pi afterwards. | |
| float | angle_signed_normalized_qt (const float q[4]) |
| float | angle_signed_normalized_qtqt (const float q1[4], const float q2[4]) |
| float | angle_signed_qt (const float q[4]) |
| float | angle_signed_qtqt (const float q1[4], const float q2[4]) |
Variables | |
| static const RotOrderInfo | rotOrders [] |
| static float | _axis_convert_matrix [23][3][3] |
| static int | _axis_convert_lut [23][24] |
| typedef struct RotOrderInfo RotOrderInfo |
| BLI_INLINE int _axis_signed | ( | const int | axis | ) |
Definition at line 2360 of file math_rotation.c.
Referenced by mat3_from_axis_conversion().
Definition at line 920 of file math_rotation.c.
References Freestyle::a, and t.
Referenced by Quaternion_add().
Definition at line 2046 of file math_rotation.c.
References add_m4_m4m4(), copy_m4_m4(), dot_qtqt(), mul_m4_fl(), DualQuat::quat, DualQuat::scale, DualQuat::scale_weight, and DualQuat::trans.
Referenced by armdef_accumulate_matrix(), and pchan_deform_accumulate().
Definition at line 2277 of file math_rotation.c.
References angle(), and angle_wrap_rad().
Referenced by gizmo_bisect_prop_angle_set(), gizmo_spin_prop_axis_angle_set(), gpencil_guide_event_handling(), gpencil_guide_rotate(), and recalcData_edit_armature().
Definition at line 616 of file math_rotation.c.
References BLI_ASSERT_UNIT_QUAT, and saacos().
Referenced by angle_normalized_qtqt(), angle_qt(), and ED_view3d_cursor3d_position_rotation().
Definition at line 631 of file math_rotation.c.
References angle_normalized_qt(), BLI_ASSERT_UNIT_QUAT, q1, and rotation_between_quats_to_quat().
Referenced by angle_qtqt(), and angle_signed_normalized_qtqt().
Definition at line 622 of file math_rotation.c.
References angle_normalized_qt(), and normalize_qt_qt().
Definition at line 643 of file math_rotation.c.
References angle_normalized_qtqt(), normalize_qt_qt(), and q1.
Referenced by angle_signed_qtqt().
Definition at line 665 of file math_rotation.c.
References BLI_ASSERT_UNIT_QUAT, and saacos().
Referenced by angle_signed_qt().
Definition at line 675 of file math_rotation.c.
References angle_normalized_qtqt(), dot_qtqt(), negate_v4_v4(), and q1.
Referenced by ED_view3d_smooth_view_ex().
Definition at line 686 of file math_rotation.c.
References angle_signed_normalized_qt(), and normalize_qt_qt().
Definition at line 695 of file math_rotation.c.
References angle_qtqt(), dot_qtqt(), negate_v4_v4(), and q1.
Referenced by ED_view3d_quat_to_axis_view(), and view_axis_exec().
Definition at line 1245 of file math_rotation.c.
References angle(), cosf, R, and sinf.
Referenced by bm_face_array_uv_rotate_fit_aabb(), C_Matrix_Rotation(), compensate_rotation_center(), edit_text_cache_populate_select(), init_track_for_stabilization(), p_chart_rotate_fit_aabb(), snap_v2_angle(), and stitch_calculate_island_snapping().
Definition at line 2271 of file math_rotation.c.
References angle(), and mod_inline().
Definition at line 2266 of file math_rotation.c.
References angle(), float(), M_PI, and mod_inline().
Referenced by angle_compat_rad(), C_Matrix_Rotation(), dial_ghostarc_get_angles(), expmap_to_quat(), Quaternion_angle_set(), Quaternion_new(), updateDuplicateKinematicConstraintSettings(), and viewrotate_apply().
Definition at line 1121 of file math_rotation.c.
References angle(), axis_angle_normalized_to_mat3_ex(), cosf, R, and sinf.
Referenced by applyNormalRotation(), applyRotationValue(), applyTrackball(), applyTrackballValue(), axis_angle_to_mat3(), Bend(), bmo_spin_exec(), damptrack_do_transform(), do_kink_spiral(), do_kink_spiral_deform(), do_rotate_brush_task_cb_ex(), gizmo_bisect_prop_angle_set(), gizmo_spin_prop_axis_angle_set(), gpencil_brush_twist_apply(), modifyMesh(), and vec_roll_to_mat3_normalized().
| void axis_angle_normalized_to_mat3_ex | ( | float | mat[3][3], |
| const float | axis[3], | ||
| const float | angle_sin, | ||
| const float | angle_cos | ||
| ) |
axis angle to 3x3 matrix
This takes the angle with sin/cos applied so we can avoid calculating it in some cases.
| axis | rotation axis (must be normalized). |
| angle_sin | sin(angle) |
| angle_cos | cos(angle) |
Definition at line 1086 of file math_rotation.c.
References BLI_ASSERT_UNIT_V3.
Referenced by axis_angle_normalized_to_mat3(), and rotation_between_vecs_to_mat3().
Definition at line 1001 of file math_rotation.c.
References angle(), BLI_ASSERT_UNIT_V3, cosf, mul_v3_v3fl(), r, and sinf.
Referenced by axis_angle_to_quat(), expmap_to_quat(), flip_qt_qt(), pose_solve_roll_chain(), rotation_between_vecs_to_quat(), sculpt_update_brush_delta(), vec_to_quat(), and view_roll_angle().
Definition at line 1058 of file math_rotation.c.
References angle(), axis_angle_to_quat(), order, and quat_to_eulO().
Referenced by BKE_rotMode_change_values(), object_clear_rot(), pchan_clear_rot(), pose_bone_do_paste(), and protectedAxisAngleBits().
Definition at line 1127 of file math_rotation.c.
References angle(), axis_angle_normalized_to_mat3(), nor, normalize_v3_v3(), R, and unit_m3().
Referenced by blender::nodes::align_rotations_auto_pivot(), blender::nodes::align_rotations_fixed_pivot(), axis_angle_to_mat4(), BKE_object_rot_to_mat3(), BKE_pchan_rot_to_mat3(), BKE_scene_cursor_rot_to_mat3(), bmo_create_uvsphere_exec(), C_Matrix_Rotation(), ed_editnurb_spin(), ED_view3d_cursor3d_update(), edbm_dupli_extrude_cursor_invoke(), gizmo_mesh_spin_init_refresh(), joint_callback(), blender::nodes::point_rotate__axis_angle__object_space(), blender::nodes::point_rotate__axis_angle__point_space(), sh_node_vector_rotate_around_axis(), splineik_evaluate_bone(), and transform_data_ext_rotate().
Definition at line 1200 of file math_rotation.c.
References angle(), BLI_assert, cosf, R, and sinf.
Referenced by axis_angle_to_mat4_single(), C_Matrix_Rotation(), calc_overlap(), EEVEE_lookdev_cache_init(), modifyMesh(), and object_preview_camera_create().
Definition at line 1141 of file math_rotation.c.
References angle(), axis_angle_to_mat3(), copy_m4_m3(), R, and unit_m4().
Referenced by constraintob_from_transdata(), TransformReader::dae_rotate_to_mat4(), AnimationImporter::evaluate_animation(), and GPU_matrix_rotate_3fv().
Definition at line 1192 of file math_rotation.c.
References angle(), axis_angle_to_mat3_single(), copy_m4_m3(), and R.
Referenced by blender::io::alembic::ABCTransformWriter::do_write(), image_camera_background_matrix_get(), lookat_m4(), make_duplis_font(), object_warp_calc_view_matrix(), blender::io::alembic::AbcObjectReader::read_matrix(), blender::io::alembic::AbcObjectReader::setupObjectTransform(), UnitConverter::UnitConverter(), and workbench_studiolight_data_update().
Definition at line 1011 of file math_rotation.c.
References angle(), axis_angle_normalized_to_quat(), LIKELY, nor, normalize_v3_v3(), r, and unit_qt().
Referenced by axis_angle_to_eulO(), axis_angle_to_gimbal_axis(), basic_rotate(), bevel_list_apply_tilt(), bevel_list_smooth(), BKE_object_mat3_to_rot(), BKE_rotMode_change_values(), BKE_scene_cursor_rot_to_quat(), bm_edgering_pair_interpolate(), boid_body(), cache_key_incremental_rotation(), do_guides(), do_kink(), ED_object_rotation_from_quat(), ElementRotation_ex(), flyApply(), gizmo_ruler_draw(), loc_axisangle_size_to_mat4(), make_bevel_list_3D_minimum_twist(), make_bevel_list_segment_3D(), minimum_twist_between_two_points(), modifyMesh(), pose_bone_do_paste(), psys_get_birth_coords(), psys_get_dupli_path_transform(), Quaternion_angle_set(), Quaternion_axis_vector_set(), Quaternion_new(), rotation_between_vecs_to_quat(), view_axis_exec(), vieworbit_exec(), viewrotate_apply(), viewrotate_apply_snap(), and walkApply().
Definition at line 1257 of file math_rotation.c.
References angle(), BLI_assert, cosf, sinf, and zero_v3().
Referenced by vieworbit_exec(), viewrotate_apply(), walkApply(), and wm_xr_session_base_pose_calc().
Definition at line 1490 of file math_rotation.c.
References fabsf, float(), floorf, and M_PI.
Referenced by dvar_eval_transChan(), Euler_make_compatible(), mat3_normalized_to_compatible_eul(), mat3_normalized_to_compatible_eulO(), and rotlike_evaluate().
| void conjugate_qt | ( | float | q[4] | ) |
Definition at line 123 of file math_rotation.c.
Referenced by invert_qt(), invert_qt_normalized(), and Quaternion_conjugate().
Definition at line 115 of file math_rotation.c.
References q1.
Referenced by rotation_between_quats_to_quat().
Definition at line 2163 of file math_rotation.c.
References r.
Referenced by BKE_pose_eval_proxy_copy_bone().
Definition at line 52 of file math_rotation.c.
References Freestyle::a.
Referenced by add_pose_transdata(), bevel_list_smooth(), BKE_object_tfm_backup(), BKE_object_tfm_restore(), BKE_pose_copy_pchan_result(), BKE_scene_cursor_quat_to_rot(), BKE_screen_view3d_do_versions_250(), BKE_where_on_path(), bm_edgering_pair_interpolate(), boid_body(), calc_curve_deform(), createTransCursor_view3d(), createTransMBallVerts(), createTransSculpt(), do_path_effectors(), dquat_to_mat4(), ED_object_rotation_from_view(), ED_view3d_cameracontrol_acquire(), ED_view3d_cameracontrol_release(), ED_view3d_cursor3d_position_rotation(), ED_view3d_cursor3d_update(), ED_view3d_lastview_store(), ED_view3d_quat_from_axis_view(), ED_view3d_smooth_view_ex(), fcurves_to_pchan_links_get(), interp_qt_qtqt(), interpolate_pathcache(), invert_qt_qt(), invert_qt_qt_normalized(), metaball_coords_and_quats_apply_with_mat4(), metaball_coords_and_quats_get(), minimum_twist_between_two_points(), modifyMesh(), normalize_qt_qt(), object_clear_rot(), ObjectToTransData(), offset_child(), pose_bone_do_paste(), pose_mirror_info_init(), pose_mirror_info_restore(), poseAnim_mapping_reset(), psys_cache_edit_paths_iter(), psys_get_birth_coords(), psys_get_from_key(), psys_get_particle_on_path(), psys_path_iter_get(), psys_thread_create_path(), ptcache_rigidbody_interpolate(), quat_mul_float(), quat_to_compatible_quat(), Quaternion_CreatePyObject(), Quaternion_imatmul(), restoreElement(), rotateBevelPiece(), SCULPT_do_pose_brush(), sculpt_rake_rotate(), transform_data_ext_rotate(), view3d_localview_update_rv3d(), view3d_smooth_view_state_backup(), view3d_smooth_view_state_restore(), viewops_data_create(), viewrotate_apply(), viewrotate_apply_snap(), wm_xr_draw_matrices_create(), and wm_xr_session_state_update().
Definition at line 130 of file math_rotation.c.
References Freestyle::a.
Referenced by add_weighted_dq_dq(), angle_signed_normalized_qtqt(), angle_signed_qtqt(), dquat_to_mat4(), interp_qt_qtqt(), invert_qt(), mul_v3m3_dq(), normalize_qt(), quat_to_axis_angle(), quat_to_mat3(), quat_to_mat4(), Quaternion_dot(), Quaternion_magnitude_get(), and rotation_between_quats_to_quat().
Definition at line 2016 of file math_rotation.c.
References copy_qt_qt(), dot_qtqt(), len, mul_m4_m4m4(), mul_qt_fl(), DualQuat::quat, quat_to_mat4(), R, DualQuat::scale, DualQuat::scale_weight, sqrtf, t, and DualQuat::trans.
Referenced by armdef_evaluate().
Definition at line 1309 of file math_rotation.c.
References KDL::cos(), float(), and KDL::sin().
Referenced by blender::nodes::align_rotations_auto_pivot(), blender::nodes::align_rotations_fixed_pivot(), ED_object_new_primitive_matrix(), euler_filter_multi_channel(), loc_eul_size_to_mat4(), blender::nodes::point_rotate__axis_angle__object_space(), blender::nodes::point_rotate__axis_angle__point_space(), blender::nodes::point_rotate__euler__object_space(), blender::nodes::point_rotate__euler__point_space(), rotate_eul(), sh_node_vector_rotate_euler(), and blender::bke::tests::TEST().
Definition at line 1336 of file math_rotation.c.
References KDL::cos(), float(), and KDL::sin().
Referenced by BKE_texture_mapping_init().
Definition at line 1439 of file math_rotation.c.
Referenced by modifyMesh(), object_clear_rot(), pchan_clear_rot(), pose_bone_do_paste(), protectedQuaternionBits(), and wm_xr_session_base_pose_calc().
Definition at line 1068 of file math_rotation.c.
References angle(), eulO_to_quat(), order, and quat_to_axis_angle().
Referenced by BKE_rotMode_change_values(), object_clear_rot(), pchan_clear_rot(), pose_bone_do_paste(), and protectedAxisAngleBits().
Definition at line 1905 of file math_rotation.c.
References copy_v3_v3(), eulO_to_mat3(), get_rotation_order_info(), order, R, and zero_v3().
Referenced by gimbal_axis().
Definition at line 1673 of file math_rotation.c.
References KDL::cos(), e, float(), get_rotation_order_info(), M, order, R, and KDL::sin().
Referenced by BKE_object_rot_to_mat3(), BKE_pchan_rot_to_mat3(), BKE_scene_cursor_rot_to_mat3(), ElementRotation_ex(), Euler_rotate(), Euler_to_matrix(), eulO_to_gimbal_axis(), eulO_to_mat4(), joint_callback(), loc_eulO_size_to_mat4(), mathutils_any_to_rotmat(), rotate_eulO(), rotlike_evaluate(), transform_data_ext_rotate(), and transform_evaluate().
Definition at line 1751 of file math_rotation.c.
References copy_m4_m3(), e, eulO_to_mat3(), and order.
Referenced by constraintob_from_transdata().
Definition at line 1626 of file math_rotation.c.
References Freestyle::a, KDL::cos(), e, float(), get_rotation_order_info(), order, R, and KDL::sin().
Referenced by BKE_object_mat3_to_rot(), BKE_rotMode_change_values(), BKE_scene_cursor_rot_to_quat(), Euler_to_quaternion(), eulO_to_axis_angle(), mapping_node_order_flip(), and pose_bone_do_paste().
Definition at line 1292 of file math_rotation.c.
References angle(), angle_wrap_rad(), axis_angle_normalized_to_quat(), LIKELY, normalize_v3_v3(), r, and unit_qt().
Referenced by Quaternion_new().
Definition at line 2250 of file math_rotation.c.
References atanf.
Referenced by BLI_uvproject_camera_info(), ED_view3d_radius_to_dist(), AnimationExporter::get_modified_export_curve(), lineart_main_load_geometries(), and CamerasExporter::operator()().
Definition at line 2255 of file math_rotation.c.
References tanf.
Referenced by AnimationImporter::convert_to_focal_length(), wm_xr_session_state_update(), and DocumentImporter::writeCamera().
|
static |
Definition at line 1612 of file math_rotation.c.
References BLI_assert, order, and rotOrders.
Referenced by eulO_to_gimbal_axis(), eulO_to_mat3(), eulO_to_quat(), and mat3_normalized_to_eulo2().
Generic function for implementing slerp (quaternions and spherical vector coords).
| t | factor in [0..1] |
| cosom | dot product from normalized vectors/quats. |
| r_w | calculated weights. |
Definition at line 872 of file math_rotation.c.
References acosf, BLI_assert, eps, fabsf, IN_RANGE_INCL, LIKELY, sinf, and t.
Referenced by interp_qt_qtqt(), interp_v2_v2v2_slerp(), interp_v3_v3v3_slerp(), and Vector_slerp().
Definition at line 894 of file math_rotation.c.
References Freestyle::a, BLI_ASSERT_UNIT_QUAT, copy_qt_qt(), dot_qtqt(), interp_dot_slerp(), negate_v4_v4(), t, and w().
Referenced by bevel_list_smooth(), BKE_where_on_path(), blend_m3_m3m3(), blend_m4_m4m4(), collision_response(), do_kink_spiral(), do_particle_interpolation(), execute_posetree(), interp_m3_m3m3(), interpolate_pathcache(), pose_slide_apply_quat(), psys_get_birth_coords(), ptcache_particle_interpolate(), ptcache_rigidbody_interpolate(), Quaternion_slerp(), rotateBevelPiece(), and view3d_smoothview_apply().
| void invert_qt | ( | float | q[4] | ) |
Definition at line 135 of file math_rotation.c.
References conjugate_qt(), dot_qtqt(), and mul_qt_fl().
Referenced by invert_qt_qt(), and Quaternion_invert().
| void invert_qt_normalized | ( | float | q[4] | ) |
This is just conjugate_qt for cases we know q is unit-length. we could use conjugate_qt directly, but use this function to show intent, and assert if its ever becomes non-unit-length.
Definition at line 158 of file math_rotation.c.
References BLI_ASSERT_UNIT_QUAT, and conjugate_qt().
Referenced by BKE_object_mat3_to_rot(), dvar_eval_rotDiff(), ED_view3d_from_m4(), invert_qt_qt_normalized(), nla_combine_quaternion_get_inverted_strip_values(), view3d_boxview_sync_axis(), view3d_orbit_apply_dyn_ofs(), view_axis_exec(), and viewrotate_apply_snap().
Definition at line 147 of file math_rotation.c.
References copy_qt_qt(), invert_qt(), and q1.
Definition at line 164 of file math_rotation.c.
References copy_qt_qt(), invert_qt_normalized(), and q1.
Referenced by ED_view3d_distance_set(), ED_view3d_distance_set_from_location(), psys_get_birth_coords(), view3d_orbit_apply_dyn_ofs(), viewrotate_apply_snap(), and wm_xr_pose_to_viewmat().
| bool is_zero_qt | ( | const float | q[4] | ) |
Definition at line 60 of file math_rotation.c.
| bool mat3_from_axis_conversion | ( | int | src_forward, |
| int | src_up, | ||
| int | dst_forward, | ||
| int | dst_up, | ||
| float | r_mat[3][3] | ||
| ) |
Each argument us an axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'] where the first 2 are a source and the second 2 are the target.
Definition at line 2369 of file math_rotation.c.
References _axis_convert_lut, _axis_convert_matrix, _axis_signed(), ARRAY_SIZE, copy_m3_m3(), and unit_m3().
Referenced by BCMatrix::BCMatrix(), mat3_from_axis_conversion_single(), and meshcache_do().
| bool mat3_from_axis_conversion_single | ( | int | src_axis, |
| int | dst_axis, | ||
| float | r_mat[3][3] | ||
| ) |
Use when the second axis can be guessed.
Definition at line 2404 of file math_rotation.c.
References mat3_from_axis_conversion(), and unit_m3().
Referenced by single_axis_convert().
Definition at line 1151 of file math_rotation.c.
References angle(), mat3_normalized_to_quat(), and quat_to_axis_angle().
Referenced by BKE_pchan_mat3_to_rot(), and pivotcon_evaluate().
Definition at line 1543 of file math_rotation.c.
References compatible_eul(), copy_v3_v3(), fabsf, and mat3_normalized_to_eul2().
Referenced by euler_filter_multi_channel(), mat3_to_compatible_eul(), Matrix_to_euler(), and quat_to_compatible_eul().
| void mat3_normalized_to_compatible_eulO | ( | float | eul[3], |
| const float | oldrot[3], | ||
| const short | order, | ||
| const float | mat[3][3] | ||
| ) |
Definition at line 1805 of file math_rotation.c.
References compatible_eul(), copy_v3_v3(), fabsf, mat3_normalized_to_eulo2(), and order.
Referenced by BKE_pchan_mat3_to_rot(), mat3_to_compatible_eulO(), mat4_normalized_to_compatible_eulO(), mat4_to_compatible_eulO(), Matrix_to_euler(), and quat_to_compatible_eulO().
Definition at line 1394 of file math_rotation.c.
References copy_v3_v3(), fabsf, and mat3_normalized_to_eul2().
Referenced by ED_object_add_generic_get_opts(), mat3_to_eul(), mat4_normalized_to_eul(), Matrix_to_euler(), and quat_to_eul().
Definition at line 1368 of file math_rotation.c.
References atan2f, BLI_ASSERT_UNIT_M3, copy_v3_v3(), and hypotf.
Referenced by mat3_normalized_to_compatible_eul(), and mat3_normalized_to_eul().
Definition at line 1761 of file math_rotation.c.
References copy_v3_v3(), fabsf, mat3_normalized_to_eulo2(), and order.
Referenced by BKE_pchan_mat3_to_rot(), mat3_to_eulO(), mat4_normalized_to_eulO(), mat4_to_eulO(), Matrix_to_euler(), and quat_to_eulO().
|
static |
Definition at line 1714 of file math_rotation.c.
References atan2f, BLI_ASSERT_UNIT_M3, copy_v3_v3(), get_rotation_order_info(), hypotf, negate_v3(), order, and R.
Referenced by mat3_normalized_to_compatible_eulO(), and mat3_normalized_to_eulO().
Definition at line 321 of file math_rotation.c.
References BLI_ASSERT_UNIT_M3, negate_v4(), normalize_qt(), and sqrtf.
Referenced by BKE_object_mat3_to_rot(), BKE_pchan_mat3_to_rot(), BKE_scene_cursor_mat3_to_rot(), blend_m3_m3m3(), blend_m4_m4m4(), ED_view3d_from_m4(), mat3_normalized_to_axis_angle(), mat3_to_quat(), mat4_decompose(), mat4_normalized_to_quat(), mat4_to_loc_quat(), and test_quat_to_mat_to_quat().
Definition at line 1160 of file math_rotation.c.
References angle(), mat3_to_quat(), and quat_to_axis_angle().
Referenced by BKE_scene_cursor_mat3_to_rot(), and transform_data_ext_rotate().
Definition at line 1564 of file math_rotation.c.
References mat3_normalized_to_compatible_eul(), and normalize_m3_m3().
| void mat3_to_compatible_eulO | ( | float | eul[3], |
| const float | oldrot[3], | ||
| const short | order, | ||
| const float | mat[3][3] | ||
| ) |
Definition at line 1829 of file math_rotation.c.
References mat3_normalized_to_compatible_eulO(), normalize_m3_m3(), and order.
Referenced by BKE_scene_cursor_mat3_to_rot(), ElementRotation_ex(), Euler_rotate(), and transform_data_ext_rotate().
Definition at line 1409 of file math_rotation.c.
References mat3_normalized_to_eul(), and normalize_m3_m3().
Referenced by blender::nodes::align_rotations_auto_pivot(), blender::nodes::align_rotations_fixed_pivot(), mat4_to_eul(), object_convert_exec(), blender::nodes::point_rotate__axis_angle__object_space(), blender::nodes::point_rotate__axis_angle__point_space(), blender::nodes::point_rotate__euler__object_space(), blender::nodes::point_rotate__euler__point_space(), rotate_eul(), and view3d_interactive_add_modal().
Definition at line 1779 of file math_rotation.c.
References mat3_normalized_to_eulO(), normalize_m3_m3(), and order.
Referenced by BKE_scene_cursor_mat3_to_rot(), blender::io::alembic::copy_m44_axis_swap(), rotate_eulO(), and transform_evaluate().
Definition at line 384 of file math_rotation.c.
References mat3_normalized_to_quat(), and normalize_m3_m3().
Referenced by ED_view3d_cursor3d_position_rotation(), ElementRotation_ex(), execute_posetree(), interp_m3_m3m3(), mat3_to_axis_angle(), mat3_vec_to_roll(), mat4_to_quat(), Matrix_decompose(), Matrix_to_quaternion(), modifyMesh(), object_preview_camera_create(), psys_get_birth_coords(), Quaternion_rotate(), transform_data_ext_rotate(), and view_axis_exec().
Definition at line 410 of file math_rotation.c.
References angle(), atan2f, copy_m3_m3(), cosf, invert_m3_m3(), mul_m3_v3(), mul_qt_qtqt(), nor, normalize_m3(), normalize_v3(), q1, quat_to_mat3_no_error(), saacos(), and sinf.
Referenced by boid_body(), psys_cache_edit_paths_iter(), psys_get_birth_coords(), and visualkey_get_values().
Definition at line 1171 of file math_rotation.c.
References angle(), mat4_normalized_to_quat(), and quat_to_axis_angle().
| void mat4_normalized_to_compatible_eulO | ( | float | eul[3], |
| const float | oldrot[3], | ||
| const short | order, | ||
| const float | m[4][4] | ||
| ) |
Definition at line 1840 of file math_rotation.c.
References copy_m3_m4(), mat3_normalized_to_compatible_eulO(), and order.
Definition at line 1417 of file math_rotation.c.
References copy_m3_m4(), and mat3_normalized_to_eul().
Definition at line 1787 of file math_rotation.c.
References copy_m3_m4(), mat3_normalized_to_eulO(), and order.
Definition at line 394 of file math_rotation.c.
References copy_m3_m4(), and mat3_normalized_to_quat().
Referenced by mat4_normalized_to_axis_angle(), and obmat_to_viewmat().
Definition at line 1182 of file math_rotation.c.
References angle(), mat4_to_quat(), and quat_to_axis_angle().
Referenced by constraintRotLim(), and visualkey_get_values().
| void mat4_to_compatible_eulO | ( | float | eul[3], |
| const float | oldrot[3], | ||
| const short | order, | ||
| const float | m[4][4] | ||
| ) |
Definition at line 1851 of file math_rotation.c.
References copy_m3_m4(), mat3_normalized_to_compatible_eulO(), normalize_m3(), and order.
Referenced by rotlike_evaluate().
Conversion routines between (regular quaternion, translation) and dual quaternion.
Version 1.0.0, February 7th, 2007
Copyright (C) 2006-2007 University of Dublin, Trinity College, All Rights Reserved
This software is provided 'as-is', without any express or implied warranty. In no event will the author(s) be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
Definition at line 1958 of file math_rotation.c.
References copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), determinant_m4(), invert_m4_m4(), is_orthonormal_m3(), len_squared_v3(), mat4_to_quat(), mat4_to_size(), mul_m4_m4m4(), mul_m4_series, orthogonalize_m4(), DualQuat::quat, quat_to_mat4(), R, DualQuat::scale, DualQuat::scale_weight, square_f(), t, and DualQuat::trans.
Referenced by armdef_accumulate_matrix(), BKE_pchan_bbone_segments_cache_compute(), and BKE_pose_bone_done().
Definition at line 1423 of file math_rotation.c.
References copy_m3_m4(), and mat3_to_eul().
Referenced by actcon_get_tarmat(), bc_decompose(), and blender::float4x4::to_euler().
Definition at line 1796 of file math_rotation.c.
References copy_m3_m4(), mat3_normalized_to_eulO(), normalize_m3(), and order.
Referenced by BKE_driver_target_matrix_to_rot_channels(), childof_evaluate(), constraintRotLim(), pivotcon_evaluate(), rotlike_evaluate(), rotlimit_evaluate(), and visualkey_get_values().
Definition at line 402 of file math_rotation.c.
References copy_m3_m4(), and mat3_to_quat().
Referenced by bc_decompose(), bc_rotate_from_reference_quat(), BKE_driver_target_matrix_to_rot_channels(), BKE_mball_transform(), constraintRotLim(), dvar_eval_rotDiff(), execute_posetree(), mat4_to_axis_angle(), mat4_to_dquat(), Matrix_to_quaternion(), psys_get_birth_coords(), BCQuat::rotate_to(), and AnimationImporter::translate_animation_OLD().
Definition at line 2261 of file math_rotation.c.
References Freestyle::a, and floorf.
Referenced by angle_wrap_deg(), and angle_wrap_rad().
Definition at line 171 of file math_rotation.c.
Referenced by dquat_to_mat4(), invert_qt(), normalize_dq(), normalize_qt(), object_clear_rot(), pchan_clear_rot(), protectedQuaternionBits(), quat_mul_float(), Quaternion_angle_set(), Quaternion_axis_vector_set(), Quaternion_imul(), Quaternion_make_compatible(), Quaternion_negate(), Quaternion_rotate(), rotation_between_quats_to_quat(), and test_quat_to_mat_to_quat().
Definition at line 65 of file math_rotation.c.
References Freestyle::a.
Referenced by axis_set_view(), basic_rotate(), bc_rotate_from_reference_quat(), bevel_list_apply_tilt(), bevel_list_smooth(), BKE_mball_transform(), BKE_object_mat3_to_rot(), bm_edgering_pair_interpolate(), cache_key_incremental_rotation(), calc_curve_deform(), dvar_eval_rotDiff(), ED_object_rotation_from_quat(), ED_view3d_cursor3d_position_rotation(), ElementRotation_ex(), flyApply(), interpolate_pathcache(), make_bevel_list_3D_minimum_twist(), make_bevel_list_segment_3D(), mat3_to_quat_is_ok(), minimum_twist_between_two_points(), modifyMesh(), nla_combine_quaternion(), nla_combine_quaternion_get_inverted_strip_values(), psys_get_birth_coords(), psys_path_iter_get(), psys_thread_create_path(), quat_apply_track(), quat_split_swing_and_twist(), quat_to_compatible_quat(), Quaternion_cross(), Quaternion_imatmul(), Quaternion_matmul(), BCQuat::rotate_to(), rotation_between_quats_to_quat(), sub_qt_qtqt(), tri_to_quat_ex(), vec_to_quat(), view3d_orbit_apply_dyn_ofs(), view_axis_exec(), view_roll_angle(), vieworbit_exec(), viewrotate_apply(), viewrotate_apply_snap(), walkApply(), wm_xr_session_base_pose_calc(), and wm_xr_session_state_update().
in fact not, but you may want to use a unit quat, read on...
Shortcut for 'q v q*' when v is actually a quaternion. This removes the need for converting a vector to a quaternion, calculating q's conjugate and converting back to a vector. It also happens to be faster (17+,24* vs * 24+,32*). If q is not a unit quaternion, then v will be both rotated by the same amount as if q was a unit quaternion, and scaled by the square of the length of q.
For people used to python mathutils, its like: def mul_qt_v3(q, v): (q * Quaternion((0.0, v[0], v[1], v[2])) * q.conjugated())[1:]
Definition at line 97 of file math_rotation.c.
References r.
Referenced by axis_angle_to_gimbal_axis(), bevel_list_smooth(), bm_edgering_pair_interpolate(), boid_body(), calc_curve_deform(), curve_create_edit_curves_nor(), do_guides(), do_kink(), do_physical_effector(), draw_view_axis(), DRW_draw_cursor(), ED_view3d_cursor3d_position_rotation(), ED_view3d_distance_set(), ED_view3d_distance_set_from_location(), explodeMesh(), get_effector_data(), gizmo_ruler_draw(), make_bevel_list_3D_minimum_twist(), mball_select_similar_type(), mball_select_similar_type_get(), modifyMesh(), offset_child(), psys_get_birth_coords(), psys_get_dupli_path_transform(), psys_thread_create_path(), Quaternion_matmul(), recalcData_edit_armature(), rotateBevelPiece(), rule_average_speed(), sculpt_rake_rotate(), view3d_boxview_sync_axis(), view3d_orbit_apply_dyn_ofs(), and viewrotate_apply_snap().
Definition at line 2110 of file math_rotation.c.
References copy_m3_m3(), copy_m3_m4(), dot_qtqt(), M, mul_m3_fl(), mul_m3_m3m3(), mul_m3_v3(), mul_m4_v3(), DualQuat::quat, R, r, DualQuat::scale, DualQuat::scale_weight, t, DualQuat::trans, w(), x, y, and z.
Referenced by armature_vert_task_with_dvert().
Definition at line 2085 of file math_rotation.c.
References mul_m4_fl(), mul_qt_fl(), DualQuat::quat, DualQuat::scale, DualQuat::scale_weight, and DualQuat::trans.
Referenced by armature_vert_task_with_dvert(), and armdef_evaluate().
Definition at line 453 of file math_rotation.c.
References dot_qtqt(), len, mul_qt_fl(), and sqrtf.
Referenced by basic_rotate(), bevel_list_apply_tilt(), bevel_list_smooth(), BKE_rotMode_change_values(), bm_edgering_pair_interpolate(), calc_curve_deform(), joint_callback(), make_bevel_list_segment_3D(), mat3_normalized_to_quat(), normalize_qt_qt(), ob_parcurve(), pose_bone_do_paste(), pose_slide_apply_quat(), psys_get_birth_coords(), Quaternion_normalize(), sculpt_transform_matrices_init(), view_roll_angle(), vieworbit_exec(), viewrotate_apply(), and viewrotate_apply_snap().
Definition at line 468 of file math_rotation.c.
References copy_qt_qt(), normalize_qt(), and r.
Referenced by angle_qt(), angle_qtqt(), angle_signed_qt(), axis_set_view(), BKE_object_mat3_to_rot(), BKE_object_rot_to_mat3(), BKE_pchan_rot_to_mat3(), BKE_scene_cursor_rot_to_mat3(), BKE_scene_cursor_rot_to_quat(), constraintob_from_transdata(), make_duplis_particle_system(), mathutils_any_to_rotmat(), nla_combine_quaternion(), nla_combine_quaternion_get_inverted_strip_values(), pchan_clear_rot(), pose_slide_apply_quat(), protectedQuaternionBits(), quat_to_compatible_quat(), quat_to_expmap(), Quaternion_angle_get(), Quaternion_angle_set(), Quaternion_axis_vector_get(), Quaternion_axis_vector_set(), Quaternion_make_compatible(), Quaternion_rotate(), Quaternion_to_axis_angle(), Quaternion_to_euler(), test_quat_to_mat_to_quat(), and transform_data_ext_rotate().
Definition at line 192 of file math_rotation.c.
References angle(), BLI_ASSERT_UNIT_QUAT, cosf, normalize_v3_length(), saacos(), and sinf.
Referenced by nla_combine_quaternion(), nla_combine_quaternion_get_inverted_strip_values(), and sculpt_rake_rotate().
| void print_qt | ( | const char * | str, |
| const float | q[4] | ||
| ) |
Definition at line 994 of file math_rotation.c.
References str.
| void quat_apply_track | ( | float | quat[4], |
| short | axis, | ||
| short | upflag | ||
| ) |
Definition at line 2169 of file math_rotation.c.
References BLI_assert, float(), M_SQRT1_2, and mul_qt_qtqt().
Referenced by calc_curve_deform(), followpath_get_tarmat(), and ob_parcurve().
Definition at line 1273 of file math_rotation.c.
References angle(), BLI_ASSERT_UNIT_QUAT, mul_v3_fl(), and quat_to_axis_angle().
Referenced by quat_to_expmap().
| float quat_split_swing_and_twist | ( | const float | q_in[4], |
| int | axis, | ||
| float | r_swing[4], | ||
| float | r_twist[4] | ||
| ) |
Decompose a quaternion into a swing rotation (quaternion with the selected axis component locked at zero), followed by a twist rotation around the axis.
| q | input quaternion. |
| axis | twist axis in [0,1,2] |
| r_swing | if not NULL, receives the swing quaternion. |
| r_twist | if not NULL, receives the twist quaternion. |
Definition at line 564 of file math_rotation.c.
References atan2f, BLI_assert, BLI_ASSERT_UNIT_EPSILON, copy_v4_v4(), cosf, fabsf, mul_qt_qtqt(), negate_v4_v4(), sinf, t, and zero_v3().
Referenced by BKE_driver_target_matrix_to_rot_channels(), mat3_vec_to_roll(), Quaternion_to_swing_twist(), and TEST().
Definition at line 1024 of file math_rotation.c.
References acosf, angle(), dot_qtqt(), fabsf, is_zero_v3(), and sinf.
Referenced by BKE_object_mat3_to_rot(), BKE_rotMode_change_values(), BKE_scene_cursor_quat_to_rot(), ElementRotation_ex(), eulO_to_axis_angle(), flip_qt_qt(), mat3_normalized_to_axis_angle(), mat3_to_axis_angle(), mat4_normalized_to_axis_angle(), mat4_to_axis_angle(), pose_bone_do_paste(), quat_normalized_to_expmap(), Quaternion_angle_set(), Quaternion_axis_vector_get(), Quaternion_axis_vector_set(), Quaternion_to_axis_angle(), and sculpt_update_brush_delta().
Definition at line 1571 of file math_rotation.c.
References mat3_normalized_to_compatible_eul(), and quat_to_mat3().
Referenced by Quaternion_to_euler(), and BCMatrix::set_transform().
| void quat_to_compatible_eulO | ( | float | eul[3], |
| const float | oldrot[3], | ||
| const short | order, | ||
| const float | quat[4] | ||
| ) |
Definition at line 1864 of file math_rotation.c.
References mat3_normalized_to_compatible_eulO(), order, and quat_to_mat3().
Referenced by BKE_object_mat3_to_rot(), BKE_scene_cursor_quat_to_rot(), and Quaternion_to_euler().
Apply the rotation of a to q keeping the values compatible with old. Avoid axis flipping for animated f-curves for eg.
Definition at line 207 of file math_rotation.c.
References Freestyle::a, BLI_ASSERT_UNIT_QUAT, copy_qt_qt(), eps, len_squared_v4v4(), mul_qt_qtqt(), negate_v4_v4(), normalize_qt_qt(), and rotation_between_quats_to_quat().
Referenced by BKE_scene_cursor_mat3_to_rot(), BKE_scene_cursor_quat_to_rot(), pose_slide_apply_quat(), and Quaternion_make_compatible().
Definition at line 1431 of file math_rotation.c.
References mat3_normalized_to_eul(), and quat_to_mat3().
Referenced by ED_object_rotation_from_quat(), blender::nodes::geo_node_object_info_exec(), blender::nodes::normal_to_euler_rotation(), object_clear_rot(), pchan_clear_rot(), pose_bone_do_paste(), protectedQuaternionBits(), Quaternion_to_euler(), BCMatrix::set_transform(), and wm_xr_session_base_pose_calc().
Definition at line 1664 of file math_rotation.c.
References e, mat3_normalized_to_eulO(), order, and quat_to_mat3().
Referenced by axis_angle_to_eulO(), BKE_object_mat3_to_rot(), BKE_rotMode_change_values(), BKE_scene_cursor_quat_to_rot(), mapping_node_order_flip(), pose_bone_do_paste(), and Quaternion_to_euler().
Definition at line 1285 of file math_rotation.c.
References normalize_qt_qt(), and quat_normalized_to_expmap().
Referenced by Quaternion_to_exponential_map().
Definition at line 261 of file math_rotation.c.
References dot_qtqt(), fabsf, and quat_to_mat3_no_error().
Referenced by BKE_crazyspace_build_sculpt(), BKE_curve_deform_co(), BKE_object_rot_to_mat3(), BKE_pchan_rot_to_mat3(), BKE_scene_cursor_rot_to_mat3(), blend_m3_m3m3(), createTransMBallVerts(), ED_view3d_cursor3d_update(), execute_posetree(), getTransformOrientation_ex(), interp_m3_m3m3(), joint_callback(), loc_quat_size_to_mat4(), mathutils_any_to_rotmat(), ob_parvert3(), quat_to_compatible_eul(), quat_to_compatible_eulO(), quat_to_eul(), quat_to_eulO(), Quaternion_rotate(), Quaternion_to_matrix(), test_quat_to_mat_to_quat(), transform_convert_mesh_crazyspace_transdata_set(), transform_data_ext_rotate(), tri_to_quat_ex(), vec_to_quat(), and viewrotate_apply().
Definition at line 229 of file math_rotation.c.
References double(), float(), M_SQRT2, and q1.
Referenced by mat3_to_quat_is_ok(), and quat_to_mat3().
Definition at line 275 of file math_rotation.c.
References dot_qtqt(), double(), fabs(), float(), M_SQRT2, and q1.
Referenced by bc_rotate_from_reference_quat(), constraintob_from_transdata(), dquat_to_mat4(), dyntopo_detail_size_edit_invoke(), ED_view3d_to_m4(), followpath_get_tarmat(), init_meta(), make_duplis_particle_system(), mat4_to_dquat(), ob_parcurve(), paint_cursor_drawing_setup_cursor_space(), psys_get_dupli_path_transform(), BCQuat::rotate_to(), SCULPT_cloth_simulation_limits_draw(), SCULPT_do_pose_brush(), sculpt_transform_matrices_init(), view3d_viewmatrix_set(), and wm_xr_pose_to_viewmat().
Definition at line 1464 of file math_rotation.c.
References BLI_assert, eul_to_mat3(), mat3_to_eul(), and mul_m3_m3m3().
Definition at line 1878 of file math_rotation.c.
References BLI_assert, eulO_to_mat3(), mat3_to_eulO(), mul_m3_m3m3(), order, and zero_v3().
Referenced by Euler_rotate_axis(), and rotlike_evaluate().
Definition at line 543 of file math_rotation.c.
References conjugate_qt_qt(), dot_qtqt(), mul_qt_fl(), mul_qt_qtqt(), and q1.
Referenced by angle_normalized_qtqt(), DRW_draw_cursor(), pose_solve_roll_chain(), quat_to_compatible_quat(), and Quaternion_rotation_difference().
Calculate a rotation matrix from 2 normalized vectors.
Definition at line 477 of file math_rotation.c.
References axis_angle_normalized_to_mat3_ex(), BLI_ASSERT_UNIT_M3, BLI_ASSERT_UNIT_V3, cross_v3_v3v3(), dot_v3v3(), normalize_v3(), ortho_v3_v3(), unit_m3(), v1, and v2.
Referenced by applyProject(), applyTranslationValue(), cloth_parallel_transport_hair_frame(), ED_view3d_win_to_3d_on_plane_with_fallback(), gizmo_mesh_spin_redo_update_orient_axis(), object_orient_to_location(), and wm_gizmo_set_matrix_rotation_from_z_axis__internal().
Definition at line 515 of file math_rotation.c.
References angle(), angle_normalized_v3v3(), axis_angle_normalized_to_quat(), axis_angle_to_quat(), cross_v3_v3v3(), dot_v3v3(), M_PI, normalize_v3(), ortho_v3_v3(), unit_qt(), v1, and v2.
Referenced by calc_curve_deform(), dyntopo_detail_size_edit_invoke(), ED_view3d_cursor3d_position_rotation(), modifyMesh(), paint_cursor_drawing_setup_cursor_space(), pose_solve_ik_chain(), recalcData_edit_armature(), SCULPT_cloth_simulation_limits_draw(), sculpt_update_brush_delta(), Vector_rotation_difference(), and viewrotate_apply_snap().
Definition at line 179 of file math_rotation.c.
References Freestyle::a, and mul_qt_qtqt().
Referenced by explodeMesh(), sculpt_transform_matrices_init(), and set_crazy_vertex_quat().
Definition at line 985 of file math_rotation.c.
References Freestyle::a, Freestyle::c, len, normal_tri_v3(), and tri_to_quat_ex().
Referenced by make_bevel_list_3D_tangent(), and ob_parvert3().
| void tri_to_quat_ex | ( | float | quat[4], |
| const float | v1[3], | ||
| const float | v2[3], | ||
| const float | v3[3], | ||
| const float | no_orig[3] | ||
| ) |
Definition at line 930 of file math_rotation.c.
References angle(), atan2f, copy_v3_v3(), cosf, invert_m3_m3(), mul_m3_v3(), mul_qt_qtqt(), normal_tri_v3(), normalize_v3(), q1, quat_to_mat3(), saacos(), sinf, sub_v3_v3v3(), v1, and v2.
Referenced by get_dupliface_transform_from_coords(), tan_calc_quat_v3(), and tri_to_quat().
Definition at line 38 of file math_rotation.c.
References angle().
Referenced by apply_objects_internal(), applyarmature_transfer_properties(), BKE_pose_channel_verify(), BKE_pose_rest(), blo_do_versions_250(), object_clear_rot(), and pchan_clear_rot().
| void unit_qt | ( | float | q[4] | ) |
Definition at line 46 of file math_rotation.c.
Referenced by AnimationImporter::apply_matrix_curves(), apply_objects_internal(), applyarmature_transfer_properties(), axis_angle_to_quat(), basic_rotate(), BCQuat::BCQuat(), BKE_curve_bevelList_make(), BKE_mball_element_add(), BKE_pose_channel_verify(), BKE_pose_rest(), blo_do_versions_250(), cache_key_incremental_rotation(), expmap_to_quat(), get_duplivert_transform(), modifyMesh(), nlaevalchan_get_default_values(), object_clear_rot(), offset_child(), particles_fluid_step(), pchan_clear_rot(), pose_solve_translate_chain(), psys_get_birth_coords(), psys_path_iter_get(), psys_thread_create_path(), ptcache_particle_interpolate(), ptcache_particle_read(), Quaternion_CreatePyObject(), Quaternion_identity(), Quaternion_new(), rotation_between_vecs_to_quat(), tan_calc_quat_v3(), vec_to_quat(), view_axis_exec(), and WM_xr_session_state_viewer_pose_rotation_get().
| void vec_apply_track | ( | float | vec[3], |
| short | axis | ||
| ) |
Definition at line 2207 of file math_rotation.c.
References BLI_assert, and copy_v3_v3().
Referenced by calc_curve_deform().
Definition at line 708 of file math_rotation.c.
References angle(), atan2f, axis_angle_normalized_to_quat(), BLI_assert, copy_v3_v3(), cosf, eps, fabsf, len, len_v3(), mul_qt_qtqt(), negate_v3_v3(), nor, normalize_v3(), quat_to_mat3(), saacos(), sinf, unit_qt(), and UNLIKELY.
Referenced by BKE_ptcache_make_particle_key(), bm_edgering_pair_interpolate(), get_duplivert_transform(), make_bevel_list_2D(), make_bevel_list_3D_minimum_twist(), make_bevel_list_3D_zup(), make_bevel_list_segment_3D(), make_duplis_particle_system(), blender::nodes::normal_to_euler_rotation(), psys_get_birth_coords(), Vector_to_track_quat(), and viewrotate_apply_snap().
|
static |
Definition at line 2309 of file math_rotation.c.
Referenced by mat3_from_axis_conversion().
|
static |
Definition at line 2283 of file math_rotation.c.
Referenced by mat3_from_axis_conversion().
|
static |
Definition at line 1598 of file math_rotation.c.
Referenced by get_rotation_order_info().