Esempio n. 1
0
        public void WorldPositionNormalizeToTest()
        {
            WorldPosition position = new WorldPosition(-1, 1, MatrixExtension.SetTranslation(Microsoft.Xna.Framework.Matrix.Identity, 3834, 0, -4118)).NormalizeTo(4, 4);

            Assert.AreEqual(4, position.TileX);
            Assert.AreEqual(-6406, position.Location.X);
            Assert.AreEqual(4, position.TileZ);
            Assert.AreEqual(10262, position.Location.Z);
            Assert.AreEqual(-10262, position.XNAMatrix.M43);
        }
Esempio n. 2
0
        public void WorldPositionNormalizeTest()
        {
            WorldPosition position = new WorldPosition(new WorldLocation(0, 0, 3834, 0, -4118)).Normalize();

            Assert.AreEqual(2, position.TileX);
            Assert.AreEqual(-262, position.Location.X);
            Assert.AreEqual(2, position.TileZ);
            Assert.AreEqual(-22, position.Location.Z);

            position = new WorldPosition(0, 0, MatrixExtension.SetTranslation(Microsoft.Xna.Framework.Matrix.Identity, 3834, 0, -4118)).Normalize();

            Assert.AreEqual(2, position.TileX);
            Assert.AreEqual(-262, position.Location.X);
            Assert.AreEqual(-2, position.TileZ);
            Assert.AreEqual(22, position.Location.Z);
            Assert.AreEqual(-22, position.XNAMatrix.M43);
        }