11-04-2018, 10:21 AM
(11-04-2018, 08:53 AM)Semih Wrote: My profiler said 1 call per frame.Hi there,
Ok here is more details.
Here is a screenshot of my Obi Solver settings: https://i.imgur.com/1sWc51W.png As you can see my collision is turned of.
Here is a screenshot of my Obi Rope settings: https://i.imgur.com/eGXZPq0.png
I have a rope that has maybe 20 particles from the beginning. The first particle and last particle has a handle each. So I can set that start and end of the rope via the handles. I have the start handle parented under my player which moves via the CharacterController.Move(..) method. The end handle is just parented to the scene (parent = null) and is moving by a scripts Update method via manipulating its transform position.
When I move around with the character the rope twitches at the start handle (the one parented to the player) but it does not seem to twitch at the end handle. It looks like the rope resets to the start handles position every second or so, almost like it is updating too slow or something.
Does it matter where the actual Obi Rope gameobject is (the one with ObiRope, ObiSolver, MeshRenderer Components)?
Also I have an idea on how to "fix" this. Is it possible for you to help me make the reverse of this function found inside "ObiActor.cs":
Code:public Vector3 GetParticlePosition(int index)
{
if (InSolver)
return solver.renderablePositions[particleIndices[index]];
else
return (ActorLocalToWorldMatrix * initialScaleMatrix.inverse).MultiplyPoint3x4(positions[index]);
}
I want to be able to SetParticlePosition(int index, Vector3 newWorldPosition).
This way I can set the start and end particle position without using handles?
Will try to reproduce this and get back to you asap.
There's Oni.SetParticlePositions(), which is the low-level equivalent of GetParticlePosition() (which is a simple wrapper over Oni.GetParticlePositions(), that returns the position conveniently expressed in world space), but that's already what handles use.