private void AddOctreeNode(List <float> vertices, Octree <T> .Node node, int depth) { AddBox(vertices, node.Region, 1.0f, 1.0f, 1.0f, node.HasElements ? 1.0f : 0.1f); if (node.HasElements) { foreach (var element in node.Elements) { var shading = System.Math.Min(1.0f, depth * 0.1f); AddBox(vertices, element.BoundingBox, 1.0f, shading, 0.0f, 1.0f); // AddLine(vertices, element.BoundingBox.Min, node.Region.Min, 1.0f, shading, 0.0f, 0.5f); // AddLine(vertices, element.BoundingBox.Max, node.Region.Max, 1.0f, shading, 0.0f, 0.5f); } } if (node.HasChildren) { foreach (var child in node.Children) { AddOctreeNode(vertices, child, depth + 1); } } }
public Scene(VrfGuiContext context, float sizeHint = 32768) { GuiContext = context; StaticOctree = new Octree <SceneNode>(sizeHint); DynamicOctree = new Octree <SceneNode>(sizeHint); }