Пример #1
0
        public void TestPosRotX()
        {
            var M = new IdPositionRotation()
            {
                id = 1, pos = new PVector3(), rot = new PVector3(45, 0, 0)
            };
            var A = new IdPositionRotation()
            {
                id = 1, pos = new PVector3(20, 20, 20), rot = new PVector3()
            };
            var R = EmpyrionBaseAlign.ExecAlign(M, A, Vector3.Zero, Vector3.Zero);

            Assert.AreEqual(19.799, Math.Round(R.pos.x, 3));
            Assert.AreEqual(19.799, Math.Round(R.pos.y, 3));
            Assert.AreEqual(20, Math.Round(R.pos.z, 3));

            Assert.AreEqual(45, R.rot.x);
            Assert.AreEqual(0, R.rot.y);
            Assert.AreEqual(0, R.rot.z);
        }
Пример #2
0
        public void TestAlignedPosRot()
        {
            var M = new IdPositionRotation()
            {
                id = 1, pos = new PVector3(), rot = new PVector3()
            };
            var A = new IdPositionRotation()
            {
                id = 1, pos = new PVector3(20, 20, 20), rot = new PVector3()
            };
            var R = EmpyrionBaseAlign.ExecAlign(M, A, Vector3.Zero, Vector3.Zero);

            Assert.AreEqual(20, R.pos.x);
            Assert.AreEqual(20, R.pos.y);
            Assert.AreEqual(20, R.pos.z);

            Assert.AreEqual(0, R.rot.x);
            Assert.AreEqual(0, R.rot.y);
            Assert.AreEqual(0, R.rot.z);
        }