fix area center of gravity
This commit is contained in:
parent
15bee515e6
commit
e9f94ce8d2
2 changed files with 2 additions and 2 deletions
|
@ -358,7 +358,7 @@ void BodySW::_compute_area_gravity(const AreaSW *p_area) {
|
|||
|
||||
if (p_area->is_gravity_point()) {
|
||||
|
||||
gravity = (p_area->get_gravity_vector() - get_transform().get_origin()).normalized() * p_area->get_gravity();
|
||||
gravity = (p_area->get_transform().xform(p_area->get_gravity_vector()) - get_transform().get_origin()).normalized() * p_area->get_gravity();
|
||||
|
||||
} else {
|
||||
gravity = p_area->get_gravity_vector() * p_area->get_gravity();
|
||||
|
|
|
@ -379,7 +379,7 @@ void Body2DSW::_compute_area_gravity(const Area2DSW *p_area) {
|
|||
|
||||
if (p_area->is_gravity_point()) {
|
||||
|
||||
gravity = (p_area->get_transform().get_origin()+p_area->get_gravity_vector() - get_transform().get_origin()).normalized() * p_area->get_gravity();
|
||||
gravity = (p_area->get_transform().xform(p_area->get_gravity_vector()) - get_transform().get_origin()).normalized() * p_area->get_gravity();
|
||||
|
||||
} else {
|
||||
gravity = p_area->get_gravity_vector() * p_area->get_gravity();
|
||||
|
|
Loading…
Reference in a new issue