Exemple #1
0
        private void RotateFromCircuittoBE(ref Vec3f vector, ref BlockFacing facing, Vec3f center)
        {
            Vec3f rotation = SignalsUtils.FacingToRotation(this.orientation, this.facing);

            if (vector != null)
            {
                SignalsUtils.RotateVector(ref vector, 0, 0, rotation.Z, center);
                SignalsUtils.RotateVector(ref vector, 0, rotation.Y, 0, center);
                SignalsUtils.RotateVector(ref vector, rotation.X, 0, 0, center);
            }
            if (facing != null)
            {
                facing = facing.FaceWhenRotatedBy(0, 0, rotation.Z * GameMath.DEG2RAD);
                facing = facing.FaceWhenRotatedBy(0, rotation.Y * GameMath.DEG2RAD, 0);
                facing = facing.FaceWhenRotatedBy(rotation.X * GameMath.DEG2RAD, 0, 0);
            }
        }