04-10-2021, 09:24 PM
(30-09-2021, 08:11 AM)josemendez Wrote: Depends on how familiar you are with 3d matrix/vector math. If you can convert data back and forth between local/world space, and understand some basic vector stuff (dot/cross product, projection, normalization, etc), it should be fairly easy once you get used to Obi's particle-based approach.
You can use these with Obi too:
http://obi.virtualmethodstudio.com/manua...eries.html
Is there any way to get the neighbour particle/segment of the rope?
So basically:
I got a particle position when colliding my player's collider with the rope. Now I need to get the bottom and top particle from that particle.
How can I do this? Or just get the 10. neightbor of the particle:
Something like this:
particleNowIndex
GetParticleAbove() => particles[particleNowIndex+1]
GetParticleBelow() => particles[particleNowIndex-1]
GetNextParticle(int plusIndex) => particles[particleNowIndex+plusIndex]
GetNextParticle(-1)
GetNextParticle(+1)
GetNextParticle(-10)
GetNextParticle(+10)
Colision detected via Solver_OnCollision
foreach (var contact in e.contacts)
{
var collision = world.colliderHandles[contact.bodyB].owner;
if (contact.distance < 0.025f)
{
....
_handTouchedChainIndex = contact.bodyA;
}
}
void SwingOnRope() {
var handTouchedChainPosition = solver.positions[_handTouchedChainIndex];
}