Blender Git Loki
Git Commits -> Revision 9f69efb
Revision 9f69efb by Germano Cavalcante (snap_system_clip_planes) February 24, 2017, 15:40 (GMT) |
Innitial commit: Snap system - Adds Clip Plan support and simulates occlusion The main alterations here were made in the transform_snap_object.c file. The main change add the "clip plans" of the `rv3d->clip` to bypass the snap to unseen elements. This solution continues to take advantage of the BVH. Since we can use clip planes, we can now simulate occlusion (ie ignore what is behind a face), first a raycast is made to get the normal and coordinates of the polygon of the hit. Then a plane is created just behind the polygon, thus ignoring everything that is behind it when a snap is made for vertex or edge. This is not the ideal occlusion solution, but it is already a good step to get the perfect occlusion test. In addition to this change other changes were made: Now snap_to is a flag that can indicate whether the snap is made for one, two or all elements at the same time (this will not change much for the user, the only operator using mixed snap is the ruler) ; if the object is in wireframe mode or Bounding Box, they are ignored in snap to face (good idea?); use the BVHTree of looptris to snap vertices and edges (saves memory); |
Commit Details:
Full Hash: 9f69efbd819fc9c914f66fae0368e30ea955182a
Parent Commit: 9062c08
Lines Changed: +1739, -994
9 Modified Paths:
/source/blender/blenkernel/BKE_bvhutils.h (+10, -2) (Diff)
/source/blender/blenkernel/intern/bvhutils.c (+91, -60) (Diff)
/source/blender/blenlib/BLI_kdopbvh.h (+4, -4) (Diff)
/source/blender/blenlib/BLI_math_geom.h (+1, -1) (Diff)
/source/blender/blenlib/intern/BLI_kdopbvh.c (+17, -12) (Diff)
/source/blender/blenlib/intern/math_geom.c (+6, -1) (Diff)
/source/blender/editors/include/ED_transform_snap_object_context.h (+0, -2) (Diff)
/source/blender/editors/transform/transform_snap_object.c (+1610, -911) (Diff)
/source/blender/makesrna/intern/rna_scene_api.c (+0, -1) (Diff)
/source/blender/blenkernel/intern/bvhutils.c (+91, -60) (Diff)
/source/blender/blenlib/BLI_kdopbvh.h (+4, -4) (Diff)
/source/blender/blenlib/BLI_math_geom.h (+1, -1) (Diff)
/source/blender/blenlib/intern/BLI_kdopbvh.c (+17, -12) (Diff)
/source/blender/blenlib/intern/math_geom.c (+6, -1) (Diff)
/source/blender/editors/include/ED_transform_snap_object_context.h (+0, -2) (Diff)
/source/blender/editors/transform/transform_snap_object.c (+1610, -911) (Diff)
/source/blender/makesrna/intern/rna_scene_api.c (+0, -1) (Diff)