You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #74861 from rburing/restore_trimesh_ccd
Revert attempted fix of trimesh CCD
This commit is contained in:
@@ -237,17 +237,10 @@ bool GodotBodyPair3D::_test_ccd(real_t p_step, GodotBody3D *p_A, int p_shape_A,
|
|||||||
Vector3 hitpos = p_xform_B.xform(segment_hit_local);
|
Vector3 hitpos = p_xform_B.xform(segment_hit_local);
|
||||||
|
|
||||||
real_t newlen = hitpos.distance_to(supports_A[segment_support_idx]);
|
real_t newlen = hitpos.distance_to(supports_A[segment_support_idx]);
|
||||||
if (shape_B_ptr->is_concave()) {
|
// Adding 1% of body length to the distance between collision and support point
|
||||||
// Subtracting 5% of body length from the distance between collision and support point
|
// should cause body A's support point to arrive just within B's collider next frame.
|
||||||
// should cause body A's support point to arrive just before a face of B next frame.
|
newlen += (max - min) * 0.01;
|
||||||
newlen = MAX(newlen - (max - min) * 0.05, 0.0);
|
// FIXME: This doesn't always work well when colliding with a triangle face of a trimesh shape.
|
||||||
// NOTE: This may stop body A completely, without a proper collision response.
|
|
||||||
// We consider this preferable to tunneling.
|
|
||||||
} else {
|
|
||||||
// Adding 1% of body length to the distance between collision and support point
|
|
||||||
// should cause body A's support point to arrive just within B's collider next frame.
|
|
||||||
newlen += (max - min) * 0.01;
|
|
||||||
}
|
|
||||||
|
|
||||||
p_A->set_linear_velocity((mnormal * newlen) / p_step);
|
p_A->set_linear_velocity((mnormal * newlen) / p_step);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user