Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope extension, vibration and collision
#7
Code:
public void OnRopeContactEnter(ObiSolver solver, Oni.Contact contact)
{
     var world = ObiColliderWorld.GetInstance();
     var col = world.colliderHandles[contact.bodyB].owner;

     if (col != null && col.GetComponent<Item>() != null && !col.GetComponent<Item>().ColliderTriggerControl())
     {
         if (!GameManager.instance.usedItems.Contains(col.GetComponent<Item>()))
         {
             GameManager.instance.UsedItemsAdd(col.GetComponent<Item>());
           
             Debug.Log("Contact: " + col.name);

             
             int particleIndex = contact.bodyA;
             Vector2 contactPoint = solver.positions[particleIndex] + contact.normal * contact.distance;


         }
     }
}

How do I find the value of "normalizedCoord"?
Can I find a value that corresponds to the "M" value in the Obi Rope Attach code?
I need the collision value of the item with the rope (e.g. 0.658f) to be able to launch the object from that point.
Reply


Messages In This Thread
RE: Rope extension, vibration and collision - by 0hsyn1 - 27-04-2025, 07:43 PM