1
This commit is contained in:
parent
1f6258cbf2
commit
8c45440808
@ -573,7 +573,13 @@ void Human::_UpdateMove(int speed)
|
||||
float move_dist = dist_vec.Norm() - node_dist;
|
||||
|
||||
pre_node_pos = node->pos;
|
||||
node->pos = new_pos;
|
||||
if (std::abs(move_dist) > 0.00001f) {
|
||||
a8::Vec2 dist_dir= dist_vec;
|
||||
dist_dir.Normalize();
|
||||
node->pos = new_pos + dist_dir * (move_dist / dist_vec.Norm());
|
||||
} else {
|
||||
node->pos = new_pos;
|
||||
}
|
||||
|
||||
pre_node = node;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user