diff options
author | Germano <germano.costa@ig.com.br> | 2018-05-12 02:20:51 +0300 |
---|---|---|
committer | Germano <germano.costa@ig.com.br> | 2018-05-12 02:20:51 +0300 |
commit | be8add5d505b14fcdc5d2caf6dc4bb345f057a7c (patch) | |
tree | f0af7aaefa8faa4dc8aecdce680c7efc03520bb3 /source/blender/blenlib/BLI_math_geom.h | |
parent | e4f75f97ba027f540eb91b3751021a9e2b8d3485 (diff) |
Refactor: Move functions to get the distance to a projected aabb to BLI_match and remove confusing parameters.
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_geom.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index ff80d15ea5d..d4112254fcf 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -140,6 +140,27 @@ float dist_squared_ray_to_aabb_v3_simple( const float bb_min[3], const float bb_max[3], float r_point[3], float *r_depth); +struct DistProjectedAABBPrecalc { + float ray_origin[3]; + float ray_direction[3]; + float ray_inv_dir[3]; + + float pmat[4][4]; + + float mval[2]; + bool sign[3]; +}; +void dist_squared_to_projected_aabb_precalc( + struct DistProjectedAABBPrecalc *neasrest_precalc, + const float projmat[4][4], const float winsize[2], const float mval[2]); +float dist_squared_to_projected_aabb( + struct DistProjectedAABBPrecalc *data, + const float bbmin[3], const float bbmax[3], + bool r_axis_closest[3]); +float dist_squared_to_projected_aabb_simple( + const float projmat[4][4], const float winsize[2], const float mval[2], + const float bbmin[3], const float bbmax[3]); + float closest_to_line_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2]); float closest_to_line_v3(float r_close[3], const float p[3], const float l1[3], const float l2[3]); void closest_to_line_segment_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2]); |