Skip to content

Commit

Permalink
Fixed BulletTest. Faith restored in TOI system, if only a little.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurph committed Apr 2, 2014
1 parent 76626eb commit b823783
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Expand Up @@ -42,6 +42,7 @@
* @author Daniel Murphy
*/
public class Distance {
public static final int MAX_ITERS = 20;

public static int GJK_CALLS = 0;
public static int GJK_ITERS = 0;
Expand Down Expand Up @@ -642,7 +643,7 @@ public final void distance(final DistanceOutput output, final SimplexCache cache

// Main iteration loop
int iter = 0;
while (iter < GJK_MAX_ITERS) {
while (iter < MAX_ITERS) {

// Copy simplex so we can identify duplicates.
saveCount = simplex.m_count;
Expand Down
Expand Up @@ -49,7 +49,7 @@ public abstract class Contact {
// Used when crawling contact graph when forming islands.
public static final int ISLAND_FLAG = 0x0001;
// Set when the shapes are touching.
public static final int TOUCHING_FLAG = 0x0002; // NO_UCD
public static final int TOUCHING_FLAG = 0x0002;
// This contact can be disabled (by user)
public static final int ENABLED_FLAG = 0x0004;
// This contact needs filtering because a fixture filter was changed.
Expand Down
Expand Up @@ -17,6 +17,16 @@ public class BulletTest extends TestbedTest {
Body m_body;
Body m_bullet;
float m_x;

@Override
public Vec2 getDefaultCameraPos() {
return new Vec2(0, 6);
}

@Override
public float getDefaultCameraScale() {
return 40;
}

@Override
public void initTest(boolean deserialized) {
Expand Down Expand Up @@ -66,9 +76,7 @@ public void launch() {
m_body.setAngularVelocity(0.0f);

m_x = MathUtils.randomFloat(-1.0f, 1.0f);
m_x = -0.06530577f;
m_bullet.setTransform(new Vec2(m_x, 10.0f), 0.0f);
System.out.println(m_x);
m_bullet.setLinearVelocity(new Vec2(0.0f, -50.0f));
m_bullet.setAngularVelocity(0.0f);

Expand Down

0 comments on commit b823783

Please sign in to comment.