Ejemplo n.º 1
0
        public Submesh3D Clone()
        {
            var clone = new Submesh3D();

            clone.Mesh          = Mesh.ShallowClone();
            clone.BoneNames     = new List <string>(BoneNames);
            clone.BoneBindPoses = new List <Matrix44>(BoneBindPoses);
            clone.Material      = Material.Clone();
            clone.Owner         = null;
            return(clone);
        }
Ejemplo n.º 2
0
        public void TestRP_CombineAPI()
        {
            // AEL: I am not sure if we should test more here or if it is sufficient to check if reactions happened or not?
            BasicReactionSupporter brs = new BasicReactionSupporter();

            Initialize(brs);

            IMaterial m1 = brs.MyMaterialCatalog["Hydrochloric Acid"].CreateMass(10, 20);
            IMaterial m2 = brs.MyMaterialCatalog["Caustic Soda"].CreateMass(12, 44);
            IMaterial m3 = brs.MyMaterialCatalog["Nitrous Acid"].CreateMass(2, 60);

            IMaterial resultA;
            ArrayList observedReactions, observedReactionInstances;

            _Debug.WriteLine("Part A : Reaction should happen...");
            bool reactionAHappened = brs.MyReactionProcessor.CombineMaterials(new IMaterial[] { m1.Clone(), m2.Clone(), m3.Clone() }, out resultA, out observedReactions, out observedReactionInstances);

            //bool reactionHappened = brs.MyReactionProcessor.CombineMaterials(new IMaterial[]{m1,m2,m3},out result, out observedReactions, out observedReactionInstances);

            _Debug.WriteLine("Engine says that reactions " + (reactionAHappened?"happened.":"didn't happen."));

            _Debug.WriteLine("\r\nObserved Reactions");
            foreach (Reaction r in observedReactions)
            {
                _Debug.WriteLine(r.ToString());
            }

            _Debug.WriteLine("\r\nObserved Reaction Instances");
            foreach (ReactionInstance ri in observedReactionInstances)
            {
                _Debug.WriteLine(ri.ToString());
            }

            _Debug.WriteLine("\r\nMixture");
            _Debug.WriteLine(resultA.ToString());


            IMaterial resultB;

            _Debug.WriteLine("Part B : Reaction should not happen...");
            bool reactionBHappened = brs.MyReactionProcessor.CombineMaterials(new IMaterial[] { m1.Clone(), m3.Clone() }, out resultB, out observedReactions, out observedReactionInstances);

            _Debug.WriteLine("Engine says that reactions " + (reactionBHappened?"happened.":"didn't happen."));

            _Debug.WriteLine("\r\nObserved Reactions");
            foreach (Reaction r in observedReactions)
            {
                _Debug.WriteLine(r.ToString());
            }

            _Debug.WriteLine("\r\nObserved Reaction Instances");
            foreach (ReactionInstance ri in observedReactionInstances)
            {
                _Debug.WriteLine(ri.ToString());
            }

            _Debug.WriteLine("\r\nMixture");
            _Debug.WriteLine(resultB.ToString());

            _Debug.Assert(!reactionBHappened, "Reaction B should not have happened");
        }