Fix errors from early stops at penetration when casting

This commit is contained in:
Jan Nils Ferner
2023-01-27 23:35:26 +01:00
parent f0563521a3
commit 5bf57c6c50

View File

@@ -229,7 +229,7 @@ impl KinematicCharacterController {
&translation_dir, &translation_dir,
character_shape, character_shape,
translation_dist + offset, translation_dist + offset,
true, false,
filter, filter,
) { ) {
// We hit something, compute the allowed self. // We hit something, compute the allowed self.
@@ -338,7 +338,7 @@ impl KinematicCharacterController {
&-self.up, &-self.up,
character_shape, character_shape,
snap_distance + offset, snap_distance + offset,
true, false,
filter, filter,
) { ) {
// Apply the snap. // Apply the snap.
@@ -356,7 +356,7 @@ impl KinematicCharacterController {
} }
fn predict_ground(&self, up_extends: Real) -> Real { fn predict_ground(&self, up_extends: Real) -> Real {
self.offset.eval(up_extends) * 1.4 self.offset.eval(up_extends) * 1.1
} }
fn detect_grounded_status_and_apply_friction( fn detect_grounded_status_and_apply_friction(
@@ -566,7 +566,7 @@ impl KinematicCharacterController {
&self.up, &self.up,
character_shape, character_shape,
max_height, max_height,
true, false,
filter, filter,
) )
.is_some() .is_some()
@@ -583,7 +583,7 @@ impl KinematicCharacterController {
&horizontal_dir, &horizontal_dir,
character_shape, character_shape,
min_width, min_width,
true, false,
filter, filter,
) )
.is_some() .is_some()
@@ -602,7 +602,7 @@ impl KinematicCharacterController {
&-self.up, &-self.up,
character_shape, character_shape,
max_height, max_height,
true, false,
filter, filter,
) { ) {
let [_vertical_slope_translation, horizontal_slope_translation] = let [_vertical_slope_translation, horizontal_slope_translation] =
@@ -629,7 +629,7 @@ impl KinematicCharacterController {
&-self.up, &-self.up,
character_shape, character_shape,
max_height, max_height,
true, false,
filter, filter,
) )
.map(|hit| hit.1.toi) .map(|hit| hit.1.toi)