mirror of
https://github.com/godotengine/godot.git
synced 2025-01-26 20:42:55 -05:00
Add slope min stop velocity on 3D physics body, closes #10981
This commit is contained in:
parent
50a9bd4e23
commit
0416ca2fd2
1 changed files with 6 additions and 3 deletions
|
@ -988,12 +988,15 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve
|
|||
on_floor = true;
|
||||
floor_velocity = collision.collider_vel;
|
||||
|
||||
/*if (collision.travel.length() < 0.01 && ABS((lv.x - floor_velocity.x)) < p_slope_stop_min_velocity) {
|
||||
Vector3 rel_v = lv - floor_velocity;
|
||||
Vector3 hv = rel_v - p_floor_direction * p_floor_direction.dot(rel_v);
|
||||
|
||||
if (collision.travel.length() < 0.05 && hv.length() < p_slope_stop_min_velocity) {
|
||||
Transform gt = get_global_transform();
|
||||
gt.elements[2] -= collision.travel;
|
||||
gt.origin -= collision.travel;
|
||||
set_global_transform(gt);
|
||||
return Vector3();
|
||||
}*/
|
||||
}
|
||||
} else if (collision.normal.dot(-p_floor_direction) >= Math::cos(p_floor_max_angle)) { //ceiling
|
||||
on_ceiling = true;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue