Fixed a typo
I was using the word "kept" (past tense) instead of "keep" (basic form). I hope my english teachter dont sees this commit xD
This commit is contained in:
@@ -112,7 +112,7 @@ typedef struct ShrinkwrapCalcData
|
||||
struct DerivedMesh *target; //mesh we are shrinking to
|
||||
SpaceTransform local2target; //transform to move bettwem local and target space
|
||||
|
||||
float keptDist; //Distance to kept from target (units are in local space)
|
||||
float keepDist; //Distance to kept from target (units are in local space)
|
||||
|
||||
} ShrinkwrapCalcData;
|
||||
|
||||
|
||||
@@ -7231,7 +7231,7 @@ static void shrinkwrapModifier_initData(ModifierData *md)
|
||||
ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
|
||||
smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE;
|
||||
smd->shrinkOpts = MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR;
|
||||
smd->keptDist = 0.0f;
|
||||
smd->keepDist = 0.0f;
|
||||
|
||||
smd->target = NULL;
|
||||
smd->auxTarget = NULL;
|
||||
@@ -7247,7 +7247,7 @@ static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target)
|
||||
|
||||
strcpy(tsmd->vgroup_name, smd->vgroup_name);
|
||||
|
||||
tsmd->keptDist = smd->keptDist;
|
||||
tsmd->keepDist = smd->keepDist;
|
||||
tsmd->shrinkType= smd->shrinkType;
|
||||
tsmd->shrinkOpts= smd->shrinkOpts;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
|
||||
//because space has been deformed
|
||||
space_transform_setup(&calc.local2target, ob, smd->target);
|
||||
|
||||
calc.keptDist = smd->keptDist; //TODO: smd->keptDist is in global units.. must change to local
|
||||
calc.keepDist = smd->keepDist; //TODO: smd->keepDist is in global units.. must change to local
|
||||
}
|
||||
|
||||
|
||||
@@ -256,9 +256,9 @@ void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
|
||||
//Found the nearest vertex
|
||||
if(nearest.index != -1)
|
||||
{
|
||||
//Adjusting the vertex weight, so that after interpolating it kepts a certain distance from the nearest position
|
||||
//Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position
|
||||
float dist = sasqrt(nearest.dist);
|
||||
if(dist > FLT_EPSILON) weight *= (dist - calc->keptDist)/dist;
|
||||
if(dist > FLT_EPSILON) weight *= (dist - calc->keepDist)/dist;
|
||||
|
||||
//Convert the coordinates back to mesh coordinates
|
||||
VECCOPY(tmp_co, nearest.co);
|
||||
@@ -388,7 +388,7 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
|
||||
|
||||
|
||||
//Build target tree
|
||||
BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keptDist, 4, 6));
|
||||
BENCH(bvhtree_from_mesh_faces(&treeData, calc->target, calc->keepDist, 4, 6));
|
||||
if(treeData.tree == NULL) return OUT_OF_MEMORY();
|
||||
|
||||
//Build auxiliar target
|
||||
@@ -521,17 +521,17 @@ void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
|
||||
//Found the nearest vertex
|
||||
if(nearest.index)
|
||||
{
|
||||
if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE)
|
||||
if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE)
|
||||
{
|
||||
//Make the vertex stay on the front side of the face
|
||||
VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keptDist);
|
||||
VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keepDist);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Adjusting the vertex weight, so that after interpolating it kepts a certain distance from the nearest position
|
||||
//Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position
|
||||
float dist = sasqrt( nearest.dist );
|
||||
if(dist > FLT_EPSILON)
|
||||
VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keptDist)/dist); //linear interpolation
|
||||
VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist); //linear interpolation
|
||||
else
|
||||
VECCOPY( tmp_co, nearest.co );
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ typedef struct ShrinkwrapModifierData {
|
||||
struct Object *target; /* shrink target */
|
||||
struct Object *auxTarget; /* additional shrink target */
|
||||
char vgroup_name[32]; /* optional vertexgroup name */
|
||||
float keptDist; /* distance offset from mesh/projection point */
|
||||
float keepDist; /* distance offset to keep from mesh/projection point */
|
||||
short shrinkType; /* shrink type projection */
|
||||
short shrinkOpts; /* shrink options */
|
||||
char projAxis; /* axis to project over */
|
||||
@@ -518,7 +518,7 @@ typedef struct ShrinkwrapModifierData {
|
||||
#define MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (1<<3) /* ignore vertex moves if a vertex ends projected on a front face of the target */
|
||||
#define MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (1<<4) /* ignore vertex moves if a vertex ends projected on a back face of the target */
|
||||
|
||||
#define MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE (1<<5) /* distance is measure to the front face of the target */
|
||||
#define MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE (1<<5) /* distance is measure to the front face of the target */
|
||||
|
||||
#define MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS (1<<0)
|
||||
#define MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS (1<<1)
|
||||
|
||||
@@ -2545,7 +2545,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
|
||||
but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0, 31, 0, 0, "Vertex Group name");
|
||||
uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
|
||||
|
||||
uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keptDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to kept from the target");
|
||||
uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:", lx,(cy-=19),buttonWidth,19, &smd->keepDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to keep from the target");
|
||||
|
||||
cy -= 3;
|
||||
uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position.");
|
||||
@@ -2570,7 +2570,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
|
||||
uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob2: ", lx, (cy-=19), buttonWidth,19, &smd->auxTarget, "Aditional mesh to project over");
|
||||
}
|
||||
else if (smd->shrinkType == MOD_SHRINKWRAP_NEAREST_SURFACE){
|
||||
uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEPT_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces");
|
||||
uiDefButBitS(block, TOG, MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE, B_MODIFIER_RECALC, "Above surface", lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Vertices are kept on the front side of faces");
|
||||
}
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
Reference in New Issue
Block a user