86#define CONSTRAIN_EPSILON 0.0001f
90 const float *constraint_vector[2];
92 for (
int i = 0; i < 3; i++) {
94 constraint_vector[n++] = t->
spacemtx[i];
102 cross_v3_v3v3(r_plane_no, constraint_vector[0], constraint_vector[1]);
131 else if (dims == 1) {
155 const float min_dist = 1.0f;
183 float vec[3], factor,
angle;
184 float t_con_center[3];
196 if (angle >
float(
M_PI_2)) {
220 float norm[3], norm_center[3];
234 if (1.0f -
fabsf(factor) < 0.0002f) {
256 if (!isfinite(out[0])) {
259 if (!isfinite(out[1])) {
262 if (!isfinite(out[2])) {
273 const float plane_no[3],
289 const float plane[4],
292 float face_plane[4], isect_orig[3], isect_dir[3];
339 const float eps = 0.001f;
340 float view_to_plane[3];
343 float factor =
dot_v3v3(plane_no, view_to_plane);
348 const float plane_no[3],
353 float pos[3], view_vec[3], factor;
380 return td->ext->axismtx_gimbal;
388 bool is_snap_to_point =
false, is_snap_to_edge =
false, is_snap_to_face =
false;
394 is_snap_to_point = !is_snap_to_edge && !is_snap_to_face;
401 if (is_snap_to_point) {
411 if (is_snap_to_edge) {
414 else if (is_snap_to_face) {
424 else if (dims == 1) {
438 if (is_snap_to_edge) {
441 else if (is_snap_to_face) {
566 const float axismtx[3][3],
591 float view_vector[3];
593 if (
dot_v3v3(r_axis, view_vector) > 0.0f) {
594 *r_angle = -(*r_angle);
643 float tmp_axismtx[3][3];
644 const float(*axismtx)[3];
655 axismtx = tmp_axismtx;
720 switch (orientation) {
751 TransInfo *t,
const float center[3],
const float dir[3],
char axis,
short options)
757 float v1[3],
v2[3], v3[3];
841 if (depth_test_enabled) {
850 float viewport_size[4];
852 immUniform2f(
"viewport_size", viewport_size[2], viewport_size[3]);
866 if (depth_test_enabled) {
887 float tmat[4][4], imat[4][4];
895 if (rv3d !=
nullptr) {
914 if (depth_test_enabled) {
938 if (depth_test_enabled) {
964 const float y1 = v2d->
cur.
ymin;
966 const float y2 = v2d->
cur.
ymax;
989 float tmp_axismtx[3][3];
993 for (
int i = 0; i < tc->data_len; i++, td++) {
995 const float(*axismtx)[3];
1025 axismtx = tmp_axismtx;
1113 if (
abs(dvec.x) <
abs(dvec.y)) {
1129 float mvec[3], proj[3];
1147 for (i = 0; i < 3; i++) {
1148 float axis[3], axis_2d[2];
1216 if (mode_prev != t->
con.
mode) {
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
void plane_from_point_normal_v3(float r_plane[4], const float plane_co[3], const float plane_no[3])
bool isect_ray_ray_v3(const float ray_origin_a[3], const float ray_direction_a[3], const float ray_origin_b[3], const float ray_direction_b[3], float *r_lambda_a, float *r_lambda_b)
float closest_to_ray_v3(float r_close[3], const float p[3], const float ray_orig[3], const float ray_dir[3])
bool isect_plane_plane_v3(const float plane_a[4], const float plane_b[4], float r_isect_co[3], float r_isect_no[3]) ATTR_WARN_UNUSED_RESULT
bool isect_ray_plane_v3_factor(const float ray_origin[3], const float ray_direction[3], const float plane_co[3], const float plane_no[3], float *r_lambda)
void mul_m3_v3(const float M[3][3], float r[3])
void unit_m3(float m[3][3])
bool invert_m3_m3(float inverse[3][3], const float mat[3][3])
void unit_m4(float m[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
float angle_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float normalize_v3_v3_length(float r[3], const float a[3], float unit_length)
MINLINE void negate_v3(float r[3])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float mul_project_m4_v3_zfac(const float mat[4][4], const float co[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float normalize_v3(float n[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define UNUSED_FUNCTION(x)
Object is a sort of wrapper for general info.
@ V3D_ORIENT_CUSTOM_MATRIX
void GPU_matrix_scale_2f(float x, float y)
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
eGPUDepthTest GPU_depth_test_get()
void GPU_depth_test(eGPUDepthTest test)
void GPU_viewport_size_get_f(float coords[4])
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
void UI_make_axis_color(const unsigned char col[3], char axis, unsigned char r_col[3])
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
static void mul(btAlignedObjectArray< T > &items, const Q &value)
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
CCL_NAMESPACE_BEGIN struct Options options
draw_view in_light_buf[] float
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt)
void(* applySize)(const TransInfo *t, const TransDataContainer *tc, const TransData *td, float r_smat[3][3])
void(* applyRot)(const TransInfo *t, const TransDataContainer *tc, const TransData *td, float r_axis[3], float *r_angle)
void(* applyVec)(const TransInfo *t, const TransDataContainer *tc, const TransData *td, const float in[3], float r_out[3])
void(* drawExtra)(TransInfo *t)
struct TransInfo::@565 orient[3]
ccl_device_inline int abs(int x)