diff options
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_transform.h | 29 | ||||
-rw-r--r-- | source/blender/editors/include/ED_transform_snap_object_context.h | 35 |
2 files changed, 44 insertions, 20 deletions
diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index c881e849cf5..933f480a554 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -158,19 +158,6 @@ void BIF_draw_manipulator(const struct bContext *C); /* Snapping */ - -typedef struct DepthPeel { - struct DepthPeel *next, *prev; - - float depth; - float p[3]; - float no[3]; - struct Object *ob; - int flag; -} DepthPeel; - -struct ListBase; - typedef enum SnapSelect { SNAP_ALL = 0, SNAP_NOT_SELECTED = 1, @@ -179,14 +166,18 @@ typedef enum SnapSelect { #define SNAP_MIN_DISTANCE 30 -bool peelObjectsTransForm( - struct TransInfo *t, const float mval[2], SnapSelect snap_select, +bool peelObjectsTransform( + struct TransInfo *t, const float mval[2], + SnapSelect snap_select, bool use_peel_object, /* return args */ - struct ListBase *r_depth_peels); -bool peelObjectsContext( - struct bContext *C, const float mval[2], SnapSelect snap_select, + float r_loc[3], float r_no[3], float *r_thickness); +bool peelObjectsSnapContext( + struct SnapObjectContext *sctx, + const float mval[2], + SnapSelect snap_select, bool use_peel_object, /* return args */ - struct ListBase *r_depth_peels); + float r_loc[3], float r_no[3], float *r_thickness); + bool snapObjectsTransform( struct TransInfo *t, const float mval[2], SnapSelect snap_select, float *dist_px, diff --git a/source/blender/editors/include/ED_transform_snap_object_context.h b/source/blender/editors/include/ED_transform_snap_object_context.h index e591a91a90f..900b7593f2e 100644 --- a/source/blender/editors/include/ED_transform_snap_object_context.h +++ b/source/blender/editors/include/ED_transform_snap_object_context.h @@ -29,6 +29,7 @@ struct BMVert; struct BMEdge; struct BMFace; +struct ListBase; struct Scene; struct Main; struct Object; @@ -38,6 +39,24 @@ struct View3D; /* transform_snap_object.c */ /* ED_transform_snap_object_*** API */ + +/** used for storing multiple hits */ +struct SnapObjectHitDepth { + struct SnapObjectHitDepth *next, *prev; + + float depth; + float co[3]; + float no[3]; + int index; + + struct Object *ob; + float obmat[4][4]; + + /* needed to tell which ray-cast this was part of, + * the same object may be part of many ray-casts when dupli's are used. */ + unsigned int ob_uuid; +}; + struct SnapObjectParams { int snap_select; /* SnapSelect */ union { @@ -81,9 +100,16 @@ bool ED_transform_snap_object_project_ray_ex( struct Object **r_ob, float r_obmat[4][4]); bool ED_transform_snap_object_project_ray( SnapObjectContext *sctx, - const float ray_origin[3], const float ray_direction[3], float *ray_dist, + const float ray_origin[3], const float ray_direction[3], float *ray_depth, float r_co[3], float r_no[3]); +bool ED_transform_snap_object_project_ray_all( + SnapObjectContext *sctx, + const struct SnapObjectParams *params, + const float ray_start[3], const float ray_normal[3], + float ray_depth, bool sort, + struct ListBase *r_hit_list); + bool ED_transform_snap_object_project_view3d_ex( struct SnapObjectContext *sctx, const struct SnapObjectParams *params, @@ -104,4 +130,11 @@ bool ED_transform_snap_object_project_view3d_mixed( bool use_depth, float r_co[3], float r_no[3]); +bool ED_transform_snap_object_project_all_view3d_ex( + SnapObjectContext *sctx, + const struct SnapObjectParams *params, + const float mval[2], + float ray_depth, bool sort, + ListBase *r_hit_list); + #endif /* __ED_TRANSFORM_SNAP_OBJECT_CONTEXT_H__ */ |