Table of Contents

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

fA Fixture

The

indexA int

The index

fB Fixture

The

indexB int

The index

Fields

Manifold

Get the contact manifold. Do not modify the manifold unless you understand the internals of Box2D.

public Manifold Manifold

Field Value

Manifold

_edge

The edge shape

private static readonly EdgeShape _edge

Field Value

EdgeShape

_nodeA

The contact edge

internal ContactEdge _nodeA

Field Value

ContactEdge

_nodeB

The contact edge

internal ContactEdge _nodeB

Field Value

ContactEdge

_registers

The not supported

private static readonly Contact.ContactType[,] _registers

Field Value

Contact.ContactType[,]

_toi

The toi

internal float _toi

Field Value

float

_toiCount

The toi count

internal int _toiCount

Field Value

int

_type

The type

private Contact.ContactType _type

Field Value

Contact.ContactType

Properties

ChildIndexA

Get the child primitive index for fixture A.

public int ChildIndexA { get; internal set; }

Property Value

int

ChildIndexB

Get the child primitive index for fixture B.

public int ChildIndexB { get; internal set; }

Property Value

int

Enabled

public bool Enabled { get; set; }

Property Value

bool

FilterFlag

Gets or sets the value of the filter flag

internal bool FilterFlag { get; set; }

Property Value

bool

FixtureA

Gets or sets the value of the fixture a

public Fixture FixtureA { get; internal set; }

Property Value

Fixture

FixtureB

Gets or sets the value of the fixture b

public Fixture FixtureB { get; internal set; }

Property Value

Fixture

Friction

Gets or sets the value of the friction

public float Friction { get; set; }

Property Value

float

IsTouching

Determines whether this contact is touching.

public bool IsTouching { get; set; }

Property Value

bool

IslandFlag

Gets or sets the value of the island flag

internal bool IslandFlag { get; set; }

Property Value

bool

Next

Get the next contact in the world's contact list.

public Contact Next { get; internal set; }

Property Value

Contact

Prev

Get the previous contact in the world's contact list.

public Contact Prev { get; internal set; }

Property Value

Contact

Restitution

Gets or sets the value of the restitution

public float Restitution { get; set; }

Property Value

float

TOIFlag

Gets or sets the value of the toi flag

internal bool TOIFlag { get; set; }

Property Value

bool

TangentSpeed

public float TangentSpeed { get; set; }

Property Value

float

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 Vector2
points FixedArray2<Vector2>

Reset(Fixture, int, Fixture, int)

Resets the f a

private void Reset(Fixture fA, int indexA, Fixture fB, int indexB)

Parameters

fA Fixture

The

indexA int

The index

fB Fixture

The

indexB int

The index

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.