World Bound #222
-
After object getting max value of position, thier has vector3(NaN, NaN, NaN) and get exception with message:
So, im trying to collecting object abroad bounds world width after each const float Bound = 10_000f;
...
bool greatOrEq(float val) => float.IsNaN(val) || !float.IsFinite(val) || val >= Bound;
bool lessOrEq(float val) => float.IsNaN(val) || !float.IsFinite(val) || val <= -Bound;
var body = _sim.Bodies.GetBodyReference(obj.Handler);
var (x, y, z) = body.Pose.Position;
if (greatOrEq(x) || greatOrEq(x) || greatOrEq(x))
DropObject(obj);
else if (lessOrEq(x) || lessOrEq(y) || lessOrEq(z))
DropObject(obj); And drop fn: private void DropObject(NetworkObject net)
{
_sim.Bodies.Remove(net.Handler);
...
} So, i get randomly behaviour
How to kill sinful objects? (yes, i may have an object with a furious acceleration, I would like to drop it) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Assuming it's arising from object state, given that you don't observe any obvious failures in the position, it's probably in the velocities somewhere. But there could be other problems afoot- for example, asynchronous writes to the simulation state while it's in the middle of a timestep will tend to make it explode in unpredictable ways (including this one). The fact that you're seeing segfaults somewhat increases the probability that there are Greater Problems floating around. I'd recommend grabbing the source and running in debug mode; there are a ton of asserts that will probably narrow down where the bad values come from. |
Beta Was this translation helpful? Give feedback.
Assuming it's arising from object state, given that you don't observe any obvious failures in the position, it's probably in the velocities somewhere. But there could be other problems afoot- for example, asynchronous writes to the simulation state while it's in the middle of a timestep will tend to make it explode in unpredictable ways (including this one). The fact that you're seeing segfaults somewhat increases the probability that there are Greater Problems floating around.
I'd recommend grabbing the source and running in debug mode; there are a ton of asserts that will probably narrow down where the bad values come from.