|
Blender V4.3
|
#include "BLI_math_matrix.hh"#include "BLI_math_vector.h"#include "BKE_bvhutils.hh"#include "BKE_mesh.hh"#include "ED_transform_snap_object_context.hh"#include "ED_view3d.hh"#include "transform_snap_object.hh"Go to the source code of this file.
Classes | |
| class | SnapData_Mesh |
Functions | |
| eSnapMode | snap_object_mesh (SnapObjectContext *sctx, const Object *ob_eval, const ID *id, const float4x4 &obmat, eSnapMode snap_to_flag, bool skip_hidden, bool is_editmesh) |
Snap Object Data | |
| static void | snap_object_data_mesh_get (const Mesh *mesh_eval, bool skip_hidden, BVHTreeFromMesh *r_treedata) |
Ray Cast Functions | |
| static void | mesh_corner_tris_raycast_backface_culling_cb (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) |
| static bool | raycastMesh (SnapObjectContext *sctx, const Object *ob_eval, const Mesh *mesh_eval, const float4x4 &obmat, const uint ob_index, bool use_hide) |
Surface Snap Functions | |
| static bool | nearest_world_mesh (SnapObjectContext *sctx, const Object *ob_eval, const Mesh *mesh_eval, const float4x4 &obmat, bool use_hide) |
Subclass for Snapping to Edges or Points of a Mesh | |
| static void | cb_snap_edge_verts (void *userdata, int index, const DistProjectedAABBPrecalc *precalc, const float(*clip_plane)[4], const int clip_plane_len, BVHTreeNearest *nearest) |
| static void | cb_snap_tri_verts (void *userdata, int index, const DistProjectedAABBPrecalc *precalc, const float(*clip_plane)[4], const int clip_plane_len, BVHTreeNearest *nearest) |
| static void | cb_snap_tri_edges (void *userdata, int index, const DistProjectedAABBPrecalc *precalc, const float(*clip_plane)[4], const int clip_plane_len, BVHTreeNearest *nearest) |
Internal Object Snapping API | |
| eSnapMode | snap_polygon_mesh (SnapObjectContext *sctx, const Object *ob_eval, const ID *id, const float4x4 &obmat, eSnapMode snap_to_flag, int face_index) |
| eSnapMode | snap_edge_points_mesh (SnapObjectContext *sctx, const Object *ob_eval, const ID *id, const float4x4 &obmat, float dist_px_sq_orig, int edge_index) |
| static eSnapMode | mesh_snap_mode_supported (const Mesh *mesh, bool skip_hidden) |
| static eSnapMode | snapMesh (SnapObjectContext *sctx, const Object *ob_eval, const Mesh *mesh_eval, const float4x4 &obmat, bool skip_hidden, bool is_editmesh, eSnapMode snap_to) |
|
static |
Definition at line 260 of file transform_snap_object_mesh.cc.
References cb_snap_vert(), and SnapData_Mesh::get_edge_verts_index().
Referenced by snapMesh().
|
static |
Definition at line 315 of file transform_snap_object_mesh.cc.
References cb_snap_edge(), SnapData_Mesh::corner_verts, ELEM, DistProjectedAABBPrecalc::ray_direction, and raycast_tri_backface_culling_test().
Referenced by snapMesh().
|
static |
Definition at line 280 of file transform_snap_object_mesh.cc.
References cb_snap_vert(), SnapData_Mesh::corner_verts, DistProjectedAABBPrecalc::ray_direction, and raycast_tri_backface_culling_test().
Referenced by snapMesh().
|
static |
Definition at line 54 of file transform_snap_object_mesh.cc.
References bvhtree_ray_tri_intersection(), madd_v3_v3v3fl(), normalize_v3_v3(), raycast_tri_backface_culling_test(), and UNPACK3.
Referenced by raycastMesh().
Definition at line 433 of file transform_snap_object_mesh.cc.
References SCE_SNAP_INDIVIDUAL_NEAREST, SCE_SNAP_TO_FACE, SCE_SNAP_TO_NONE, SCE_SNAP_TO_POINT, and SNAP_TO_EDGE_ELEMENTS.
Referenced by snapMesh().
|
static |
Definition at line 193 of file transform_snap_object_mesh.cc.
References SnapObjectContext::dist_nearest_sq, BVHTreeNearest::dist_sq, Mesh::id, BVHTreeFromMesh::nearest_callback, nearest_world_tree(), SnapData::register_result(), SnapObjectContext::ret, snap_object_data_mesh_get(), and BVHTreeFromMesh::tree.
Referenced by snap_object_mesh().
|
static |
Definition at line 80 of file transform_snap_object_mesh.cc.
References BLI_assert, BLI_bvhtree_ray_cast(), BLI_bvhtree_ray_cast_all(), BVH_RAYCAST_DIST_MAX, RayCastAll_Data::bvhdata, data, Object::dtx, Mesh::faces_num, SnapObjectContext::hit_list, Mesh::id, BVHTreeRayHit::index, blender::math::invert(), isect_ray_aabb_v3_simple(), ListBase::last, madd_v3_v3fl(), mesh_corner_tris_raycast_backface_culling_cb(), blender::math::normalize_and_get_length(), OB_DRAW_IN_FRONT, SnapObjectParams::occlusion_test, SnapObjectContext::params, SnapObjectContext::ray_depth_max, SnapObjectContext::ray_depth_max_in_front, SnapObjectContext::ray_dir, SnapObjectContext::ray_start, raycast_all_cb(), BVHTreeFromMesh::raycast_callback, SnapData::register_result_raycast(), SnapObjectContext::ret, SnapObjectContext::runtime, snap_object_data_mesh_get(), SNAP_OCCLUSION_AS_SEEM, blender::math::transform_direction(), blender::math::transform_point(), BVHTreeFromMesh::tree, and SnapObjectParams::use_backface_culling.
Referenced by snap_object_mesh().
| eSnapMode snap_edge_points_mesh | ( | SnapObjectContext * | sctx, |
| const Object * | ob_eval, | ||
| const ID * | id, | ||
| const float4x4 & | obmat, | ||
| float | dist_px_sq_orig, | ||
| int | edge_index ) |
Definition at line 418 of file transform_snap_object_mesh.cc.
References BVHTreeNearest::index, SnapData::nearest_point, SnapData::register_result(), and SnapData::snap_edge_points_impl().
Referenced by snap_edge_points().
|
static |
Definition at line 32 of file transform_snap_object_mesh.cc.
References BKE_bvhtree_from_mesh_get(), BVHTREE_FROM_CORNER_TRIS, and BVHTREE_FROM_CORNER_TRIS_NO_HIDDEN.
Referenced by nearest_world_mesh(), raycastMesh(), and snapMesh().
| eSnapMode snap_object_mesh | ( | SnapObjectContext * | sctx, |
| const Object * | ob_eval, | ||
| const ID * | id, | ||
| const float4x4 & | obmat, | ||
| eSnapMode | snap_to_flag, | ||
| bool | skip_hidden, | ||
| bool | is_editmesh ) |
Definition at line 606 of file transform_snap_object_mesh.cc.
References nearest_world_mesh(), SnapObjectContext::object_index, raycastMesh(), SnapObjectContext::runtime, SCE_SNAP_INDIVIDUAL_NEAREST, SCE_SNAP_TO_FACE, SCE_SNAP_TO_NONE, SCE_SNAP_TO_POINT, SNAP_TO_EDGE_ELEMENTS, and snapMesh().
Referenced by nearest_world_object_fn(), raycast_obj_fn(), snap_obj_fn(), and snap_object_editmesh().
| eSnapMode snap_polygon_mesh | ( | SnapObjectContext * | sctx, |
| const Object * | ob_eval, | ||
| const ID * | id, | ||
| const float4x4 & | obmat, | ||
| eSnapMode | snap_to_flag, | ||
| int | face_index ) |
Definition at line 358 of file transform_snap_object_mesh.cc.
References BLI_assert, cb_snap_edge(), cb_snap_vert(), SnapData::clip_planes, SnapData::clip_planes_enable(), SnapData_Mesh::corner_edges, SnapData_Mesh::corner_verts, SnapObjectContext::dist_px_sq, SnapData_Mesh::edges, BVHTreeNearest::index, SnapData::nearest_point, SnapData::nearest_precalc, SnapData::register_result(), SnapObjectContext::ret, SCE_SNAP_TO_EDGE, SCE_SNAP_TO_EDGE_ENDPOINT, SCE_SNAP_TO_EDGE_MIDPOINT, SCE_SNAP_TO_EDGE_PERPENDICULAR, and SCE_SNAP_TO_NONE.
Referenced by snap_polygon().
|
static |
Definition at line 450 of file transform_snap_object_mesh.cc.
References BKE_bvhtree_from_mesh_get(), BLI_assert, BLI_bvhtree_find_nearest_projected(), BVHTREE_FROM_LOOSEEDGES, BVHTREE_FROM_LOOSEEDGES_NO_HIDDEN, BVHTREE_FROM_LOOSEVERTS, BVHTREE_FROM_LOOSEVERTS_NO_HIDDEN, BVHTreeFromMesh::cached, cb_snap_edge(), cb_snap_edge_verts(), cb_snap_tri_edges(), cb_snap_tri_verts(), cb_snap_vert(), SnapData::clip_planes, SnapData::clip_planes_enable(), SnapObjectContext::dist_px_sq, Mesh::id, BVHTreeNearest::index, mesh_snap_mode_supported(), SnapObjectContext::mval, SnapData::nearest_point, SnapData::pmat_local, blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), SnapData::register_result(), SnapObjectContext::ret, SnapObjectContext::runtime, SCE_SNAP_TO_EDGE, SCE_SNAP_TO_EDGE_ENDPOINT, SCE_SNAP_TO_FACE, SCE_SNAP_TO_NONE, SCE_SNAP_TO_POINT, SnapData::snap_boundbox(), snap_object_data_mesh_get(), SNAP_TO_EDGE_ELEMENTS, BVHTreeFromMesh::tree, SnapData::use_backface_culling, SnapObjectContext::v3d, SnapObjectContext::win_size, and XRAY_FLAG_ENABLED.
Referenced by snap_object_mesh().