(Yesterday, 11:45 AM)josemendez Wrote: Plastic creep is the amount of deformation that is allowed to creep into the object's rest shape, once deformed past the plastic yield threshold. Setting it to zero disables plasticity, so no amount of deformation should be absorbed by the rest state of the rod.
Exactly, however I thought that maybe some precision error builds up or something, so I commented code in BendTwistBatch, to be precise those lines:
Code:
// plasticity
if (math.lengthsq(omega.value.xyz) > plasticity[i].x * plasticity[i].x)
{
rest.value += omega.value * plasticity[i].y * deltaTime;
restDarboux[i] = rest;
}
but it still breaks and problem persists.
(Yesterday, 11:45 AM)josemendez Wrote: They're accessed very differently. How are you looking at these values? Data lists in Obi usually are uninitialized, so unused areas of them may have any value.
I did something like this:
Code:
private void OnDrawGizmos()
{
ObiRod rod = GetComponent<ObiRod>();
if (rod == null || !rod.isLoaded)
{
return;
}
var solverConstraints = rod.solver.GetConstraintsByType(Oni.ConstraintType.BendTwist) as ObiConstraints<ObiBendTwistConstraintsBatch>;
if (solverConstraints != null)
{
for (int j = 0; j < solverConstraints.batchCount; ++j)
{
var batch = solverConstraints.GetBatch(j) as ObiBendTwistConstraintsBatch;
for (int i = 0; i < batch.activeConstraintCount; i++)
{
int indexA = batch.particleIndices[i * 2];
int indexB = batch.particleIndices[i * 2 + 1];
//Gizmos.DrawWireSphere(rod.solver.positions[indexA], 0.5f);
UnityEditor.Handles.Label(rod.solver.positions[indexA], batch.restDarbouxVectors[i * 2].ToString());
//Gizmos.color = Color.yellow;
//Gizmos.DrawRay(rod.solver.positions[indexA], (rod.solver.orientations[indexA] * batch.restDarbouxVectors[i * 2]) * Vector3.forward);
}
}
}
}
In my case currently there is mesh collider with distance field as tunnel (but the same happens for simple boxes) and yes, your video shows what should happen, but take into account that your rod is not bended from the start and this might affect results. I try to push into stright tunnel already bended rod and while inside of it it makes sense that it bends, but after pulling out it should go back to initial shape.
Here I have video of pushing the rod into hole made of boxes, I failed to push it inside, but notice the same thing happened and after leaving it, the rod tip is not perfectly roundly bended.
I attached constraint values of my rod and it looks like I can't attach video clips, so I fast uploaded it here (but will expire in 2 days):
https://streamable.com/cyt3k5