protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); base.Draw(gameTime); DebugShapeRenderer.Draw(gameTime, camera.ViewMatrix, camera.ProjectionMatrix); }
protected override void Initialize() { DebugShapeRenderer.Initialize(GraphicsDevice); CreateCamera(); tree = OctreeNode.CreateTree(PropagationThreshold, MaxDepth, TreePosition, TreeDimensions); base.Initialize(); }
private OctreeNode(OctreeNode parent, Vector3 nodePosition, Vector3 dimensions) { if (parent != null) { propagationThreshold = parent.propagationThreshold; maximumDepth = parent.maximumDepth; nodeDepth = parent.nodeDepth + 1; } position = nodePosition; boundingBox = new BoundingBox(nodePosition, nodePosition + dimensions); DebugShapeRenderer.AddBoundingBox(boundingBox, Color.Red, 10000000000); }
public void Insert(BoundingSphere item) { DebugShapeRenderer.AddBoundingSphere(item, Color.LimeGreen, 100000000000); if (TryInsertInChildNode(item)) { return; } contents.Add(item); if (!isPartitioned && (maximumDepth < 0 || nodeDepth < maximumDepth) && contents.Count >= propagationThreshold) { PartitionNode(); } }