diff options
author | Marek Dvoroznak <dvoromar@gmail.com> | 2013-08-13 16:04:18 +0200 |
---|---|---|
committer | Mikael Magnusson <mikachu@src.gnome.org> | 2015-02-27 18:36:49 +0100 |
commit | e221911e1df54173198ebf0009d3a1e04ac7578d (patch) | |
tree | fd25d35ab9caec7894984a71c4a5eb46dd47e6f5 /libs | |
parent | 520af4d2dc6b1ec09e506837c4c9f41b2143e99e (diff) |
libs: npd: add alpha parameter to MLS weights
Diffstat (limited to 'libs')
-rw-r--r-- | libs/npd/npd_common.c | 3 | ||||
-rw-r--r-- | libs/npd/npd_common.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/libs/npd/npd_common.c b/libs/npd/npd_common.c index e9f856ed..d31bb6dd 100644 --- a/libs/npd/npd_common.c +++ b/libs/npd/npd_common.c @@ -34,6 +34,7 @@ npd_init_model (NPDModel *model) model->hidden_model = hidden_model; hidden_model->ASAP = FALSE; hidden_model->MLS_weights = FALSE; + hidden_model->MLS_weights_alpha = 1; hidden_model->num_of_bones = 0; hidden_model->num_of_overlapping_points = 0; @@ -400,7 +401,7 @@ npd_compute_MLS_weights (NPDModel *model) } if (npd_equal_floats (min, 0.0)) min = 0.0000001; - MLS_weight = 1 / min; + MLS_weight = 1 / pow (min, hm->MLS_weights_alpha); npd_set_overlapping_points_weight (op, MLS_weight); } } diff --git a/libs/npd/npd_common.h b/libs/npd/npd_common.h index 06f4bc8e..e99350a5 100644 --- a/libs/npd/npd_common.h +++ b/libs/npd/npd_common.h @@ -67,6 +67,7 @@ typedef struct * use npd_set_deformation_type function */ gboolean MLS_weights; /* don't change directly! * use npd_set_deformation_type function */ + gfloat MLS_weights_alpha; NPDBone *current_bones; /* array of current bones */ NPDBone *reference_bones; /* array of reference bones */ NPDOverlappingPoints *list_of_overlapping_points; /* array of overlapping points */ |