public void SetEnabledLayers(HashSet <string> layers) { foreach (var renderer in AllNodes) { renderer.LayerEnabled = layers.Contains(renderer.LayerName); } StaticOctree.Clear(); DynamicOctree.Clear(); foreach (var node in staticNodes) { if (node.LayerEnabled) { StaticOctree.Insert(node, node.BoundingBox); } } foreach (var node in dynamicNodes) { if (node.LayerEnabled) { DynamicOctree.Insert(node, node.BoundingBox); } } }
public void Add(SceneNode node, bool dynamic) { if (dynamic) { dynamicNodes.Add(node); DynamicOctree.Insert(node, node.BoundingBox); } else { staticNodes.Add(node); StaticOctree.Insert(node, node.BoundingBox); } }