Use get_global_* functions instead of using transforms.
This commit is contained in:
parent
f32c042f3e
commit
c390f0515d
15 changed files with 40 additions and 40 deletions
|
|
@ -53,7 +53,7 @@ void NavigationObstacle2D::_notification(int p_what) {
|
|||
} break;
|
||||
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
|
||||
if (parent_node2d) {
|
||||
NavigationServer2D::get_singleton()->agent_set_position(agent, parent_node2d->get_global_transform().get_origin());
|
||||
NavigationServer2D::get_singleton()->agent_set_position(agent, parent_node2d->get_global_position());
|
||||
}
|
||||
} break;
|
||||
}
|
||||
|
|
@ -92,13 +92,13 @@ void NavigationObstacle2D::update_agent_shape() {
|
|||
// and add the enclosing shape radius
|
||||
r += cs->get_shape()->get_enclosing_radius();
|
||||
}
|
||||
Size2 s = cs->get_global_transform().get_scale();
|
||||
Size2 s = cs->get_global_scale();
|
||||
r *= MAX(s.x, s.y);
|
||||
// Takes the biggest radius
|
||||
radius = MAX(radius, r);
|
||||
}
|
||||
}
|
||||
Vector2 s = parent_node2d->get_global_transform().get_scale();
|
||||
Vector2 s = parent_node2d->get_global_scale();
|
||||
radius *= MAX(s.x, s.y);
|
||||
|
||||
if (radius == 0.0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue