APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.physics.box2d

public Class Contact

extends Object
Class Inheritance
Imports
com.badlogic.gdx.math.Vector2

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.
Author
mzechner

Field Summary

Modifier and TypeField and Description
protected long
addr

the address

private final float[]
protected World
world

the world

protected final WorldManifold
worldManifold

the world manifold

Constructor Summary

AccessConstructor and Description
protected
Contact(World world, long addr)

Method Summary

Modifier and TypeMethod and Description
public int
getChildIndexA()

Get the child primitive index for fixture A.

public int
getChildIndexB()

Get the child primitive index for fixture B.

public Fixture
getFixtureA()

Get the first fixture in this contact.

public Fixture
getFixtureB()

Get the second fixture in this contact.

public float
getFriction()

Get the friction.

public float
getRestitution()

Get the restitution.

public float
getTangentSpeed()

Get the tangent speed.

public WorldManifold
getWorldManifold()

Get the world manifold.

public boolean
isEnabled()

Has this contact been disabled?

public boolean
private native int
jniGetChildIndexA(long addr)

private native int
jniGetChildIndexB(long addr)

private native long
jniGetFixtureA(long addr)

private native long
jniGetFixtureB(long addr)

private native float
jniGetFriction(long addr)

private native float
jniGetRestitution(long addr)

private native float
jniGetTangentSpeed(long addr)

private native int
jniGetWorldManifold(long addr, float[] tmp)

private native boolean
jniIsEnabled(long addr)

private native boolean
jniIsTouching(long addr)

private native void
jniResetFriction(long addr)

private native void
private native void
jniSetEnabled(long addr, boolean flag)

private native void
jniSetFriction(long addr, float friction)

private native void
jniSetRestitution(long addr, float restitution)

private native void
jniSetTangentSpeed(long addr, float speed)

public void
resetFriction()

Reset the friction mixture to the default value.

public void
ResetRestitution()

Reset the restitution to the default value.

public void
setEnabled(boolean flag)

Enable/disable this contact.

public void
setFriction(float friction)

Override the default friction mixture.

public void
setRestitution(float restitution)

Override the default restitution mixture.

public void
setTangentSpeed(float speed)

Set the tangent speed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addrback to summary
protected long addr

the address

tmpback to summary
private final float[] tmp
worldback to summary
protected World world

the world

worldManifoldback to summary
protected final WorldManifold worldManifold

the world manifold

Constructor Detail

Contactback to summary
protected Contact(World world, long addr)

Method Detail

getChildIndexAback to summary
public int getChildIndexA()

Get the child primitive index for fixture A.

getChildIndexBback to summary
public int getChildIndexB()

Get the child primitive index for fixture B.

getFixtureAback to summary
public Fixture getFixtureA()

Get the first fixture in this contact.

getFixtureBback to summary
public Fixture getFixtureB()

Get the second fixture in this contact.

getFrictionback to summary
public float getFriction()

Get the friction.

getRestitutionback to summary
public float getRestitution()

Get the restitution.

getTangentSpeedback to summary
public float getTangentSpeed()

Get the tangent speed.

getWorldManifoldback to summary
public WorldManifold getWorldManifold()

Get the world manifold.

isEnabledback to summary
public boolean isEnabled()

Has this contact been disabled?

isTouchingback to summary
public boolean isTouching()
jniGetChildIndexAback to summary
private native int jniGetChildIndexA(long addr)
jniGetChildIndexBback to summary
private native int jniGetChildIndexB(long addr)
jniGetFixtureAback to summary
private native long jniGetFixtureA(long addr)
jniGetFixtureBback to summary
private native long jniGetFixtureB(long addr)
jniGetFrictionback to summary
private native float jniGetFriction(long addr)
jniGetRestitutionback to summary
private native float jniGetRestitution(long addr)
jniGetTangentSpeedback to summary
private native float jniGetTangentSpeed(long addr)
jniGetWorldManifoldback to summary
private native int jniGetWorldManifold(long addr, float[] tmp)
jniIsEnabledback to summary
private native boolean jniIsEnabled(long addr)
jniIsTouchingback to summary
private native boolean jniIsTouching(long addr)
jniResetFrictionback to summary
private native void jniResetFriction(long addr)
jniResetRestitutionback to summary
private native void jniResetRestitution(long addr)
jniSetEnabledback to summary
private native void jniSetEnabled(long addr, boolean flag)
jniSetFrictionback to summary
private native void jniSetFriction(long addr, float friction)
jniSetRestitutionback to summary
private native void jniSetRestitution(long addr, float restitution)
jniSetTangentSpeedback to summary
private native void jniSetTangentSpeed(long addr, float speed)
resetFrictionback to summary
public void resetFriction()

Reset the friction mixture to the default value.

ResetRestitutionback to summary
public void ResetRestitution()

Reset the restitution to the default value.

setEnabledback to summary
public void setEnabled(boolean flag)

Enable/disable this contact. This can be used inside the pre-solve contact listener. The contact is only disabled for the current time step (or sub-step in continuous collisions).

setFrictionback to summary
public void setFriction(float friction)

Override the default friction mixture. You can call this in b2ContactListener::PreSolve. This value persists until set or reset.

setRestitutionback to summary
public void setRestitution(float restitution)

Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. The value persists until you set or reset.

setTangentSpeedback to summary
public void setTangentSpeed(float speed)

Set the tangent speed.