Esempio n. 1
0
    public void SyncWithModel(FigureModel model, List <ControlVertexProvider> children)
    {
        //sync occluder
        var materialSetDirector   = model.MaterialSet.Directory;
        var newOcclusionDirectory =
            OccluderLoader.IsOcclusionDirectory(materialSetDirector) ? materialSetDirector :
            (model.Shape.Directory ?? occluderLoader.DefaultDirectory);

        if (newOcclusionDirectory != occlusionDirectory)
        {
            var newOccluder = occluderLoader.Load(newOcclusionDirectory);

            occluder?.Dispose();

            occlusionDirectory = newOcclusionDirectory;
            occluder           = newOccluder;
        }

        //sync visible
        isVisible = model.IsVisible;

        //register child occluders
        if (children != null)
        {
            //children are synced first so all children should have occluders by this point
            var childOccluders = children
                                 .Where(child => child.isVisible)
                                 .Select(child => child.occluder)
                                 .ToList();

            occluder.SetChildOccluders(childOccluders);
        }
    }
Esempio n. 2
0
 public void AddBinding(IOccluder plane, Vector3 zero)
 {
     Bindings.Add(new SceneBinding(plane, zero));
 }
Esempio n. 3
0
 public ZBufferItem(IOccluder o, Vector3 i, Vector3 t)
 {
     Primitive = o;
     Intersection = i;
     Translation = t;
 }
Esempio n. 4
0
 public SceneBinding(IOccluder mesh, Vector3 position)
 {
     Shape = mesh;
     Position = position;
 }