18-08-2025, 08:41 AM
Quote:There's only one darboux vector per constraint (check API docs for ObiBendTwistConstraintsBatch), however your code assumes there's two for some reason (multiplying i by 2 when accessing batch.restDarbouxVectors). As a result you're skipping every other entry in the array, and end up reading data that's out of bounds - that's where the NaNs come from. Just remove the "*2" when accessing the restDarbouxVectors array.
Aww you are right, I copied the code without a second thought, it makes sense.
(15-08-2025, 12:34 PM)josemendez Wrote: Was finally able to reproduce by using the modified BurstBendTwistConstraintsBatch.cs file I shared in your other thread regarding pin constraints, I was using the version downloaded from the store. Make sure the disambiguation code (right before the plasticity code you tried commenting out) looks as in the original, retail version of the file:
Code:quaternion omega_plus;
omega_plus.value = omega.value + rest.value; //delta Omega with - omega_0
omega.value -= rest.value; //delta Omega with + omega_0
if (math.lengthsq(omega.value) > math.lengthsq(omega_plus.value))
omega = omega_plus;
Checking only the real part of the quaternion is not correct for bend/twist constraints.
Let me know how it goes,
You save the day again!
Yes, it seems to work again. Can you update that file in the other thread just in case, so nobody else get the same problem?