Esempio n. 1
0
 public int GetEditCount()
 {
     if (editcountcache == -1)
     {
         if (prev == null)
         {
             editcountcache = (nochange ? 0 : 1);               //editcountcache = ( objedit ? 1 : 0 );
         }
         else
         {
             editcountcache = prev.GetEditCount() + (nochange ? 0 : 1);  //( objedit ? 1 : 0 );
         }
     }
     return(editcountcache);
 }
Esempio n. 2
0
        public static IndexedViewableAlpha MeshDiff(SnapshotScene snapshot0, SnapshotScene snapshot1, Vec3f[] verts, bool applymods)
        {
            SnapshotModel[] models0 = snapshot0.Models;
            SnapshotModel[] models1 = snapshot1.Models;

            IndexedViewableAlpha viewable = null;

            int i;
            int c = models1.Length;

            foreach (SnapshotModel model0 in models0)
            {
                int uid = model0.objuid;
                for (i = 0; i < c; i++)
                {
                    if (models1[i].objuid == uid)
                    {
                        break;
                    }
                }
                if (i == c)
                {
                    viewable += model0.GetViewable(verts, applymods); continue;
                }
                SnapshotModel model1 = models1[i];

                if (model0.GetEditCount() == model1.GetEditCount())
                {
                    continue;
                }
                IndexedViewableAlpha diff = SnapshotModel.MeshDiff(model0, model1, verts, applymods);
                viewable += diff;

                //IndexedViewableAlpha view0 = model0.GetViewable( verts, applymods );
                //IndexedViewableAlpha view1 = model1.GetViewable( verts, applymods );
                //viewable += view0 - view1;
            }

            return(viewable);
        }
Esempio n. 3
0
        public static IndexedViewableAlpha MeshIntersectAttach(SnapshotScene snapshot0, SnapshotScene snapshot1, Vec3f[] verts, bool applymods)
        {
            SnapshotModel[] models0 = snapshot0.Models;
            SnapshotModel[] models1 = snapshot1.Models;

            IndexedViewableAlpha viewable = null;

            int i;
            int c = models1.Length;

            foreach (SnapshotModel model0 in models0)
            {
                int uid = model0.objuid;
                for (i = 0; i < c; i++)
                {
                    if (models1[i].objuid == uid)
                    {
                        break;
                    }
                }
                if (i == c)
                {
                    continue;
                }
                SnapshotModel model1 = models1[i];

                if (model0.GetEditCount() == model1.GetEditCount())
                {
                    viewable = IndexedViewableAlpha.Attach(viewable, model0.GetViewable(verts, applymods));
                }
                else
                {
                    viewable = IndexedViewableAlpha.Attach(viewable, SnapshotModel.MeshIntersect(model0, model1, verts, applymods));
                }
            }

            return(viewable);
        }