Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/include/ED_transform_snap_object_context.h
| Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | bool ED_transform_snap_object_project_ray(SnapObjectContext *sctx, | ||||
| const View3D *v3d, | const View3D *v3d, | ||||
| const struct SnapObjectParams *params, | const struct SnapObjectParams *params, | ||||
| const float ray_origin[3], | const float ray_origin[3], | ||||
| const float ray_direction[3], | const float ray_direction[3], | ||||
| float *ray_depth, | float *ray_depth, | ||||
| float r_co[3], | float r_co[3], | ||||
| float r_no[3]); | float r_no[3]); | ||||
| /** | |||||
| * Fill in a list of all hits. | |||||
| * | |||||
| * \param ray_depth: Only depths in this range are considered, -1.0 for maximum. | |||||
| * \param sort: Optionally sort the hits by depth. | |||||
| * \param r_hit_list: List of #SnapObjectHitDepth (caller must free). | |||||
| */ | |||||
| bool ED_transform_snap_object_project_ray_all(SnapObjectContext *sctx, | bool ED_transform_snap_object_project_ray_all(SnapObjectContext *sctx, | ||||
| struct Depsgraph *depsgraph, | struct Depsgraph *depsgraph, | ||||
| const View3D *v3d, | const View3D *v3d, | ||||
| const struct SnapObjectParams *params, | const struct SnapObjectParams *params, | ||||
| const float ray_start[3], | const float ray_start[3], | ||||
| const float ray_normal[3], | const float ray_normal[3], | ||||
| float ray_depth, | float ray_depth, | ||||
| bool sort, | bool sort, | ||||
| Show All 9 Lines | short ED_transform_snap_object_project_view3d_ex(struct SnapObjectContext *sctx, | ||||
| const float prev_co[3], | const float prev_co[3], | ||||
| float *dist_px, | float *dist_px, | ||||
| float r_loc[3], | float r_loc[3], | ||||
| float r_no[3], | float r_no[3], | ||||
| int *r_index, | int *r_index, | ||||
| struct Object **r_ob, | struct Object **r_ob, | ||||
| float r_obmat[4][4], | float r_obmat[4][4], | ||||
| float r_face_nor[3]); | float r_face_nor[3]); | ||||
| /** | |||||
| * Convenience function for performing snapping. | |||||
| * | |||||
| * Given a 2D region value, snap to vert/edge/face. | |||||
| * | |||||
| * \param sctx: Snap context. | |||||
| * \param mval: Screenspace coordinate. | |||||
| * \param prev_co: Coordinate for perpendicular point calculation (optional). | |||||
| * \param dist_px: Maximum distance to snap (in pixels). | |||||
| * \param r_loc: hit location. | |||||
| * \param r_no: hit normal (optional). | |||||
| * \return Snap success. | |||||
| */ | |||||
| short ED_transform_snap_object_project_view3d(struct SnapObjectContext *sctx, | short ED_transform_snap_object_project_view3d(struct SnapObjectContext *sctx, | ||||
| struct Depsgraph *depsgraph, | struct Depsgraph *depsgraph, | ||||
| const ARegion *region, | const ARegion *region, | ||||
| const View3D *v3d, | const View3D *v3d, | ||||
| const unsigned short snap_to, | const unsigned short snap_to, | ||||
| const struct SnapObjectParams *params, | const struct SnapObjectParams *params, | ||||
| const float mval[2], | const float mval[2], | ||||
| const float prev_co[3], | const float prev_co[3], | ||||
| float *dist_px, | float *dist_px, | ||||
| /* return args */ | /* return args */ | ||||
| float r_loc[3], | float r_loc[3], | ||||
| float r_no[3]); | float r_no[3]); | ||||
| /** | |||||
| * see: #ED_transform_snap_object_project_ray_all | |||||
| */ | |||||
| bool ED_transform_snap_object_project_all_view3d_ex(SnapObjectContext *sctx, | bool ED_transform_snap_object_project_all_view3d_ex(SnapObjectContext *sctx, | ||||
| struct Depsgraph *depsgraph, | struct Depsgraph *depsgraph, | ||||
| const ARegion *region, | const ARegion *region, | ||||
| const View3D *v3d, | const View3D *v3d, | ||||
| const struct SnapObjectParams *params, | const struct SnapObjectParams *params, | ||||
| const float mval[2], | const float mval[2], | ||||
| float ray_depth, | float ray_depth, | ||||
| bool sort, | bool sort, | ||||
| ListBase *r_hit_list); | ListBase *r_hit_list); | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||