forked from bartvdbraak/blender
Fix for [#26665] Force field absorption does not work
* Old bug fix led to all kinds of wrong behavior with "plane" shaped effectors, now things are working properly again.
This commit is contained in:
parent
e4ef822ecd
commit
74e044065b
@ -687,13 +687,16 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
|
|||||||
/* use z-axis as normal*/
|
/* use z-axis as normal*/
|
||||||
normalize_v3_v3(efd->nor, ob->obmat[2]);
|
normalize_v3_v3(efd->nor, ob->obmat[2]);
|
||||||
|
|
||||||
/* for vortex the shape chooses between old / new force */
|
|
||||||
if(eff->pd && eff->pd->shape == PFIELD_SHAPE_PLANE) {
|
if(eff->pd && eff->pd->shape == PFIELD_SHAPE_PLANE) {
|
||||||
/* efd->loc is closes point on effector xy-plane */
|
|
||||||
float temp[3], translate[3];
|
float temp[3], translate[3];
|
||||||
sub_v3_v3v3(temp, point->loc, ob->obmat[3]);
|
sub_v3_v3v3(temp, point->loc, ob->obmat[3]);
|
||||||
project_v3_v3v3(translate, temp, efd->nor);
|
project_v3_v3v3(translate, temp, efd->nor);
|
||||||
|
|
||||||
|
/* for vortex the shape chooses between old / new force */
|
||||||
|
if(eff->pd->forcefield == PFIELD_VORTEX)
|
||||||
add_v3_v3v3(efd->loc, ob->obmat[3], translate);
|
add_v3_v3v3(efd->loc, ob->obmat[3], translate);
|
||||||
|
else /* normally efd->loc is closest point on effector xy-plane */
|
||||||
|
sub_v3_v3v3(efd->loc, point->loc, translate);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VECCOPY(efd->loc, ob->obmat[3]);
|
VECCOPY(efd->loc, ob->obmat[3]);
|
||||||
|
Loading…
Reference in New Issue
Block a user