WIP fixes to ragdoll simple physics mode (see #895). When simple physics is enabled, only the collider of the character moves and all the limbs and joints are disabled. This caused "attempted to move pulljoint anchor extremely far" errors, because the game still attempted to move the limbs to the collider via pull joints. TODO: do more testing to make sure simple physics doesn't cause other physics errors, fix dragging in simple physics mode.
This commit is contained in:
@@ -176,9 +176,14 @@ namespace Barotrauma
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Vector2.DistanceSquared(pullJoint.WorldAnchorA, value) > 50.0f * 50.0f)
|
||||
{
|
||||
string errorMsg = "Attempted to move the anchor of a limb's pull joint extremely far from the limb (" + value + ")\n" + Environment.StackTrace;
|
||||
Vector2 diff = value - pullJoint.WorldAnchorA;
|
||||
string errorMsg = "Attempted to move the anchor of a limb's pull joint extremely far from the limb (diff: " + diff +
|
||||
", limb enabled: " + body.Enabled +
|
||||
", simple physics enabled: " + character.AnimController.SimplePhysicsEnabled + ")\n"
|
||||
+ Environment.StackTrace;
|
||||
DebugConsole.ThrowError(errorMsg);
|
||||
GameAnalyticsManager.AddErrorEventOnce("Limb.SetPullJointAnchor:ExcessiveValue", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user