05-05-2021, 12:53 AM
(This post was last modified: 05-05-2021, 06:24 AM by Hakazaba.
Edit Reason: More important question
)
Ok i have this script in update, and i'm not seeing it have any effect on the physics. What am i doing wrong?
var Bendtwist = rope.solverBatchOffsets[(int)Oni.ConstraintType.BendTwist];
var solverConstraints = solver.GetConstraintsByType(Oni.ConstraintType.BendTwist)
as ObiConstraints<ObiBendTwistConstraintsBatch>;
int b = 0;
int b2 = 0;
bool batch = true;
Quaternion prior = followChain[0].rotation;
for (int i = 0; i<chain.Length;i++)
{
Quaternion next = prior;
prior = followChain[i].rotation;
if (batch){
solverConstraints.batches[0].restDarbouxVectors[Bendtwist[0]+b] = ObiUtils.RestDarboux(next,prior);
batch = false;
b++;
}
else {
solverConstraints.batches[1].restDarbouxVectors[Bendtwist[1]+b2] = ObiUtils.RestDarboux(next,prior);
batch = true;
b2++;
}
}
var Bendtwist = rope.solverBatchOffsets[(int)Oni.ConstraintType.BendTwist];
var solverConstraints = solver.GetConstraintsByType(Oni.ConstraintType.BendTwist)
as ObiConstraints<ObiBendTwistConstraintsBatch>;
int b = 0;
int b2 = 0;
bool batch = true;
Quaternion prior = followChain[0].rotation;
for (int i = 0; i<chain.Length;i++)
{
Quaternion next = prior;
prior = followChain[i].rotation;
if (batch){
solverConstraints.batches[0].restDarbouxVectors[Bendtwist[0]+b] = ObiUtils.RestDarboux(next,prior);
batch = false;
b++;
}
else {
solverConstraints.batches[1].restDarbouxVectors[Bendtwist[1]+b2] = ObiUtils.RestDarboux(next,prior);
batch = true;
b2++;
}
}