[Bf-blender-cvs] [84c11e8644e] master: Cleanup: Rearrange the order of isect_ray_ray_v3 parameters
mano-wii
noreply at git.blender.org
Tue Jul 23 13:11:59 CEST 2019
Commit: 84c11e8644e2f1e768ac9ba19098457728ff7c6c
Author: mano-wii
Date: Tue Jul 23 08:11:46 2019 -0300
Branches: master
https://developer.blender.org/rB84c11e8644e2f1e768ac9ba19098457728ff7c6c
Cleanup: Rearrange the order of isect_ray_ray_v3 parameters
And remove redundant add operation.
===================================================================
M source/blender/blenlib/intern/math_geom.c
M source/blender/editors/transform/transform_constraints.c
===================================================================
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 8b715ebf87b..dbb4e0d3859 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -2826,12 +2826,12 @@ bool isect_ray_ray_v3(const float ray_origin_a[3],
sub_v3_v3v3(c, n, t);
if (r_lambda_a != NULL) {
- cross_v3_v3v3(cray, c, ray_direction_a);
+ cross_v3_v3v3(cray, c, ray_direction_b);
*r_lambda_a = dot_v3v3(cray, n) / nlen;
}
if (r_lambda_b != NULL) {
- cross_v3_v3v3(cray, c, ray_direction_b);
+ cross_v3_v3v3(cray, c, ray_direction_a);
*r_lambda_b = dot_v3v3(cray, n) / nlen;
}
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index 208242d53b3..3a204d0d157 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -263,9 +263,8 @@ static void axisProjection(const TransInfo *t,
/* Use ray-ray intersection instead of line-line because this gave
* precision issues adding small values to large numbers. */
float mul;
- if (isect_ray_ray_v3(v, norm, t_con_center, axis, &mul, NULL)) {
- madd_v3_v3v3fl(out, t_con_center, axis, mul);
- sub_v3_v3(out, t_con_center);
+ if (isect_ray_ray_v3(t_con_center, axis, v, norm, &mul, NULL)) {
+ mul_v3_v3fl(out, axis, mul);
}
else {
/* In practice this should never fail. */
More information about the Bf-blender-cvs
mailing list