Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano <germano.costa@ig.com.br>2018-05-14 22:00:13 +0300
committerGermano <germano.costa@ig.com.br>2018-05-14 22:01:36 +0300
commit8cbf402eb61bde42c63963eb092bf6722516280b (patch)
tree680408e89e357be265f7e7f2f06bd288b28ef0a2 /source/blender/blenlib/BLI_math_geom.h
parent70a60061e59fde7bb0e9cf9585365238b8c1d58f (diff)
New function for BLI_kdopbvh: `BLI_bvhtree_find_nearest_projected`.
This patch does not make any difference for a user's POV. But it is a step for adding the occlusion test for snapping functions. This new function finds the node(aabb) whose projection is closest to a screen coordinate. Reviewers: campbellbarton Reviewed By: campbellbarton Tags: #bf_blender_2.8 Differential Revision: https://developer.blender.org/D3180
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r--source/blender/blenlib/BLI_math_geom.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index fa3392cd293..940e22b144a 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -121,11 +121,14 @@ float dist_squared_ray_to_seg_v3(
const float v0[3], const float v1[3],
float r_point[3], float *r_depth);
+void aabb_get_near_far_from_plane(
+ const float plane_no[3], const float bbmin[3], const float bbmax[3],
+ float bb_near[3], float bb_afar[3]);
+
struct DistRayAABB_Precalc {
float ray_origin[3];
float ray_direction[3];
float ray_inv_dir[3];
- bool sign[3];
};
void dist_squared_ray_to_aabb_v3_precalc(
struct DistRayAABB_Precalc *neasrest_precalc,
@@ -344,6 +347,14 @@ bool isect_ray_aabb_v3_simple(
float *tmin, float *tmax);
/* other */
+#define ISECT_AABB_PLANE_BEHIND_ANY 0
+#define ISECT_AABB_PLANE_CROSS_ANY 1
+#define ISECT_AABB_PLANE_IN_FRONT_ALL 2
+
+int isect_aabb_planes_v3(
+ const float (*planes)[4], const int totplane,
+ const float bbmin[3], const float bbmax[3]);
+
bool isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius,
const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3]);