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/editors/space_view3d/view3d_project.c
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/editors/space_view3d/view3d_project.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_project.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index ba0626c58ea..c364148c9f1 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -348,7 +348,10 @@ static void view3d_win_to_ray_segment(const ARegion *ar, View3D *v3d, const floa
BLI_INLINE bool view3d_clip_segment(RegionView3D *rv3d, float ray_start[3], float ray_end[3])
{
- if ((rv3d->rflag & RV3D_CLIPPING) && !clip_segment_v3_plane_n(ray_start, ray_end, rv3d->clip, 6)) {
+ if ((rv3d->rflag & RV3D_CLIPPING) &&
+ (clip_segment_v3_plane_n(ray_start, ray_end, rv3d->clip, 6,
+ ray_start, ray_end) == false))
+ {
return false;
}
return true;