dart-lang/dart-box2d — pull request #21 by laszlokorte (2013-07-11 11:13:55+00:00)
Title: [WIP] Use vector_maths Aabb2

AxisAlignBox is removed and vector_maths Aabb2 is used instead.

Performance: https://gist.github.com/laszlokorte/5974467

One odd thing I noticed is that the collision behavior very slightly. For example in the blob_example demo before this change the dropping box ends up resting on the right side but after this change it ends up resting on the left side.

I spent several hours setting breakpoints and looking at the AAbb2 positions in each computation step and came to the conclusion that it seems to be a precision/rounding error of the doubles and floats.

In line 218 in polygon_shape.dart:
```
argAabb.min.x = lower.x - radius;
```
In one computation step `lower.x` is -50.0 and `radius` is 0.01.
Before this change `argAabb.min.x` results to be exactly -50.01 and after this change its -50.00999999977648.

I could reproduce this behavior with:
```
Float32List l = new Float32List(2);
l[0] = -50.0;
l[1] = 0.01;

Float32List l2 = new Float64List(2);
l2[0] = -50.0;
l2[1] = 0.01;

double a = -50.0;
double b = 0.01;

double r = a-b; // -50.01
double r2 = l[0] - l[1]; //-50.00999999977648
double r3 = l[0] - l[1]; //-50.01
```

But I do not know why these commits have any effect like this since it does not change anything regarding the storage type. (The old AxisAlignedBox used Vector2 internally too)