Beispiel #1
0
        public void CheckCollision(float x, float y, float z, bool hasCollision, float separationX, float separationY, float separationZ)
        {
            var distance     = new Vector3(x, y, z);
            var boundingBox1 = new BoundingBox(new Vector3(-5), new Vector3(5));
            var boundingBox2 = new BoundingBox(new Vector3(-5) + distance, new Vector3(5) + distance);

            var collisionResult = boundingBox1.CollidesWithSat(boundingBox2);
            var separation      = new Vector3(separationX, separationY, separationZ);

            Assert.That(collisionResult, Is.Not.Null);
            Assert.That(collisionResult.Collides, Is.EqualTo(hasCollision));
            Assert.That(collisionResult.Axis, Is.EqualTo(separation));
        }