|
Blender V4.3
|
#include <cmath>#include <cstdio>#include <cstdlib>#include <cstring>#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_screen_types.h"#include "DNA_space_types.h"#include "DNA_view3d_types.h"#include "GPU_immediate.hh"#include "GPU_matrix.hh"#include "GPU_state.hh"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_rect.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "ED_view3d.hh"#include "BLT_translation.hh"#include "UI_resources.hh"#include "UI_view2d.hh"#include "transform.hh"#include "transform_gizmo.hh"#include "transform_orientations.hh"#include "transform_snap.hh"#include "transform_constraints.hh"Go to the source code of this file.
Functions | |
Drawing Constraints | |
| static void | drawObjectConstraint (TransInfo *t) |
| static void | drawLine (TransInfo *t, const float center[3], const float dir[3], char axis, short options) |
| void | drawConstraint (TransInfo *t) |
| void | drawPropCircle (TransInfo *t) |
| void | drawPropRange (TransInfo *t) |
Internal Setup Calls | |
| void | setConstraint (TransInfo *t, int mode, const char text[]) |
| void | setAxisMatrixConstraint (TransInfo *t, int mode, const char text[]) |
| void | setLocalConstraint (TransInfo *t, int mode, const char text[]) |
| void | setUserConstraint (TransInfo *t, int mode, const char text_[]) |
Start / Stop Constraints | |
| void | startConstraint (TransInfo *t) |
| void | stopConstraint (TransInfo *t) |
Middle Mouse Button Select | |
| void | initSelectConstraint (TransInfo *t) |
| void | selectConstraint (TransInfo *t) |
| void | postSelectConstraint (TransInfo *t) |
| static void | setNearestAxis2d (TransInfo *t) |
| static void | setNearestAxis3d (TransInfo *t) |
| void | setNearestAxis (TransInfo *t) |
Helper Functions | |
| int | constraintModeToIndex (const TransInfo *t) |
| bool | isLockConstraint (const TransInfo *t) |
| int | getConstraintSpaceDimension (const TransInfo *t) |
Internal Utilities | |
| #define | CONSTRAIN_EPSILON 0.0001f |
| static void | projection_matrix_calc (const TransInfo *t, float r_pmtx[3][3]) |
| static void | view_vector_calc (const TransInfo *t, const float focus[3], float r_vec[3]) |
| static void | constraint_plane_normal_calc (const TransInfo *t, float r_plane_no[3]) |
| void | constraintNumInput (TransInfo *t, float vec[3]) |
| static void | viewAxisCorrectCenter (const TransInfo *t, float t_con_center[3]) |
| static void | axisProjection (const TransInfo *t, const float axis[3], const float in[3], float out[3]) |
| static void | constraint_snap_plane_to_edge (const TransInfo *t, const float plane_no[3], float r_out[3]) |
| static void | UNUSED_FUNCTION (constraint_snap_plane_to_face(const TransInfo *t, const float plane[4], float r_out[3])) |
| void | transform_constraint_snap_axis_to_edge (const TransInfo *t, const float axis[3], float r_out[3]) |
| void | transform_constraint_snap_axis_to_face (const TransInfo *t, const float axis[3], float r_out[3]) |
| static bool | isPlaneProjectionViewAligned (const TransInfo *t, const float plane_no[3]) |
| static void | planeProjection (const TransInfo *t, const float plane_no[3], const float in[3], float out[3]) |
| static short | transform_orientation_or_default (const TransInfo *t) |
| static const float(* | transform_object_axismtx_get (const TransInfo *t, const TransDataContainer *, const TransData *td))[3] |
| void | transform_constraint_get_nearest (const TransInfo *t, const float3 &vec, float r_vec[3]) |
| static void | applyAxisConstraintVec (const TransInfo *t, const TransDataContainer *, const TransData *td, const float in[3], float out[3]) |
| static void | applyObjectConstraintVec (const TransInfo *t, const TransDataContainer *tc, const TransData *td, const float in[3], float out[3]) |
| static void | applyAxisConstraintSize (const TransInfo *t, const TransDataContainer *, const TransData *td, float r_smat[3][3]) |
| static void | applyObjectConstraintSize (const TransInfo *t, const TransDataContainer *tc, const TransData *td, float r_smat[3][3]) |
| static void | constraints_rotation_impl (const TransInfo *t, const float axismtx[3][3], float r_axis[3], float *r_angle) |
| static void | applyAxisConstraintRot (const TransInfo *t, const TransDataContainer *, const TransData *td, float r_axis[3], float *r_angle) |
| static void | applyObjectConstraintRot (const TransInfo *t, const TransDataContainer *tc, const TransData *td, float r_axis[3], float *r_angle) |
| #define CONSTRAIN_EPSILON 0.0001f |
Definition at line 86 of file transform_constraints.cc.
Referenced by constraint_snap_plane_to_edge(), transform_constraint_snap_axis_to_edge(), transform_constraint_snap_axis_to_face(), and UNUSED_FUNCTION().
|
static |
Generic callback for constant spatial constraints applied to rotations
The rotation axis is copied into vec.
In the case of single axis constraints, the rotation axis is directly the one constrained to. For planar constraints (2 axis), the rotation axis is the normal of the plane.
The following only applies when CON_NOFLIP is not set. The vector is then modified to always point away from the screen (in global space) This insures that the rotation is always logically following the mouse. (ie: not doing counterclockwise rotations when the mouse moves clockwise).
Definition at line 612 of file transform_constraints.cc.
References TransInfo::con, CON_APPLY, constraints_rotation_impl(), TransCon::mode, and TransInfo::spacemtx.
Referenced by setConstraint().
|
static |
Generic callback for constant spatial constraints applied to resize motion.
Definition at line 509 of file transform_constraints.cc.
References TransInfo::con, CON_APPLY, CON_AXIS0, CON_AXIS1, CON_AXIS2, TransCon::mode, mul_m3_m3m3(), TransInfo::spacemtx, and TransInfo::spacemtx_inv.
Referenced by setConstraint().
|
static |
Generic callback for constant spatial constraints applied to linear motion
The in vector in projected into the constrained space and then further projected along the view vector. (in perspective mode, the view vector is relative to the position on screen)
Definition at line 459 of file transform_constraints.cc.
References TransInfo::con, CON_APPLY, copy_v3_v3(), TransCon::mode, and transform_constraint_get_nearest().
Referenced by applyObjectConstraintVec(), and setConstraint().
|
static |
Callback for object based spatial constraints applied to rotations
The rotation axis is copied into vec.
In the case of single axis constraints, the rotation axis is directly the one constrained to. For planar constraints (2 axis), the rotation axis is the normal of the plane.
The following only applies when CON_NOFLIP is not set. The vector is then modified to always point away from the screen (in global space) This insures that the rotation is always logically following the mouse. (ie: not doing counterclockwise rotations when the mouse moves clockwise).
Definition at line 636 of file transform_constraints.cc.
References TransData::axismtx, BLI_assert, TransInfo::con, CON_APPLY, constraints_rotation_impl(), TransDataContainer::data, TransInfo::flag, float, TransDataContainer::mat3_unit, TransCon::mode, mul_m3_m3m3(), T_EDIT, TRANS_DATA_CONTAINER_FIRST_OK, and transform_object_axismtx_get().
Referenced by setAxisMatrixConstraint().
|
static |
Callback for object based spatial constraints applied to resize motion.
Definition at line 535 of file transform_constraints.cc.
References TransInfo::con, CON_APPLY, CON_AXIS0, CON_AXIS1, CON_AXIS2, TransInfo::flag, float, invert_m3_m3(), TransDataContainer::mat3_unit, TransCon::mode, mul_m3_m3m3(), T_EDIT, and transform_object_axismtx_get().
Referenced by setAxisMatrixConstraint().
|
static |
Generic callback for object based spatial constraints applied to linear motion
At first, the following is applied without orientation The IN vector in projected into the constrained space and then further projected along the view vector. (in perspective mode, the view vector is relative to the position on screen).
Further down, that vector is mapped to each data's space.
Definition at line 483 of file transform_constraints.cc.
References applyAxisConstraintVec(), TransInfo::con, CON_APPLY, copy_v3_v3(), TransInfo::flag, float, TransDataContainer::mat3_unit, TransCon::mode, mul_m3_v3(), TransInfo::spacemtx_inv, T_EDIT, and transform_object_axismtx_get().
Referenced by setAxisMatrixConstraint().
|
static |
Axis calculation taking the view into account, correcting view-aligned axis.
Definition at line 178 of file transform_constraints.cc.
References add_v3_v3v3(), angle(), angle_v3v3(), BLI_assert, TransInfo::center_global, copy_v3_v3(), cross_v3_v3v3(), DEG2RADF, dot_v3v3(), fabsf, float, is_zero_v3(), isect_ray_ray_v3(), M_PI, M_PI_2, mul(), mul_v3_fl(), mul_v3_v3fl(), norm(), normalize_v3_v3_length(), project_v3_v3v3(), sub_v3_v3v3(), v, view_vector_calc(), viewAxisCorrectCenter(), and TransInfo::viewinv.
Referenced by transform_constraint_get_nearest().
Definition at line 88 of file transform_constraints.cc.
References BLI_assert, TransInfo::con, CON_AXIS0, cross_v3_v3v3(), TransCon::mode, normalize_v3(), and TransInfo::spacemtx.
Referenced by transform_constraint_get_nearest().
|
static |
Snap to the intersection between the edge direction and the constraint plane.
Definition at line 272 of file transform_constraints.cc.
References CONSTRAIN_EPSILON, dot_v3v3(), fabsf, isect_ray_plane_v3_factor(), madd_v3_v3v3fl(), TransSnap::snap_source, TransSnap::snap_target, TransSnap::snapNormal, sub_v3_v3(), and TransInfo::tsnap.
Referenced by transform_constraint_get_nearest().
Definition at line 1228 of file transform_constraints.cc.
References TransInfo::con, CON_APPLY, CON_AXIS0, CON_AXIS1, CON_AXIS2, and TransCon::mode.
Referenced by saveTransform().
Definition at line 106 of file transform_constraints.cc.
References TransInfo::con, CON_APPLY, CON_AXIS0, CON_AXIS1, CON_AXIS2, TransInfo::flag, getConstraintSpaceDimension(), TransCon::mode, and T_NULL_ONE.
Referenced by applyBoneSize(), applyResize(), and applySkinResize().
|
static |
Definition at line 565 of file transform_constraints.cc.
References BLI_assert, TransInfo::center_global, TransInfo::con, CON_APPLY, CON_AXIS0, CON_AXIS1, CON_AXIS2, CON_NOFLIP, copy_v3_v3(), dot_v3v3(), TransInfo::flag, hasNumInput(), TransCon::mode, TransInfo::num, T_INPUT_IS_VALUES_FINAL, and view_vector_calc().
Referenced by applyAxisConstraintRot(), and applyObjectConstraintRot().
| void drawConstraint | ( | TransInfo * | t | ) |
Definition at line 812 of file transform_constraints.cc.
References add_v3_v3(), TransInfo::center_global, TransInfo::con, CON_APPLY, CON_AXIS0, CON_AXIS1, CON_AXIS2, CON_SELECT, convertViewVec(), TransCon::drawExtra, DRAWLIGHT, drawLine(), ELEM, TransInfo::flag, GPU_COMP_F32, GPU_DEPTH_LESS_EQUAL, GPU_DEPTH_NONE, GPU_depth_test(), GPU_depth_test_get(), GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniformColor4f(), immVertex3fv(), immVertexFormat(), MouseInput::imval, TransCon::mode, TransInfo::mouse, TransInfo::mval, SPACE_IMAGE, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, TransInfo::spacemtx, TransInfo::spacetype, and T_NO_CONSTRAINT.
Referenced by drawTransformView().
|
static |
Definition at line 750 of file transform_constraints.cc.
References add_v3_v3v3(), BLI_rctf_size_x(), BLI_rctf_size_y(), View3D::clip_end, col, copy_v3_v3(), View2D::cur, DRAWLIGHT, ELEM, GPU_blend(), GPU_BLEND_ALPHA, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_matrix_pop(), GPU_matrix_push(), GPU_PRIM_LINES, GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immUniformColor3ubv(), immVertex3fv(), immVertexFormat(), max_ff(), mul_v3_fl(), options, pos, SPACE_SEQ, SPACE_VIEW3D, TransInfo::spacetype, sub_v3_v3v3(), TH_GRID, UI_GetThemeColor3ubv(), UI_make_axis_color(), v2, and TransInfo::view.
Referenced by drawConstraint(), and drawObjectConstraint().
|
static |
Definition at line 980 of file transform_constraints.cc.
References TransData::axismtx, TransInfo::con, CON_AXIS0, CON_AXIS1, CON_AXIS2, copy_v3_v3(), CTX_GPENCIL_STROKES, CTX_POSE_BONE, CTX_SEQUENCER_IMAGE, DRAWLIGHT, drawLine(), TransData::factor, TransInfo::flag, float, FOREACH_TRANS_DATA_CONTAINER, TransCon::mode, mul_m3_m3m3(), mul_v3_m4v3(), options, TransInfo::options, T_EDIT, T_PROP_EDIT, and transform_object_axismtx_get().
Referenced by setAxisMatrixConstraint().
| void drawPropCircle | ( | TransInfo * | t | ) |
Called from drawview.c, as an extra per-window draw option.
Definition at line 883 of file transform_constraints.cc.
References TransInfo::aspect, TransInfo::center_global, copy_m4_m4(), TransInfo::flag, GPU_blend(), GPU_BLEND_ALPHA, GPU_COMP_F32, GPU_DEPTH_LESS_EQUAL, GPU_DEPTH_NONE, GPU_depth_test(), GPU_depth_test_get(), GPU_FETCH_FLOAT, GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_scale_2f(), GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), imm_drawcircball(), immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immUniformThemeColorShadeAlpha(), immVertexFormat(), invert_m4_m4(), pos, TransInfo::prop_size, TransInfo::region, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, SPACE_IMAGE, SPACE_VIEW3D, TransInfo::spacetype, T_PROP_EDIT, TH_GRID, unit_m4(), and RegionView3D::viewmat.
Referenced by drawTransformView().
| void drawPropRange | ( | TransInfo * | t | ) |
Draws two lines to indicate a proportional editing range that is only defined in one axis.
Definition at line 946 of file transform_constraints.cc.
References TransInfo::center_global, View2D::cur, TransInfo::flag, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), imm_draw_box_wire_3d(), immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immUniformThemeColorShadeAlpha(), immVertexFormat(), pos, TransInfo::prop_size, TransInfo::region, T_PROP_EDIT, TH_GRID, ARegion::v2d, rctf::ymax, and rctf::ymin.
Referenced by drawTransformView().
Returns the dimension of the constraint space.
For that reason, the flags always needs to be set to properly evaluate here, even if they aren't actually used in the callback function. (Which could happen for weird constraints not yet designed. Along a path for example.)
Definition at line 1267 of file transform_constraints.cc.
References TransInfo::con, CON_AXIS0, CON_AXIS1, CON_AXIS2, and TransCon::mode.
Referenced by constraintNumInput(), startConstraint(), and transform_constraint_get_nearest().
| void initSelectConstraint | ( | TransInfo * | t | ) |
Definition at line 1081 of file transform_constraints.cc.
References CON_APPLY, CON_SELECT, O_DEFAULT, O_SCENE, TransInfo::orient_curr, setUserConstraint(), and transform_orientations_current_set().
Referenced by enable_autolock(), and transformEvent().
| bool isLockConstraint | ( | const TransInfo * | t | ) |
Definition at line 1248 of file transform_constraints.cc.
References TransInfo::con, CON_AXIS0, CON_AXIS1, CON_AXIS2, and TransCon::mode.
Referenced by applyPushPull().
Return true if the 2x axis are both aligned when projected into the view. In this case, we can't usefully project the cursor onto the plane.
Definition at line 337 of file transform_constraints.cc.
References TransInfo::center_global, dot_v3v3(), eps, fabsf, and view_vector_calc().
Referenced by transform_constraint_get_nearest().
|
static |
Definition at line 347 of file transform_constraints.cc.
References add_v3_v3v3(), TransInfo::center_global, isect_ray_plane_v3_factor(), madd_v3_v3v3fl(), pos, and view_vector_calc().
Referenced by transform_constraint_get_nearest().
| void postSelectConstraint | ( | TransInfo * | t | ) |
Definition at line 1098 of file transform_constraints.cc.
References TransInfo::con, CON_AXIS0, CON_AXIS1, CON_AXIS2, and TransCon::mode.
Referenced by transformEvent().
Definition at line 53 of file transform_constraints.cc.
References TransInfo::con, CON_AXIS0, CON_AXIS1, CON_AXIS2, TransCon::mode, mul_m3_m3m3(), TransInfo::spacemtx, TransInfo::spacemtx_inv, unit_m3(), and zero_v3().
Referenced by setAxisMatrixConstraint(), setConstraint(), and setNearestAxis().
| void selectConstraint | ( | TransInfo * | t | ) |
Definition at line 1090 of file transform_constraints.cc.
References TransInfo::con, CON_SELECT, TransCon::mode, setNearestAxis(), and startConstraint().
Referenced by transformApply().
Applies individual td->axismtx constraints.
Definition at line 686 of file transform_constraints.cc.
References applyObjectConstraintRot(), applyObjectConstraintSize(), applyObjectConstraintVec(), TransCon::applyRot, TransCon::applySize, TransCon::applyVec, BLI_strncpy(), TransInfo::con, TransCon::drawExtra, drawObjectConstraint(), TransCon::mode, TransCon::pmtx, projection_matrix_calc(), TransInfo::redraw, startConstraint(), TransCon::text, and TREDRAW_HARD.
Referenced by setLocalConstraint(), and setUserConstraint().
Definition at line 671 of file transform_constraints.cc.
References applyAxisConstraintRot(), applyAxisConstraintSize(), applyAxisConstraintVec(), TransCon::applyRot, TransCon::applySize, TransCon::applyVec, BLI_strncpy(), TransInfo::con, TransCon::drawExtra, TransCon::mode, TransCon::pmtx, projection_matrix_calc(), TransInfo::redraw, startConstraint(), TransCon::text, and TREDRAW_HARD.
Referenced by setLocalConstraint(), and setUserConstraint().
Definition at line 701 of file transform_constraints.cc.
References TransInfo::data_len_all, TransInfo::flag, setAxisMatrixConstraint(), setConstraint(), and T_EDIT.
Referenced by setUserConstraint(), and transformEvent().
| void setNearestAxis | ( | TransInfo * | t | ) |
Definition at line 1202 of file transform_constraints.cc.
References TransInfo::con, TransCon::mode, TransCon::pmtx, projection_matrix_calc(), setNearestAxis2d(), setNearestAxis3d(), SPACE_VIEW3D, TransInfo::spacetype, and transform_gizmo_3d_model_from_constraint_and_mode_set().
Referenced by selectConstraint().
|
static |
Definition at line 1106 of file transform_constraints.cc.
References abs(), TransInfo::con, CON_AXIS0, CON_AXIS1, CON_AXIS2, IFACE_, MouseInput::imval, TransCon::mode, TransInfo::mouse, TransInfo::mval, STRNCPY, and TransCon::text.
Referenced by setNearestAxis().
|
static |
Definition at line 1123 of file transform_constraints.cc.
References add_v3_v3(), TransInfo::center2d, TransInfo::center_global, TransInfo::con, CON_AXIS0, CON_AXIS1, CON_AXIS2, copy_v3_v3(), IFACE_, MouseInput::imval, len, len_v3(), MOD_CONSTRAINT_SELECT_PLANE, TransCon::mode, TransInfo::modifiers, TransInfo::mouse, mul_project_m4_v3_zfac(), mul_v3_fl(), TransInfo::mval, normalize_v3(), TransInfo::persinv, TransInfo::persmat, project_v3_v3v3(), projectFloatView(), TransInfo::region, SNPRINTF, TransInfo::spacemtx, TransInfo::spacename, sub_v2_v2v2(), sub_v3_v3v3(), TransCon::text, and ARegion::winx.
Referenced by setNearestAxis().
Set the constraint according to the user defined orientation
ftext is a format string passed to BLI_snprintf. It will add the name of the orientation where s is (logically).
Definition at line 713 of file transform_constraints.cc.
References ATTR_FALLTHROUGH, checkUseAxisMatrix(), TransInfo::con, CON_USER, TransCon::mode, setAxisMatrixConstraint(), setConstraint(), setLocalConstraint(), SNPRINTF, transform_orientation_or_default(), transform_orientations_spacename_get(), V3D_ORIENT_CURSOR, V3D_ORIENT_CUSTOM, V3D_ORIENT_CUSTOM_MATRIX, V3D_ORIENT_GIMBAL, V3D_ORIENT_GLOBAL, V3D_ORIENT_LOCAL, V3D_ORIENT_NORMAL, and V3D_ORIENT_VIEW.
Referenced by initSelectConstraint(), initTransform(), and transform_event_modal_constraint().
| void startConstraint | ( | TransInfo * | t | ) |
Definition at line 1057 of file transform_constraints.cc.
References TransInfo::con, CON_APPLY, getConstraintSpaceDimension(), NumInput::idx_max, TransInfo::idx_max, min_ii(), TransCon::mode, TransInfo::num, and TransCon::text.
Referenced by InplaceSolverIslandCallback::processIsland(), MultiBodyInplaceSolverIslandCallback::processIsland(), selectConstraint(), setAxisMatrixConstraint(), and setConstraint().
| void stopConstraint | ( | TransInfo * | t | ) |
Definition at line 1064 of file transform_constraints.cc.
References TransInfo::con, CON_APPLY, CON_SELECT, NumInput::idx_max, TransInfo::idx_max, TransCon::mode, TransInfo::num, O_DEFAULT, TransInfo::orient_curr, TransCon::text, and transform_orientations_current_set().
Referenced by transform_event_modal_constraint(), and transformEvent().
Definition at line 386 of file transform_constraints.cc.
References axisProjection(), BLI_assert, TransInfo::con, CON_AXIS0, CON_AXIS1, CON_AXIS2, constraint_plane_normal_calc(), constraint_snap_plane_to_edge(), copy_v3_v3(), getConstraintSpaceDimension(), is_zero_v3(), isPlaneProjectionViewAligned(), TransCon::mode, mul_v3_m3v3(), planeProjection(), TransCon::pmtx, SCE_SNAP_TO_EDGE, SCE_SNAP_TO_FACE, TransInfo::spacemtx, TransSnap::target_type, transform_constraint_snap_axis_to_edge(), transform_constraint_snap_axis_to_face(), transform_snap_is_active(), TransInfo::tsnap, and validSnap().
Referenced by applyAxisConstraintVec(), snap_grid_uv_apply(), and snapObjectsTransform().
| void transform_constraint_snap_axis_to_edge | ( | const TransInfo * | t, |
| const float | axis[3], | ||
| float | r_out[3] ) |
Snap to the nearest point on the axis to the edge/line element.
Definition at line 303 of file transform_constraints.cc.
References CONSTRAIN_EPSILON, dot_v3v3(), fabsf, isect_ray_ray_v3(), mul_v3_v3fl(), TransSnap::snap_source, TransSnap::snap_target, TransSnap::snapNormal, and TransInfo::tsnap.
Referenced by edge_slide_snap_apply(), transform_constraint_get_nearest(), and vert_slide_snap_apply().
| void transform_constraint_snap_axis_to_face | ( | const TransInfo * | t, |
| const float | axis[3], | ||
| float | r_out[3] ) |
Snap to the intersection of the axis and the plane defined by the face.
Definition at line 318 of file transform_constraints.cc.
References CONSTRAIN_EPSILON, dot_v3v3(), fabsf, isect_ray_plane_v3_factor(), mul_v3_v3fl(), TransSnap::snap_source, TransSnap::snap_target, TransSnap::snapNormal, and TransInfo::tsnap.
Referenced by edge_slide_snap_apply(), transform_constraint_get_nearest(), and vert_slide_snap_apply().
|
static |
Definition at line 373 of file transform_constraints.cc.
References BLI_assert, CTX_OBJECT, CTX_POSE_BONE, transform_orientation_or_default(), and V3D_ORIENT_GIMBAL.
Referenced by applyObjectConstraintRot(), applyObjectConstraintSize(), applyObjectConstraintVec(), and drawObjectConstraint().
|
static |
Definition at line 363 of file transform_constraints.cc.
References O_DEFAULT, TransInfo::orient, TransInfo::orient_curr, TransInfo::type, and V3D_ORIENT_CUSTOM_MATRIX.
Referenced by setUserConstraint(), and transform_object_axismtx_get().
|
static |
Definition at line 288 of file transform_constraints.cc.
References closest_to_ray_v3(), CONSTRAIN_EPSILON, dot_v3v3(), fabsf, isect_plane_plane_v3(), plane_from_point_normal_v3(), TransSnap::snap_source, TransSnap::snap_target, TransSnap::snapNormal, sub_v3_v3(), and TransInfo::tsnap.
Definition at line 74 of file transform_constraints.cc.
References copy_v3_v3(), normalize_v3(), TransInfo::persp, RV3D_ORTHO, sub_v3_v3v3(), and TransInfo::viewinv.
Referenced by axisProjection(), constraints_rotation_impl(), isPlaneProjectionViewAligned(), and planeProjection().
Definition at line 151 of file transform_constraints.cc.
References diff(), dot_v3v3(), l, len_v3(), negate_v3(), normalize_v3_v3_length(), project_v3_v3v3(), SPACE_VIEW3D, TransInfo::spacetype, sub_v3_v3(), sub_v3_v3v3(), and TransInfo::viewinv.
Referenced by axisProjection().