Tests interactions between polygons with circular and straight edges.

Why are some of these tests using such small time steps??? to show energy conservation?

TO DO arc (partial circle) tests.

Methods

  • On June 11 2015, HANDLE_COLLISION_FAIL was coming up during this test at time 16.925. June 22 2015: no longer getting HANDLE_COLLISION_FAIL.

    Returns void

  • Ball collides with corner of a block, then they mutually attract each other and collide and then have rolling rocking contact. Note this test activates the HANDLE_COLLISION_FAIL condition in CollisionAdvance.

    This resulted in a STUCK condition on June 11 2015. The fix was to turn on binary search when stuck count > 1. After a bunch of rolling this simulation has the "too close" tiny distance condition (distance is around 0.0006). And then there is an unresolveable collision because the pre-collision velocity is positive and tiny (0.00023). Binary search fails to find a before/after collision with negative velocity in the before state that can be corrected.

    I'm pretty sure what's going on is this: We take two smaller steps during the binary search which results in no actual collision being found; we gain better accuracy from the small steps, the contact forces are calculated more frequently and so we correctly maintain the tiny distance of 0.0006 to the next step. Turning on binary search thus lets us get past this point, though it doesn't fix the tiny distance.

    Returns void

  • Tests the ball & block scenario, that energy is stable and there are no collisions, after initial second to stabilize (because a collision happens in the setup function).

    Returns void

  • A ball falls onto a flat infinite mass floor with elasticity < 1 so the bounces are successively smaller. Using ContactSim this results in a steady contact; but using ImpulseSim the number of bounces goes to infinity, the time between bounces goes to zero and the simulation gets stuck.

    Returns void

  • Shows that a ball falling onto the floor under gravity will get stuck when using ImpulseSim when elasticity is less than 1.0; this test expects that an AdvanceException will occur.

    Returns void

  • This situation should have stable constant energy, but instead we see a slow increase in energy, gap distance, and gap velocity. Adding the following in CircularEdge.findVertexContact results in near stable contact: rbc.radius2 *= 1.000003175;

    Returns void

  • With a very small time step of 0.0025, the energy stays constant to 6 decimal places.

    Returns void

  • A body with a concave circle edge starts in contact with a square block, both bodies attracting each other by mutual gravitation, they start rocking. This test uses a unique approach for positioning the objects where we look at the collision/contact depth between the objects while iteratively setting the initial position until it is at a precise distance. The concave circle object is initially below the block. Each time in the loop we move the block from the origin, a distance of 1.5 to the current estimated location for the block. If no collision results, then we continue to increase the distance which moves the block lower. If a collision results, we reduce the distance by the depth of the collision plus the desired ending gap, and try again.

    Returns void

  • A slowly rotating rectangle collides into a stationary circle, with no gravity. If midpoint vertex contacts are turned on then this test should fail; in that case a contact is falsely detected and a contact force changes the energy when the energy should be constant. Also this test should fail if RigidBodyCollision.updateCollision() is not being called for each collision.

    Another interesting variant of this is to have the block move at higher velocity, and use a small time step (like 0.0025) and set time rate to be slow (0.1) to watch it occur.

    body1.setVelocity(new Vector(-3,  0),  6);
    

    Returns void

  • Tests scenario where a ball falls into the gap between a wall and a fixed block; the space is slightly smaller than the radius of the ball.

    Returns void

Generated using TypeDoc