Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

What does ModifiableContactPoint.Index represent?

Discussion in 'Physics for ECS' started by Mr-Mechanical, Dec 8, 2019.

  1. Mr-Mechanical

    Mr-Mechanical

    Joined:
    May 31, 2015
    Posts:
    507
    I am working with extracting contact data Unity Physics' collision system so every piece of information I can get out of ModifiableContactPoint/ ModifiableContactHeader is essential for my usecase. I am curious what exactly ModifiableContactPoint.Index represents (what specifically is it an index for)?
     
  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    See com.unity.physics\Unity.Physics\Dynamics\Simulation\IContactsJob.cs
    Code (CSharp):
    1.         /// Index of this point, within the ModifiableContactHeader
    2.         public int Index { get; internal set; }
    A contact can be made up of multiple points. E.g. a cube lying on one face on a flat plane would have 4 points making up the contact between plane and cube.
     
    Mr-Mechanical likes this.