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:
authorCampbell Barton <ideasman42@gmail.com>2016-01-23 05:44:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-01-23 05:48:31 +0300
commit90293a8da375b785fa58d3f56de1b286072107c1 (patch)
tree04d39cc37ce4881232370e4c83513a4949e61f90 /source/blender/blenlib/BLI_math_geom.h
parent456e7be9d2ed4f6534995ef6754376649a815ea4 (diff)
Math Lib: optimize segment-plane clipping
Calculate the clipped min/max factor along the segment, only applying to the coordinates at the end (will give better precision too). Also make split input/output args.
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r--source/blender/blenlib/BLI_math_geom.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index e3a8f975844..06412835936 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -288,8 +288,12 @@ bool isect_ray_aabb_v3(
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]);
-bool clip_segment_v3_plane(float p1[3], float p2[3], const float plane[4]);
-bool clip_segment_v3_plane_n(float p1[3], float p2[3], float plane_array[][4], const int plane_tot);
+bool clip_segment_v3_plane(
+ const float p1[3], const float p2[3], const float plane[4],
+ float r_p1[3], float r_p2[3]);
+bool clip_segment_v3_plane_n(
+ const float p1[3], const float p2[3], const float plane_array[][4], const int plane_tot,
+ float r_p1[3], float r_p2[3]);
void plot_line_v2v2i(const int p1[2], const int p2[2], bool (*callback)(int, int, void *), void *userData);
void fill_poly_v2i_n(