Пример #1
0
 /// <summary>
 /// Remove the passed Mesh from the List
 /// </summary>
 /// <param name="m"></param>
 public void Remove(NodeBox m)
 {
     list.Remove(m);
 }
Пример #2
0
 /// <summary>
 /// True if the Collection contains an instance of this Vector
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public bool Contains(NodeBox m)
 {
     return(list.Contains(m));
 }
Пример #3
0
 protected void RemoveParent(NodeBox par)
 {
     this.parents.Remove(par);
 }
Пример #4
0
 /// <summary>
 /// Add a new Mesh to the Collection
 /// </summary>
 /// <param name="m"></param>
 public void Add(NodeBox m)
 {
     list.Add(m);
 }
Пример #5
0
 protected void AddParent(NodeBox par)
 {
     this.parents.Add(par);
 }
Пример #6
0
 public void RemoveChild(NodeBox cld)
 {
     cld.RemoveParent(this);
     this.childs.Remove(cld);
 }
Пример #7
0
 public void AddChild(NodeBox cld)
 {
     this.childs.Add(cld);
     cld.AddParent(this);
 }
Пример #8
0
        void DoRender(NodeBox nbox, Matrix basem, int effectct)
        {
            MeshBox box = null;

            if (nbox is MeshBox)
            {
                box = (MeshBox)nbox;
            }

            if (box != null)
            {
                if (box.Wire)
                {
                    device.RenderState.FillMode = FillMode.WireFrame;
                }
                else
                {
                    device.RenderState.FillMode = FillMode.Solid;
                }

                device.Material = box.Material;
            }


            Matrix tr = Matrix.Multiply(nbox.Transform, basem);

            if (nbox.Transform.IsAbsolute)
            {
                tr = nbox.Transform;
            }
            device.Transform.World = tr;

            if (box != null)
            {
                if (effect != null && PrepareEffect != null && this.usefx)
                {
                    PrepareEffect(this, new PrepareEffectEventArgs(box));
                }

                for (int s = 0; s < effectct; s++)
                {
                    if (effect != null && this.usefx)
                    {
                        effect.BeginPass(s);
                    }
                    for (int i = 0; i < box.SubSetCount; i++)
                    {
                        box.Mesh.DrawSubset(i);
                    }
                    if (effect != null && this.usefx)
                    {
                        effect.EndPass();
                    }
                }
            }

            foreach (NodeBox cld in nbox)
            {
                DoRender(cld, tr, effectct);
            }
        }
Пример #9
0
 internal PrepareEffectEventArgs(NodeBox mb)
 {
     this.mb = mb;
 }