コード例 #1
0
        public OctreeNode crearOctree(List <TgcMesh> modelos, TgcBoundingAxisAlignBox sceneBounds)
        {
            var rootNode = new OctreeNode();

            var pMax = sceneBounds.PMax;
            var pMin = sceneBounds.PMin;

            //Calcular punto medio y centro
            var midSize = sceneBounds.calculateAxisRadius();
            var center  = sceneBounds.calculateBoxCenter();

            //iniciar generacion recursiva de octree
            doSectorOctreeX(rootNode, center, midSize, 0, modelos);

            //podar nodos innecesarios
            deleteEmptyNodes(rootNode.children);

            //eliminar hijos que subdividen sin necesidad
            //deleteSameMeshCountChilds(rootNode);

            //imprimir por consola el octree
            //printDebugOctree(rootNode);

            //imprimir estadisticas de debug
            //printEstadisticasOctree(rootNode);

            return(rootNode);
        }
コード例 #2
0
        public QuadTreeNode crearQuadTree(List <StaticObject> StaticObjects, TgcBoundingAxisAlignBox sceneBounds)
        {
            var rootNode = new QuadTreeNode();

            //Calcular punto medio y centro
            var midSize = sceneBounds.calculateAxisRadius();
            var center  = sceneBounds.calculateBoxCenter();

            //iniciar generacion recursiva de octree
            doSectorQuadTreeX(rootNode, center, midSize, 0, StaticObjects);

            return(rootNode);
        }
コード例 #3
0
        public QuadtreeNode crearQuadtree(List <TgcMesh> TgcMeshs, TgcBoundingAxisAlignBox sceneBounds)
        {
            var rootNode = new QuadtreeNode();

            //Calcular punto medio y centro
            var midSize = sceneBounds.calculateAxisRadius();
            var center  = sceneBounds.calculateBoxCenter();

            //iniciar generacion recursiva de octree
            doSectorQuadtreeX(rootNode, center, midSize, 0, TgcMeshs);

            //podar nodos innecesarios
            optimizeSectorQuadtree(rootNode.children);

            //imprimir por consola el octree
            //printDebugQuadtree(rootNode);

            //imprimir estadisticas de debug
            //printEstadisticasQuadtree(rootNode);

            return(rootNode);
        }
コード例 #4
0
        public RigidBody Create(TgcBoundingAxisAlignBox boundingBox)
        {
            var radius = boundingBox.calculateAxisRadius().ToBulletVector3();

            return(CreateRigidBody(boundingBox.Position, radius, 0));
        }