diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-20 09:00:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-20 09:03:10 +0300 |
commit | e25b1136944e19a233af10859481869e59c12886 (patch) | |
tree | 19d4c3e57ed99dede3d11f8462875f36bca8e65f /source/blender/blenlib | |
parent | bda0820d575061fca3514281f81f04870bbd495e (diff) |
Cleanup: naming convention
Follow isect_ray_tri_watertight_v3 naming.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_geom.h | 12 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 9 |
2 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 863bc766276..e3a8f975844 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -271,14 +271,18 @@ bool isect_point_tri_v3( /* axis-aligned bounding box */ bool isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]); -typedef struct { +struct IsectRayAABB_Precalc { float ray_origin[3]; float ray_inv_dir[3]; int sign[3]; -} IsectRayAABBData; +}; -void isect_ray_aabb_initialize(IsectRayAABBData *data, const float ray_origin[3], const float ray_direction[3]); -bool isect_ray_aabb(const IsectRayAABBData *data, const float bb_min[3], const float bb_max[3], float *tmin); +void isect_ray_aabb_v3_precalc( + struct IsectRayAABB_Precalc *data, + const float ray_origin[3], const float ray_direction[3]); +bool isect_ray_aabb_v3( + const struct IsectRayAABB_Precalc *data, + const float bb_min[3], const float bb_max[3], float *tmin); /* other */ bool isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius, diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 8859be62fea..4665e10d40d 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -2195,7 +2195,9 @@ bool isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float mi min2[0] < max1[0] && min2[1] < max1[1] && min2[2] < max1[2]); } -void isect_ray_aabb_initialize(IsectRayAABBData *data, const float ray_origin[3], const float ray_direction[3]) +void isect_ray_aabb_v3_precalc( + struct IsectRayAABB_Precalc *data, + const float ray_origin[3], const float ray_direction[3]) { copy_v3_v3(data->ray_origin, ray_origin); @@ -2209,8 +2211,9 @@ void isect_ray_aabb_initialize(IsectRayAABBData *data, const float ray_origin[3] } /* Adapted from http://www.gamedev.net/community/forums/topic.asp?topic_id=459973 */ -bool isect_ray_aabb(const IsectRayAABBData *data, const float bb_min[3], - const float bb_max[3], float *tmin_out) +bool isect_ray_aabb_v3( + const IsectRayAABB_Precalc *data, const float bb_min[3], + const float bb_max[3], float *tmin_out) { float bbox[2][3]; |