public void BoundBoxQueryTest() { var space = new Space(); var body = new Body(1, 1.66); var shape = new Box(body, 5, 5, 0); var pos = new Vect(3, 3); body.Position = pos; var bb = new BoundingBox(); bb.Left = -20; bb.Top = -20; bb.Right = +20; bb.Bottom = +20; Shape[] shapes = space.BoundBoxQuery(bb, ShapeFilter.All).ToArray(); Assert.AreEqual(0, shapes.Length, "#1"); space.AddBody(body); space.AddShape(shape); space.ReindexShape(shape); shapes = space.BoundBoxQuery(bb, ShapeFilter.All).ToArray(); Assert.AreEqual(1, shapes.Length, "#2"); Assert.AreSame(shape, shapes[0], "#3"); shape.Dispose(); body.Dispose(); space.Dispose(); }