Hi,
I send this post because there is no out-of-box support for tear rod and I need this in my game dev. By looking at Obi source code I finally implemented a close one. Though it's more like a "fold rod" and mesh is not split, it's ok for my game's requirement. I hope this can help you if you have similar requirement. It's based on Obi Rope 7.0.5
Also I'd like to ask why this feature is not supported in case I missed something important and my code may fail to work in future Obi version.
My code is actually very simple, just deactivate a constraint:
public void TearRod()
{
ObiRod rod = fishingRod;
var twistBatch = rod.GetConstraintsByType(Oni.ConstraintType.BendTwist) as ObiBendTwistConstraintsData;
foreach (ObiBendTwistConstraintsBatch batch in twistBatch.batches)
{
if (batch != null)
{
batch.DeactivateConstraint(0);
}
}
rod.SetConstraintsDirty(Oni.ConstraintType.BendTwist);
}
Effect gif: p1.gif
I send this post because there is no out-of-box support for tear rod and I need this in my game dev. By looking at Obi source code I finally implemented a close one. Though it's more like a "fold rod" and mesh is not split, it's ok for my game's requirement. I hope this can help you if you have similar requirement. It's based on Obi Rope 7.0.5
Also I'd like to ask why this feature is not supported in case I missed something important and my code may fail to work in future Obi version.
My code is actually very simple, just deactivate a constraint:
public void TearRod()
{
ObiRod rod = fishingRod;
var twistBatch = rod.GetConstraintsByType(Oni.ConstraintType.BendTwist) as ObiBendTwistConstraintsData;
foreach (ObiBendTwistConstraintsBatch batch in twistBatch.batches)
{
if (batch != null)
{
batch.DeactivateConstraint(0);
}
}
rod.SetConstraintsDirty(Oni.ConstraintType.BendTwist);
}
Effect gif: p1.gif