List of usage examples for com.badlogic.gdx.physics.box2d ContactImpulse getCount
public int getCount()
From source file:com.tnf.ptm.common.PtmContactListener.java
License:Apache License
private float calcAbsImpulse(ContactImpulse impulse) { float absImpulse = 0; int pointCount = impulse.getCount(); float[] normImpulses = impulse.getNormalImpulses(); for (int i = 0; i < pointCount; i++) { float normImpulse = normImpulses[i]; normImpulse = PtmMath.abs(normImpulse); if (absImpulse < normImpulse) { absImpulse = normImpulse;//w w w .ja v a 2 s.c om } } return absImpulse; }
From source file:org.destinationsol.game.SolContactListener.java
License:Apache License
private float calcAbsImpulse(ContactImpulse impulse) { float absImpulse = 0; int pointCount = impulse.getCount(); float[] normImpulses = impulse.getNormalImpulses(); for (int i = 0; i < pointCount; i++) { float normImpulse = normImpulses[i]; normImpulse = SolMath.abs(normImpulse); if (absImpulse < normImpulse) absImpulse = normImpulse;//from ww w. ja v a2 s . co m } return absImpulse; }