Esempio n. 1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            base.Draw(gameTime);

            DebugShapeRenderer.Draw(gameTime, camera.ViewMatrix, camera.ProjectionMatrix);
        }
Esempio n. 2
0
        protected override void Initialize()
        {
            DebugShapeRenderer.Initialize(GraphicsDevice);

            CreateCamera();

            tree = OctreeNode.CreateTree(PropagationThreshold, MaxDepth, TreePosition, TreeDimensions);

            base.Initialize();
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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();
            }
        }