add rotation range tests

This commit is contained in:
Konstantin Käfer
2014-03-17 12:32:53 +01:00
parent 85449e097c
commit e8db54367f
4 changed files with 153 additions and 3 deletions

View File

@@ -233,8 +233,8 @@ CollisionRange rotationRange(const CollisionBox &inserting,
const CollisionBox &b = blocker;
// Instead of scaling the boxes, we move the anchors
CollisionAnchor relativeAnchor{(b.anchor.x - a.anchor.x) * scale,
(b.anchor.y - a.anchor.y) * scale};
CollisionAnchor relativeAnchor{static_cast<float>((b.anchor.x - a.anchor.x) * scale),
static_cast<float>((b.anchor.y - a.anchor.y) * scale)};
// Generate a list of collision interval
if (a.rotate && b.rotate) {