Class Contact
- Namespace
- Alis.Core.Physic.Dynamics.Contacts
- Assembly
- Alis.dll
The class manages contact between two shapes. A contact exists for each overlapping AABB in the broad-phase (except if filtered). Therefore a contact object may exist that has no contact points.
public class Contact
Inheritance
Derived
Inherited Members
Constructors
Contact(Fixture, int, Fixture, int)
Initializes a new instance of the Alis.Core.Physic.Dynamics.Contacts.Contact class
protected Contact(Fixture fA, int indexA, Fixture fB, int indexB)
Parameters
Fields
Manifold
Get the contact manifold. Do not modify the manifold unless you understand the internals of Box2D.
public Manifold Manifold
Field Value
_edge
The edge shape
private static readonly EdgeShape _edge
Field Value
_nodeA
The contact edge
internal ContactEdge _nodeA
Field Value
_nodeB
The contact edge
internal ContactEdge _nodeB
Field Value
_registers
The not supported
private static readonly Contact.ContactType[,] _registers
Field Value
_toi
The toi
internal float _toi
Field Value
_toiCount
The toi count
internal int _toiCount
Field Value
_type
The type
private Contact.ContactType _type
Field Value
Properties
ChildIndexA
Get the child primitive index for fixture A.
public int ChildIndexA { get; internal set; }
Property Value
ChildIndexB
Get the child primitive index for fixture B.
public int ChildIndexB { get; internal set; }
Property Value
Enabled
public bool Enabled { get; set; }
Property Value
FilterFlag
Gets or sets the value of the filter flag
internal bool FilterFlag { get; set; }
Property Value
FixtureA
Gets or sets the value of the fixture a
public Fixture FixtureA { get; internal set; }
Property Value
FixtureB
Gets or sets the value of the fixture b
public Fixture FixtureB { get; internal set; }
Property Value
Friction
Gets or sets the value of the friction
public float Friction { get; set; }
Property Value
IsTouching
Determines whether this contact is touching.
public bool IsTouching { get; set; }
Property Value
IslandFlag
Gets or sets the value of the island flag
internal bool IslandFlag { get; set; }
Property Value
Next
Get the next contact in the world's contact list.
public Contact Next { get; internal set; }
Property Value
Prev
Get the previous contact in the world's contact list.
public Contact Prev { get; internal set; }
Property Value
Restitution
Gets or sets the value of the restitution
public float Restitution { get; set; }
Property Value
TOIFlag
Gets or sets the value of the toi flag
internal bool TOIFlag { get; set; }
Property Value
TangentSpeed
public float TangentSpeed { get; set; }
Property Value
Methods
Create(ContactManager, Fixture, int, Fixture, int)
Creates the contact manager
internal static Contact Create(ContactManager contactManager, Fixture fixtureA, int indexA, Fixture fixtureB, int indexB)
Parameters
contactManager
ContactManager-
The contact manager
fixtureA
Fixture-
The fixture
indexA
int-
The index
fixtureB
Fixture-
The fixture
indexB
int-
The index
Returns
- Contact
-
The
Destroy()
Destroys this instance
internal void Destroy()
Evaluate(ref Manifold, ref Transform, ref Transform)
Evaluate this contact with your own manifold and transforms.
private void Evaluate(ref Manifold manifold, ref Transform transformA, ref Transform transformB)
Parameters
manifold
Manifold-
The manifold.
transformA
Transform-
The first transform.
transformB
Transform-
The second transform.
GetWorldManifold(out Vector2, out FixedArray2<Vector2>)
Gets the world manifold.
public void GetWorldManifold(out Vector2 normal, out FixedArray2<Vector2> points)
Parameters
normal
Vector2points
FixedArray2<Vector2>
Reset(Fixture, int, Fixture, int)
Resets the f a
private void Reset(Fixture fA, int indexA, Fixture fB, int indexB)
Parameters
ResetFriction()
Resets the friction
public void ResetFriction()
ResetRestitution()
Resets the restitution
public void ResetRestitution()
Update(ContactManager)
Update the contact manifold and touching status. Note: do not assume the fixture AABBs are overlapping or are valid.
internal void Update(ContactManager contactManager)
Parameters
contactManager
ContactManager-
The contact manager.