Blender  V2.93
Classes | Macros | Typedefs | Functions
BKE_shrinkwrap.h File Reference
#include "BKE_bvhutils.h"
#include "BLI_bitmap.h"

Go to the source code of this file.

Classes

struct  ShrinkwrapBoundaryVertData
 
struct  ShrinkwrapBoundaryData
 
struct  ShrinkwrapTreeData
 

Macros

#define NULL_ShrinkwrapCalcData
 
#define NULL_BVHTreeFromMesh
 
#define NULL_BVHTreeRayHit
 
#define NULL_BVHTreeNearest
 

Typedefs

typedef struct ShrinkwrapBoundaryVertData ShrinkwrapBoundaryVertData
 
typedef struct ShrinkwrapBoundaryData ShrinkwrapBoundaryData
 
typedef struct ShrinkwrapTreeData ShrinkwrapTreeData
 

Functions

void BKE_shrinkwrap_discard_boundary_data (struct Mesh *mesh)
 
void BKE_shrinkwrap_compute_boundary_data (struct Mesh *mesh)
 
bool BKE_shrinkwrap_needs_normals (int shrinkType, int shrinkMode)
 
bool BKE_shrinkwrap_init_tree (struct ShrinkwrapTreeData *data, Mesh *mesh, int shrinkType, int shrinkMode, bool force_normals)
 
void BKE_shrinkwrap_free_tree (struct ShrinkwrapTreeData *data)
 
void shrinkwrapModifier_deform (struct ShrinkwrapModifierData *smd, const struct ModifierEvalContext *ctx, struct Scene *scene, struct Object *ob, struct Mesh *mesh, struct MDeformVert *dvert, const int defgrp_index, float(*vertexCos)[3], int numVerts)
 
void BKE_shrinkwrap_mesh_nearest_surface_deform (struct bContext *C, struct Object *ob_source, struct Object *ob_target)
 
void BKE_shrinkwrap_remesh_target_project (struct Mesh *src_me, struct Mesh *target_me, struct Object *ob_target)
 
bool BKE_shrinkwrap_project_normal (char options, const float vert[3], const float dir[3], const float ray_radius, const struct SpaceTransform *transf, struct ShrinkwrapTreeData *tree, BVHTreeRayHit *hit)
 
void BKE_shrinkwrap_find_nearest_surface (struct ShrinkwrapTreeData *tree, struct BVHTreeNearest *nearest, float co[3], int type)
 
void BKE_shrinkwrap_compute_smooth_normal (const struct ShrinkwrapTreeData *tree, const struct SpaceTransform *transform, int looptri_idx, const float hit_co[3], const float hit_no[3], float r_no[3])
 
void BKE_shrinkwrap_snap_point_to_surface (const struct ShrinkwrapTreeData *tree, const struct SpaceTransform *transform, int mode, int hit_idx, const float hit_co[3], const float hit_no[3], float goal_dist, const float point_co[3], float r_point_co[3])
 

Macro Definition Documentation

◆ NULL_BVHTreeFromMesh

#define NULL_BVHTreeFromMesh
Value:
{ \
NULL, \
}

Definition at line 178 of file BKE_shrinkwrap.h.

◆ NULL_BVHTreeNearest

#define NULL_BVHTreeNearest
Value:
{ \
0, \
}

Definition at line 186 of file BKE_shrinkwrap.h.

◆ NULL_BVHTreeRayHit

#define NULL_BVHTreeRayHit
Value:
{ \
NULL, \
}

Definition at line 182 of file BKE_shrinkwrap.h.

◆ NULL_ShrinkwrapCalcData

#define NULL_ShrinkwrapCalcData
Value:
{ \
NULL, \
}

Definition at line 174 of file BKE_shrinkwrap.h.

Typedef Documentation

◆ ShrinkwrapBoundaryData

◆ ShrinkwrapBoundaryVertData

◆ ShrinkwrapTreeData

Function Documentation

◆ BKE_shrinkwrap_compute_boundary_data()

void BKE_shrinkwrap_compute_boundary_data ( struct Mesh mesh)

◆ BKE_shrinkwrap_compute_smooth_normal()

void BKE_shrinkwrap_compute_smooth_normal ( const struct ShrinkwrapTreeData tree,
const struct SpaceTransform transform,
int  looptri_idx,
const float  hit_co[3],
const float  hit_no[3],
float  r_no[3] 
)

Compute a smooth normal of the target (if applicable) at the hit location.

Parameters
treeinformation about the mesh
transformtransform from the hit coordinate space to the object space; may be null
r_nooutput in hit coordinate space; may be shared with inputs

Definition at line 1206 of file shrinkwrap.c.

References BLI_space_transform_apply(), BLI_space_transform_invert_normal(), copy_v3_v3(), interp_v3_v3v3v3(), interp_weights_tri_v3(), BVHTreeFromMesh::loop, BVHTreeFromMesh::looptri, ME_SMOOTH, normal_short_to_float_v3(), normalize_v3(), NULL, MLoopTri::poly, transform(), tree, MLoopTri::tri, MLoop::v, BVHTreeFromMesh::vert, verts, and w().

Referenced by BKE_shrinkwrap_snap_point_to_surface(), and shrinkwrap_get_tarmat().

◆ BKE_shrinkwrap_discard_boundary_data()

void BKE_shrinkwrap_discard_boundary_data ( struct Mesh mesh)

◆ BKE_shrinkwrap_find_nearest_surface()

void BKE_shrinkwrap_find_nearest_surface ( struct ShrinkwrapTreeData tree,
struct BVHTreeNearest nearest,
float  co[3],
int  type 
)

◆ BKE_shrinkwrap_free_tree()

void BKE_shrinkwrap_free_tree ( struct ShrinkwrapTreeData data)

◆ BKE_shrinkwrap_init_tree()

bool BKE_shrinkwrap_init_tree ( struct ShrinkwrapTreeData data,
Mesh mesh,
int  shrinkType,
int  shrinkMode,
bool  force_normals 
)

◆ BKE_shrinkwrap_mesh_nearest_surface_deform()

void BKE_shrinkwrap_mesh_nearest_surface_deform ( struct bContext C,
struct Object ob_source,
struct Object ob_target 
)

◆ BKE_shrinkwrap_needs_normals()

bool BKE_shrinkwrap_needs_normals ( int  shrinkType,
int  shrinkMode 
)

◆ BKE_shrinkwrap_project_normal()

bool BKE_shrinkwrap_project_normal ( char  options,
const float  vert[3],
const float  dir[3],
const float  ray_radius,
const struct SpaceTransform transf,
struct ShrinkwrapTreeData tree,
BVHTreeRayHit hit 
)

Referenced by shrinkwrap_get_tarmat().

◆ BKE_shrinkwrap_remesh_target_project()

void BKE_shrinkwrap_remesh_target_project ( struct Mesh src_me,
struct Mesh target_me,
struct Object ob_target 
)

◆ BKE_shrinkwrap_snap_point_to_surface()

void BKE_shrinkwrap_snap_point_to_surface ( const struct ShrinkwrapTreeData tree,
const struct SpaceTransform transform,
int  mode,
int  hit_idx,
const float  hit_co[3],
const float  hit_no[3],
float  goal_dist,
const float  point_co[3],
float  r_point_co[3] 
)

Apply the shrink to surface modes to the given original coordinates and nearest point.

Parameters
treemesh data for smooth normals
transformtransform from the hit coordinate space to the object space; may be null
r_point_comay be the same memory location as point_co, hit_co, or hit_no.

Definition at line 1328 of file shrinkwrap.c.

References BKE_shrinkwrap_compute_smooth_normal(), copy_v3_v3(), madd_v3_v3v3fl(), MOD_SHRINKWRAP_ABOVE_SURFACE, MOD_SHRINKWRAP_INSIDE, MOD_SHRINKWRAP_ON_SURFACE, MOD_SHRINKWRAP_OUTSIDE, MOD_SHRINKWRAP_OUTSIDE_SURFACE, shrinkwrap_snap_with_side(), transform(), and tree.

Referenced by shrinkwrap_calc_nearest_surface_point_cb_ex(), shrinkwrap_calc_normal_projection_cb_ex(), and shrinkwrap_get_tarmat().

◆ shrinkwrapModifier_deform()

void shrinkwrapModifier_deform ( struct ShrinkwrapModifierData smd,
const struct ModifierEvalContext ctx,
struct Scene scene,
struct Object ob,
struct Mesh mesh,
struct MDeformVert dvert,
const int  defgrp_index,
float(*)  vertexCos[3],
int  numVerts 
)

Referenced by deformVerts(), and deformVertsEM().