Ejemplo n.º 1
0
        /// <summary>
        /// Creates the bounding box for the specified octant.
        /// </summary>
        /// <param name="bounds"></param>
        /// <param name="octant"></param>
        /// <returns></returns>
        private static Bounds3 GetChildBounds(Bounds3 bounds, Boolean3 octant)
        {
            Vector3 center = bounds.Center;
            Vector3 half   = bounds.Size / 2;
            Vector3 corner = center + (half * octant.ToVector3());

            return(Bounds3.FromVectors(center, corner));
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            for (int j = 0; j < 50; j++)
            {
                var octree = new BoundingOctree <object>();

                for (int i = 0; i < 1000; i++)
                {
                    var bounds = Bounds3.FromVectors(Functions.Random.NextVector3(-1000, 1000), Functions.Random.NextVector3(-1000, 1000));
                    octree.Add(bounds, i);
                }

                Logger.LogError(octree);
            }

            // Network.NetworkTimeProtocol.Test();

            using (var engine = new Engine.CoreEngine())
            {
                engine.Process = new ProgramEngine(engine);
                engine.Run();
            }
        }