Jump to content

  • Log In with Google      Sign In   
  • Create Account


Creating a Quadtree with a Height-map generated Terrain.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
39 replies to this topic

#1 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 21 August 2006 - 02:30 AM

So, I'm fairly new to Terrain generation (I've just done a basic 256x256 heightmap terrain before, no specific culling, collision, or LOD in that project) but I'm trying to play around with things like Quadtrees for culling and collision, and texture splatting for better looking textures. Texture splatting I understand, Quadtrees are a different matter. I understand the principle of a quadtree(4 nodes , each containing 1 - 2 levels with 4 more nodes under each of those nodes), but I'm having trouble trying to think of a way to code this. My basic pseudo code for creating the heightmap terrain right now is: Read in the heightmap Create a vertex per "hexel" Create Indexed buffer of those vertexes. As you can see I never really create any triangles, I simple get all the vertices and then just create triangles using the indexed buffer. This is great for rendering but obviously I have absolutely no collision data or way to cull out unseen sectors of the terrain. Here is what I am thinking with the Quadtree implementation: Read in the height map Create a vertex per "hexel" Create a list of Triangles for each triangle Find the center point of each triangle Use that point to find a place within the QuadTree structure for that point Add triangle to node list When rendering I just use the players position to grab all the triangles in the player's area. Collision is done the same way, except that you recurse down all the way the quad tree in order to get as few triangles as possible. Does this sound like a pretty basic quad tree implementation that would work for static geometry? Also, is there any problem with using a triangles center for its' position within the Quadtree? Should I check all vertices so that if a triangle crosses 2 Quadtree regions it is placed in both? Thanks in advance.

Sponsor:

#2 memento_mori   Members   -  Reputation: 100

Like
0Likes
Like

Posted 21 August 2006 - 08:46 AM

I would have done it without Quadtrees... You could use bounding boxes, that divide the map on the X-Z axis.
A simple 2d array to hold your Quad Objects, that's how I would have done it. QuadTrees complicate the matter in your case.

Quote:
Also, is there any problem with using a triangles center for its' position within the Quadtree?

Yes there is... If the triangle is to big and spans through more than one bounding box, assigning it with the box holding it's center wont do... that box might not be visible but the one next to it might be, and the triangle won't be drawn...

However, if you're using a heightmap, and make sure that your map is devided well so that bounding box edges happen to be on the coordinates of the edges of the triangles, then you won't have the problem since no polygon will span over more than one box...

Quote:
Should I check all vertices so that if a triangle crosses 2 Quadtree regions it is placed in both?

As I said before, If you're using a heightmap, you could coincide your bounding boxes on the edges of the triangles, and you won't have triangles corssing 2 Quadtrees.

Either way, if for any reason you have polygons spanning over more than one box, the best way would be to split them while compiling your map... Much cheaper, especially that it won't create that much more polys, it's a 2d quadtree

Hope that was helpful
Good Luck


#3 TheAdmiral   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 21 August 2006 - 09:45 AM

Quadtrees should scream 'object-oriented' at you. The idea is to create a recursive class (i.e. a class that contains instances of itself) that will delegate all the work to its children.
All the work should be done by the class itself: Creating and rendering the tree should both be one-liners. To give you an idea of what's responsible for what, here's my basic quadtree declaration:

class QuadTree {
public:
QuadTree *Children[4];
int XMin, XMax, ZMin, ZMax;
bool isLeaf;
ID3DXMesh *Mesh;
int RecursionLevel;

QuadTree::QuadTree(int MinX, int MaxX, int MinZ, int MaxZ, int Level = 0);
QuadTree::~QuadTree();
bool Visible();
void QuadTree::Render();
};


The constructor will calculate how many triangles it is responsible for. If the value is above a threshold it will create four new QuadTrees and pass them the new coordinates. Once the plane has been split far enough (and the trinagle count is low enough), vertex buffers will be created as necessary and the recursion will terminate. So all the vertex data is stored in the leaves.
Similarly, when rendering, all non-leaves will pass the call onto their children and all the rendering will be done by the deepest nodes.

So after defining the functions, the entire tree can be created with a single call to 'new QuadTree(0, 256, 0, 256)'. If you're wondering where the y-values come from, the terrain is defined by a truncated Fourier series (so the terrain potentially extend to infinity in all directions), and so I have a global function that returns the height of the land at any (x, z) that the class uses.

I hope this helps
Admiral

#4 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 23 August 2006 - 03:05 AM

(Sorry for the late reply, I've been busy)

Thanks for the help Admiral. I had never heard OO and QuadTree in the same sentence so I think that is what had me stuck for so long. I do have one other question though.

How should I go about actually deciding which triangle goes in which leaf?

Should I do something like:

If any vertices are between Min X - Max X and Min Z - Max Z, add the triangle to list. Repeat for all Children incase the triangle overlaps any boundaries.

Also, what is a good triangle count to stop splitting the plains and start adding the triangles? Or should I design the system with the ability to break the tree down as far as possible(say to 32 triangles or less), but have the ability to render higher triangle counts by collecting triangles from children? (So, Physics wise we are checking 32 triangles, but when we render we render something closer to 500 - 1000).

Sorry for all the questions but I've been playing with QuadTrees for the last month and this is the biggest breakthrough I've had in a while.

#5 TheAdmiral   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 23 August 2006 - 04:26 AM

The triangles should be places in the leaves by locality. Each leaf should represent an axis-aligned square/rectangle of terrain surface. As far as each instance of QuadTree should be concerned, it is responsible for rendering all the terrain inside its bounds (defined by its values of Min/Max X/Z) and nothing exists outside of those bounds (that it has anything to do with).

So depending on where the recursion terminates, the terrain gets divided as follows:

Level 1:

1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1

Level 2:

1 1 2 2
1 1 2 2
3 3 4 4
3 3 4 4

Level 3:

1 2 5 6
3 4 7 8
9 A D E
B C F G

and so on. The blocks here are of arbitrary size, and the numbers determine the order in which the leaves appear if the tree is accesses sequentially.

As for when to terminate the recursion, that depends on your render settings. ATI and nVidia recommend putting about 1000 vertices in a vertex buffer, but after cache optimisation, users have reported optimality at much higher values.
Tweaking this threshold governs the tradeoff between culling efficiency (smaller patches means fewer redundant renders) and batch optimisation (rendering many small patches is slower than rendering few large ones).
If you are using a hardware device, you can afford to cram more vertices into a VB, whereas SWP will benefit from smaller patches to avoid redundant vertex transformations.

Ultimately, the value will depend on your mesh resolution (compared to estimated viewing distance), the size of your vertex struct and you existing CPU/GPU synchronisation, so trial-and-error is usually necessary to get the best framerates.
A typical quadtree engine will have this value set somewhere between 500 and 10000 (vertices per patch). Mine seems to like 1000.

Regards
Admiral

#6 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 23 August 2006 - 04:42 AM

I figured the bigger the rendering batch, the better - to a degree.

Right now I have the tree extend down pretty far because I want to be able to pull triangles for terrain following. So, getting a resolution of 32 or so triangles from where the player is standing is pretty decent. But I did add code where all parents know the total triangle count of all their children, so when I go to render the message is just passed until a parent with the appropriate count is found. I plan to add code in my creation recursion to create a Mesh when the triangle count hits a certain threshold (say 1000 triangles or whatever), all children below that point just contain triangles for physic collisions and not renderable meshes. That way the smallest amount of triangles rendered is 1000 ( or close to it) yet I can still do decent collision detection with the ground.

Any foresee-able issues with that approach?

#7 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 24 August 2006 - 04:38 AM

Okay, I hit an issue.

Apparently my QuadTree is hitting an infinite loop(I hate recursion) but I dont see where this is occuring. Also, the Level (i.e. level of recursion) is constantly 1 despite me updating it each time. Sorry for the Mega function but its the meat and potatoes of my QuadTree class, I tried to comment well enough for you guys to follow along.


#define MAX_PHYSICS_TRIANGLES 64
#define MAX_RENDER_TRIANGLES 1024

CQuadTree::CQuadTree(int MinX, int MaxX, int MinZ, int MaxZ, int Level, bool bJustPhysics)
{
char buffer[256] = {0};
sprintf(buffer, "CQuadTree Constructor called. MinX: %d, MaxX: %d, MinZ: %d, MaxZ: %d, Level: %d\n",
MinX, MaxX, MinZ, MaxZ, Level);
CLogger::GetInstance()->WriteToFile(buffer);

// See if we are the first level or not.
if(Level > 0)
m_bIsLeaf = true;
else
m_bIsLeaf = false;

// Set all Children, Meshes, and values to initial values.
m_pChildren[0] = NULL;
m_pChildren[1] = NULL;
m_pChildren[2] = NULL;
m_pChildren[3] = NULL;

m_pMesh = NULL;

m_iMinX = MinX;
m_iMaxX = MaxX;
m_iMinZ = MinZ;
m_iMaxZ = MaxZ;
m_iLevel = Level;

// Number of Triangles = (Max X - Min X) * (Max Z - Min Z) * 2
// If we are the minimum count required for rendering....
if((((MaxX - MinX) * (MaxZ - MinZ) * 2) <= MAX_RENDER_TRIANGLES) && !bJustPhysics)
{
// Iterate through and find all the triangles within our range.
int triangleCount = 0;
vector<CHeightMap::terrainTriangle*>* pTriangles = CHeightMap::GetInstance()->GetTriangleList();

for(unsigned int i = 0; i < pTriangles->size(); ++i)
{
for (int k = 0; k < 3; ++k)
{
if(((*pTriangles)[i]->vertices[k].x >= m_iMinX) &&
((*pTriangles)[i]->vertices[k].x <= m_iMaxX) &&
((*pTriangles)[i]->vertices[k].z >= m_iMinZ) &&
((*pTriangles)[i]->vertices[k].z <= m_iMaxZ))
{
triangleCount++;
break;
}
}
}
// Make sure we found some Triangles.
if(triangleCount)
{
char buffer[256] = {0};
sprintf(buffer, "Creating Renderable Mesh. Triangle Count: %d\n",
triangleCount);

CLogger::GetInstance()->WriteToFile(buffer);
// Begin Creating the actual Mesh.
CHeightMap::terrainVertex* vertex;
D3DXCreateMeshFVF(triangleCount, (triangleCount * 2), D3DXMESH_MANAGED, D3DFVF_XYZ |D3DFVF_TEX1, CRenderer::GetInstance()->GetDevice(), &m_pMesh);

m_pMesh->LockVertexBuffer(0, (void**)&vertex);
int vertexIndex = 0;

for(unsigned int i = 0; i < pTriangles->size(); ++i)
{
for (int k = 0; k < 3; ++k)
{
if(((*pTriangles)[i]->vertices[k].x >= m_iMinX) &&
((*pTriangles)[i]->vertices[k].x <= m_iMaxX) &&
((*pTriangles)[i]->vertices[k].z >= m_iMinZ) &&
((*pTriangles)[i]->vertices[k].z <= m_iMaxZ))
{
vertex[vertexIndex] = (*pTriangles)[i]->vertices[0];
vertex[vertexIndex+1] = (*pTriangles)[i]->vertices[1];
vertex[vertexIndex+2] = (*pTriangles)[i]->vertices[2];

vertexIndex += 3;

break;
}
}
}
m_pMesh->UnlockVertexBuffer();

WORD* indexBuffer = 0;
m_pMesh->LockIndexBuffer(0, (void**)&indexBuffer);
for(int i = 0; i < (triangleCount * 2); i++)
{
indexBuffer[i] = i;
}
m_pMesh->UnlockIndexBuffer();

DWORD* attributeBuffer = 0;
m_pMesh->LockAttributeBuffer(0, &attributeBuffer);
for(int i = 0; i < triangleCount; i++)
{
attributeBuffer[i] = 0;
}
m_pMesh->UnlockAttributeBuffer();

std::vector<DWORD> adjacencyBuffer(m_pMesh->GetNumFaces() * 3);
m_pMesh->GenerateAdjacency(0.001f, &adjacencyBuffer[0]);
m_pMesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT | D3DXMESHOPT_COMPACT | D3DXMESHOPT_VERTEXCACHE,
&adjacencyBuffer[0], NULL, NULL, NULL);

}
}

// Have we reached our physics threshold yet?
if(((MaxX - MinX) * (MaxZ - MinZ) * 2) > MAX_PHYSICS_TRIANGLES)
{
// Still too many triangles, need to split again.
int xIncrement = MaxX/4;
int zIncrement = MaxZ/4;
int newLevel = Level++;

// Create Children Nodes
for(int i = 0; i < 4; ++i)
{
char buffer[256] = {0};
sprintf(buffer, "Splicing, Creating more Children. New Level: %d\n",
newLevel);
CLogger::GetInstance()->WriteToFile(buffer);

// Have we passed the rendering threshold yet?
if(((MaxX - MinX) * (MaxZ - MinZ) * 2) > MAX_RENDER_TRIANGLES)
{
// Nope, keep checking.
m_pChildren[i] = new CQuadTree((i*xIncrement), (i*xIncrement + xIncrement),
(i*zIncrement), (i*zIncrement + zIncrement), newLevel, false);
}
else // Yup, only looking for Physics triangles now
m_pChildren[i] = new CQuadTree((i*xIncrement), (i*xIncrement + xIncrement),
(i*zIncrement), (i*zIncrement + zIncrement), newLevel, true);
}

}
else
{
// Get all the triangles in our range, for physics calculations.
vector<CHeightMap::terrainTriangle*>* pTriangles = CHeightMap::GetInstance()->GetTriangleList();

for(unsigned int i = 0; i < pTriangles->size(); ++i)
{
for (int k = 0; k < 3; ++k)
{
if(((*pTriangles)[i]->vertices[k].x >= m_iMinX) &&
((*pTriangles)[i]->vertices[k].x <= m_iMaxX) &&
((*pTriangles)[i]->vertices[k].z >= m_iMinZ) &&
((*pTriangles)[i]->vertices[k].z <= m_iMaxZ))
{
// Physics list of triangles.
m_pTriangles.push_back((*pTriangles)[i]);

char buffer[256] = {0};
sprintf(buffer, "Created Physics Triangle\n");
CLogger::GetInstance()->WriteToFile(buffer);
break;
}
}
}
}
}





My log file:

[Source]
CQuadTree Constructor called. MinX: 0, MaxX: 63, MinZ: 0, MaxZ: 63, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 15, MinZ: 0, MaxZ: 15, Level: 0
Creating Renderable Mesh. Triangle Count: 6
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 30, MinZ: 15, MaxZ: 30, Level: 0
Creating Renderable Mesh. Triangle Count: 8
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 6, MaxX: 9, MinZ: 6, MaxZ: 9, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 9, MaxX: 12, MinZ: 9, MaxZ: 12, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 14, MaxX: 21, MinZ: 14, MaxZ: 21, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 5, MinZ: 0, MaxZ: 5, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 5, MaxX: 10, MinZ: 5, MaxZ: 10, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 10, MaxX: 15, MinZ: 10, MaxZ: 15, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 15, MaxX: 20, MinZ: 15, MaxZ: 20, Level: 0
Created Physics Triangle
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 21, MaxX: 28, MinZ: 21, MaxZ: 28, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 7, MinZ: 0, MaxZ: 7, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 1, MinZ: 0, MaxZ: 1, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 1, MaxX: 2, MinZ: 1, MaxZ: 2, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 2, MaxX: 3, MinZ: 2, MaxZ: 3, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 4, MinZ: 3, MaxZ: 4, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 7, MaxX: 14, MinZ: 7, MaxZ: 14, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 3, MinZ: 0, MaxZ: 3, Level: 0
Created Physics Triangle
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 3, MaxX: 6, MinZ: 3, MaxZ: 6, Level: 0
Splicing, Creating more Children. New Level: 0






Any ideas?

EDIT: The more I look at it, the more I think the problem is this: // Number of Triangles = (Max X - Min X) * (Max Z - Min Z) * 2

That formula has to be wrong. Maybe I'm just too fried from working on this to see the error. I also just added stepping so really the Terrain extends from MinX 0 to MaxX (64 * 8) 64 being the heightmap width, 8 being the stepping. Same for the MinZ and Max Z.

I still don't have any clue as to why the Level isn't incrementing despite the debugger shows it incrementing.

EDIT 2: Fixed the incrementing. I'm a retard. Stupid post-fix. Anyway, making some progress. I got the formula working right it seems, but my recursion is still going wonky some where. Continuing to play with things.

[Edited by - ChaosPhoenix on August 24, 2006 1:38:54 PM]

#8 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 24 August 2006 - 09:16 AM

Okay, cleaned up the code a lot.

The planes seem to be splitting correctly, however, I'm still going WAYY too many levels deep(i.e. > 25). I can't seem to find out why.

Cleaned up code:


CQuadTree::CQuadTree(int MinX, int MaxX, int MinZ, int MaxZ, int Level, bool bJustPhysics)
{
char buffer[256] = {0};
sprintf(buffer, "CQuadTree Constructor called. MinX: %d, MaxX: %d, MinZ: %d, MaxZ: %d, Level: %d\n",
MinX, MaxX, MinZ, MaxZ, Level);
CLogger::GetInstance()->WriteToFile(buffer);

// See if we are the first level or not.
if(Level > 0)
m_bIsLeaf = true;
else
m_bIsLeaf = false;

// Set all Children, Meshes, and values to initial values.
m_pChildren[0] = NULL;
m_pChildren[1] = NULL;
m_pChildren[2] = NULL;
m_pChildren[3] = NULL;

m_pMesh = NULL;


m_iMinX = MinX;
m_iMaxX = MaxX;
m_iMinZ = MinZ;
m_iMaxZ = MaxZ;

m_iLevel = Level;

// Number of Triangles = (Max X - Min X) * (Max Z - Min Z) * 2
// If we are the minimum count required for rendering....
int Debug = NumTrianglesInRange();

if(( NumTrianglesInRange() <= MAX_RENDER_TRIANGLES) && !bJustPhysics)
{
CreateRenderMesh();
}

// Have we reached our physics threshold yet?
if(NumTrianglesInRange() > MAX_PHYSICS_TRIANGLES)
{
// Still too many triangles, need to split again.
int xIncrement = m_iMaxX/2;
int zIncrement = m_iMaxZ/2;
int newLevel = m_iLevel + 1;

// Create Children Nodes
for(int i = 0; i < 4; ++i)
{
char buffer[256] = {0};
sprintf(buffer, "Splicing, Creating more Children. New Level: %d\n",newLevel);
CLogger::GetInstance()->WriteToFile(buffer);

// Have we passed the rendering threshold yet?
if(NumTrianglesInRange() > MAX_RENDER_TRIANGLES)
m_pChildren[i] = new CQuadTree((i*xIncrement), (i*xIncrement + xIncrement),
(i*zIncrement), (i*zIncrement + zIncrement), newLevel, false);
else // Yup, only looking for Physics triangles now
m_pChildren[i] = new CQuadTree((i*xIncrement), (i*xIncrement + xIncrement),
(i*zIncrement), (i*zIncrement + zIncrement), newLevel, true);
}

return;

}
if(NumTrianglesInRange() < MAX_PHYSICS_TRIANGLES)
{
CreatePhysicsList();
}
}



Thoughts?

#9 TheAdmiral   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 24 August 2006 - 02:21 PM

Your problem seems to be on the theme of 'if (Level > 0) m_bIsLeaf = true'. This isn't the case - a leaf is a node of maximum depth, not just anything that isn't the root.

'NumTriangles = (MaxX - MinX) * (MaxZ - MinZ) * 2' is just fine.

Not accounting for your physics management (which should be similar anyway), a code structure you should have is:

int NumTriangles = (MaxX - MinX) * (MaxZ - MinZ) * 2;
if (NumTriangles > MAX_RENDER_TRIANGLES) {
// Split the plane into four
m_bIsLeaf = false;
int MidX = (MinX + MaxX) / 2;
m_pChildren[0] = new CQuadTree(MinX, MidX, MinZ, MidZ, m_iLevel + 1);
m_pChildren[1] = new CQuadTree(MidX, MaxX, MinZ, MidZ, m_iLevel + 1);
m_pChildren[2] = new CQuadTree(MinX, MidX, MidZ, MaxZ, m_iLevel + 1);
m_pChildren[3] = new CQuadTree(MidX, MaxX, MidZ, MaxZ, m_iLevel + 1);
} else {
// We are a leaf
m_bIsLeaf = true;
m_pMesh = ... // Create geometry between MinX, MaxX, MinZ, MaxZ
}


With this, you should have 4^n nodes with geometry in them (the deepest ones). Rendering the tree follows exactly the same structure:

void CQuadTree::Render() {
if (m_IsLeaf) {
m_pChildren[0].Render();
m_pChildren[1].Render();
m_pChildren[2].Render();
m_pChildren[2].Render();
} else {
if (this->Visible()) m_pMesh.Render();
}
}


Other than this, you have the right idea. Let us know if you run into any more trouble.

Regards
Admiral

#10 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 24 August 2006 - 02:33 PM

Thanks for the reply Admiral.

I'll try restructuring my code tomorrow and let you know how it goes, I'm not at my code right now.

Funny thing though, my rendering code is EXACTLY like the code you show above. So I guess I am on the right track.

#11 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 25 August 2006 - 03:54 AM

Well, my QuadTree structure looks complete. However, I'm not drawing any geometry, even when I force all leaf nodes to render(i.e. make everything visible).

Here is my code to create the Mesh, if I had to take a guess I would say the issue is somewhere in here.


void CQuadTree::CreateRenderMesh()
{
// Iterate through and find all the triangles within our range.
int triangleCount = 0;
vector<CHeightMap::terrainTriangle*>* pTriangles = CHeightMap::GetInstance()->GetTriangleList();

for(unsigned int i = 0; i < pTriangles->size(); ++i)
{
for (int k = 0; k < 3; ++k)
{
if(((*pTriangles)[i]->vertices[k].x >= m_iMinX) &&
((*pTriangles)[i]->vertices[k].x <= m_iMaxX) &&
((*pTriangles)[i]->vertices[k].z >= m_iMinZ) &&
((*pTriangles)[i]->vertices[k].z <= m_iMaxZ))
{
// One of the Triangles vertices is within range, add the entire triangle.
triangleCount++;
break;
}
}
}

char buffer[256] = {0};
sprintf(buffer, "Render Mesh Create called, NumTriangles %d\n", triangleCount);
CLogger::GetInstance()->WriteToFile(buffer);

// Make sure we found some Triangles.
if(triangleCount)
{
char buffer[256] = {0};
sprintf(buffer, "Creating Renderable Mesh. Triangle Count: %d\n",
triangleCount);

CLogger::GetInstance()->WriteToFile(buffer);

// Begin Creating the actual Mesh.
CHeightMap::terrainVertex* vertex;
D3DXCreateMeshFVF((triangleCount * 2),(triangleCount *3), D3DXMESH_MANAGED, D3DFVF_XYZ |D3DFVF_TEX1, CRenderer::GetInstance()->GetDevice(), &m_pMesh);

m_pMesh->LockVertexBuffer(0, (void**)&vertex);
int vertexIndex = 0;

for(unsigned int i = 0; i < pTriangles->size(); ++i)
{
for (int k = 0; k < 3; ++k)
{
if(((*pTriangles)[i]->vertices[k].x >= m_iMinX) &&
((*pTriangles)[i]->vertices[k].x <= m_iMaxX) &&
((*pTriangles)[i]->vertices[k].z >= m_iMinZ) &&
((*pTriangles)[i]->vertices[k].z <= m_iMaxZ))
{
// Triangle is in range, copy its vertices into our Vertex buffer.
vertex[vertexIndex] = (*pTriangles)[i]->vertices[0];
vertex[vertexIndex+1] = (*pTriangles)[i]->vertices[1];
vertex[vertexIndex+2] = (*pTriangles)[i]->vertices[2];

vertexIndex += 3;

break;
}
}
}
m_pMesh->UnlockVertexBuffer();

WORD* indexBuffer = 0;
m_pMesh->LockIndexBuffer(0, (void**)&indexBuffer);
for(int i = 0; i < (triangleCount * 3); i++)
{
indexBuffer[i] = i;
}
m_pMesh->UnlockIndexBuffer();

DWORD* attributeBuffer = 0;
m_pMesh->LockAttributeBuffer(0, &attributeBuffer);
for(int i = 0; i < triangleCount; i++)
{
attributeBuffer[i] = 0;
}
m_pMesh->UnlockAttributeBuffer();

std::vector<DWORD> adjacencyBuffer(m_pMesh->GetNumFaces() * 3);
m_pMesh->GenerateAdjacency(0.001f, &adjacencyBuffer[0]);
m_pMesh->OptimizeInplace(D3DXMESHOPT_IGNOREVERTS,
&adjacencyBuffer[0], NULL, NULL, NULL);

}
}






Thoughts?

EDIT:

Log file showing the QuadTree is structured correctly and does find Triangles for the mesh:


CQuadTree Constructor called. MinX: 0, MaxX: 504, MinZ: 0, MaxZ: 504, Level: 0
Splicing, Creating more Children. New Level: 0
CQuadTree Constructor called. MinX: 0, MaxX: 252, MinZ: 0, MaxZ: 252, Level: 1
Splicing, Creating more Children. New Level: 1
CQuadTree Constructor called. MinX: 0, MaxX: 126, MinZ: 0, MaxZ: 126, Level: 2
Render Mesh Create called, NumTriangles 496
Creating Renderable Mesh. Triangle Count: 496
CQuadTree Constructor called. MinX: 126, MaxX: 252, MinZ: 0, MaxZ: 126, Level: 2
Render Mesh Create called, NumTriangles 496
Creating Renderable Mesh. Triangle Count: 496
CQuadTree Constructor called. MinX: 0, MaxX: 126, MinZ: 126, MaxZ: 252, Level: 2
Render Mesh Create called, NumTriangles 512
Creating Renderable Mesh. Triangle Count: 512
CQuadTree Constructor called. MinX: 126, MaxX: 252, MinZ: 126, MaxZ: 252, Level: 2
Render Mesh Create called, NumTriangles 512
Creating Renderable Mesh. Triangle Count: 512
CQuadTree Constructor called. MinX: 252, MaxX: 504, MinZ: 0, MaxZ: 252, Level: 1
Splicing, Creating more Children. New Level: 1
CQuadTree Constructor called. MinX: 252, MaxX: 378, MinZ: 0, MaxZ: 126, Level: 2
Render Mesh Create called, NumTriangles 496
Creating Renderable Mesh. Triangle Count: 496
CQuadTree Constructor called. MinX: 378, MaxX: 504, MinZ: 0, MaxZ: 126, Level: 2
Render Mesh Create called, NumTriangles 465
Creating Renderable Mesh. Triangle Count: 465
CQuadTree Constructor called. MinX: 252, MaxX: 378, MinZ: 126, MaxZ: 252, Level: 2
Render Mesh Create called, NumTriangles 512
Creating Renderable Mesh. Triangle Count: 512
CQuadTree Constructor called. MinX: 378, MaxX: 504, MinZ: 126, MaxZ: 252, Level: 2
Render Mesh Create called, NumTriangles 480
Creating Renderable Mesh. Triangle Count: 480
CQuadTree Constructor called. MinX: 0, MaxX: 252, MinZ: 252, MaxZ: 504, Level: 1
Splicing, Creating more Children. New Level: 1
CQuadTree Constructor called. MinX: 0, MaxX: 126, MinZ: 252, MaxZ: 378, Level: 2
Render Mesh Create called, NumTriangles 512
Creating Renderable Mesh. Triangle Count: 512
CQuadTree Constructor called. MinX: 126, MaxX: 252, MinZ: 252, MaxZ: 378, Level: 2
Render Mesh Create called, NumTriangles 512
Creating Renderable Mesh. Triangle Count: 512
CQuadTree Constructor called. MinX: 0, MaxX: 126, MinZ: 378, MaxZ: 504, Level: 2
Render Mesh Create called, NumTriangles 496
Creating Renderable Mesh. Triangle Count: 496
CQuadTree Constructor called. MinX: 126, MaxX: 252, MinZ: 378, MaxZ: 504, Level: 2
Render Mesh Create called, NumTriangles 496
Creating Renderable Mesh. Triangle Count: 496
CQuadTree Constructor called. MinX: 252, MaxX: 504, MinZ: 252, MaxZ: 504, Level: 1
Splicing, Creating more Children. New Level: 1
CQuadTree Constructor called. MinX: 252, MaxX: 378, MinZ: 252, MaxZ: 378, Level: 2
Render Mesh Create called, NumTriangles 512
Creating Renderable Mesh. Triangle Count: 512
CQuadTree Constructor called. MinX: 378, MaxX: 504, MinZ: 252, MaxZ: 378, Level: 2
Render Mesh Create called, NumTriangles 480
Creating Renderable Mesh. Triangle Count: 480
CQuadTree Constructor called. MinX: 252, MaxX: 378, MinZ: 378, MaxZ: 504, Level: 2
Render Mesh Create called, NumTriangles 496
Creating Renderable Mesh. Triangle Count: 496
CQuadTree Constructor called. MinX: 378, MaxX: 504, MinZ: 378, MaxZ: 504, Level: 2
Render Mesh Create called, NumTriangles 465
Creating Renderable Mesh. Triangle Count: 465



#12 rgirard413   Members   -  Reputation: 133

Like
0Likes
Like

Posted 25 August 2006 - 09:24 AM

this isnt an answer to your question but i have to ask. Why are you looping through all the triangles twice? I would think you would just loop through them once and if they are in your bounding box, put them in this leaf and increment the triangle count. then if you have a triangle count, fill your vertex buffer. Maybe im wrong though?

#13 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 25 August 2006 - 09:41 AM

Quote:
Original post by rgirard413
this isnt an answer to your question but i have to ask. Why are you looping through all the triangles twice? I would think you would just loop through them once and if they are in your bounding box, put them in this leaf and increment the triangle count. then if you have a triangle count, fill your vertex buffer. Maybe im wrong though?


Yea, I'm not a fan of it either. The problem is I don't know for sure how many triangles each sector has, given that some triangles may be overlapping boundaries due to float-to-int truncation and such. I can't create my vertex buffer in my mesh without an exact number of vertices(to my knowledge), so I loop through once to get a count of all the vertices, create my vertex buffer, and finally loop through again to put the vertices in the vertex buffer. I don't keep a vector of triangles when I'm counting through, although that might be a good idea. I may change it to that once I get things rendering properly.


#14 TheAdmiral   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 25 August 2006 - 11:59 AM

There's something highly tautological about that two-pass geometry construction:

One way to create all the triangles between (MinX, MinZ)-(MaxX, MaxZ) is to cycle through all the triangles in the world, compiling a list of the ones in the specified range, then later iterate over your completed list. Another would be to simply create all the triangles in that range in the first place [wink].

The quadtree and its bounds are axis-aligned, so your patches are regular, orthogonal grids. You should create the geometry something like this:

// Vertex Buffer
int c = 0;
VERTEX *CurrentVertex = NULL;
for (int z = MinZ; z <= MaxZ; z++) {
for (int x = MinX; x <= MaxX; x++) {
CurrentVertex = &m_VertexBuffer[c++];
CurrentVertex.x = (float) x;
CurrentVertex.z = (float) z;
CurrentVertex.y = TerrainHeight(x, z);
}
}

// Index Buffer
c = 0;
int XRange = MaxX - MinX;
int ZRange = ZMax - ZMin;
for (int z = 0; z < ZRange - 1; z++) {
for (int x = 0; x < XRange - 1; x++) {
// Upper-left triangle
m_IndexBuffer[c++] = (float) (z+1) * XRange + (x+0);
m_IndexBuffer[c++] = (float) (z+0) * XRange + (x+1);
m_IndexBuffer[c++] = (float) (z+0) * XRange + (x+0);

// Lower-right triangle
m_IndexBuffer[c++] = (float) (z+1) * XRange + (x+1);
m_IndexBuffer[c++] = (float) (z+0) * XRange + (x+1);
m_IndexBuffer[c++] = (float) (z+1) * XRange + (x+0);
}
}



Assuming you're using an index buffer, you simply fill the VB sequentially with every vertex in your axis-aligned range, then fill the IB to connect the grid-points up into pairs of triangles accordingly. If you need varying texture coordinates at triangle junctions, there's no need for an index buffer and the triangle-building code will need to go in the VB construction routine.

I hope this clears things up a bit.
Admiral

Ps: That code hasn't been tested and is for, err, illustrative purposes only [smile].
Edit: I have assumed that your terrain is a regular grid. If not, then you'll need to do things more like you were originally.

#15 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 25 August 2006 - 04:32 PM

I went ahead and just created the vertices as you suggest, but I'm still not able to render anything. Even forcing all meshes in the tree to render(I put a break point at DrawSubset and it is being called) gives me nothing. I have a good camera class so I'm able to wander around the world and I see no sign of the geometry at all.

One problem, just out of no where, with creating the vertices on the fly, is I want a copy for physics calculations. But maybe I should just create a seperate tree entirely for that with a lower threshold that just doesnt ever create the ID3DXMesh structure.

I also think your above Index creation loop may be wrong, but I tried it my way and your way and got no results.

My way:

indexBuffer[baseIndex] = i * XWidth + j;
indexBuffer[baseIndex + 1] = i * XWidth + j + 1;
indexBuffer[baseIndex + 2] = (i + 1) * XWidth + j;
indexBuffer[baseIndex + 3] = (i + 1) *XWidth + j;
indexBuffer[baseIndex + 4] = i * XWidth + j + 1;
indexBuffer[baseIndex + 5] = (i + 1) * XWidth + j + 1;



#16 TheAdmiral   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 26 August 2006 - 02:13 PM

Our index orderings are more or less the same. You are just using your i & j the other way around (probably thrashing your CPU cache at the same time) and permuting the vertices in the triangles. Something to note is that your method creates the triangles with clockwise winding (viewed from above) whereas mine runs anticlockwise. If you are using backface culling, this is significant.

As for the invisibleness, have you checked all the usual problem areas? Clear the screen to a medium grey, Turn off lighting, culling (backface and quadtree) and disable alpha blending and the z-buffer. If you still get no results, trace through the routine that creates the geometry patches, paying particular attention to the lock and unlock calls. If they fail, you will get entirely unpredictable results. If you're still at a loss, turn your API debugging level up to the max and check the return value of each and every function call that has anything to do with your rendering.

Failing that, if you have a FPS counter, you can try rendeing the geometry several (say 100) times per frame and see if your framerate changes significantly. If so, vertices are being processed (at a minimum). If the framerate changes as you move your camera, some fillrate is being consumed (in which case you should have a look at your alpha settings).

Hopefully something here will help you solve the problem.

Regards
Admiral

#17 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 26 August 2006 - 02:24 PM

I'll try those things. I already have commands to turn off and on culling, lighting is disabled by default. I have a normal ID3DXMesh cube that I draw and it shows up fine, the landscape showed up fine before putting into the QuadTree so I know the heightmap is fine. Its gotta either be something with my actual mesh creation, or a setting like you suggested.

While I test out these other methods, do you see anything in the way I create my mesh that just stands out wrong? (The code source above should have my mesh creation code, it hasn't changed much. I'll edit this with the actual code in a second when I can get to my coding PC).

EDIT:


void CQuadTree::CreateRenderMesh()
{
int triangleCount = NumTrianglesInRange();
// Begin Creating the actual Mesh.*/
CHeightMap::terrainVertex* vertex;
D3DXCreateMeshFVF((triangleCount * 2),(triangleCount *3), D3DXMESH_MANAGED, D3DFVF_XYZ |D3DFVF_TEX1, CRenderer::GetInstance()->GetDevice(), &m_pMesh);

m_pMesh->LockVertexBuffer(0, (void**)&vertex);
int vertexIndex = 0;

int i = 0;
for(int z = m_iMinZ; z <= m_iMaxZ; z += CHeightMap::GetInstance()->GetSpacing())
{
int j = 0;

for(int x = m_iMinX; x <= m_iMaxX; x += CHeightMap::GetInstance()->GetSpacing())
{
int index = i * CHeightMap::GetInstance()->GetHeightMapWidth() + j;
int entryX = x / CHeightMap::GetInstance()->GetSpacing();
int entryZ = z / CHeightMap::GetInstance()->GetSpacing();

vertex[index] = CHeightMap::terrainVertex( (float)x, ((float)CHeightMap::GetInstance()->GetHeightMapEntry(entryX, entryZ) * CHeightMap::GetInstance()->GetScale()), (float)z,
0.0f, 0.0f);
j++;
}
i++;
}
m_pMesh->UnlockVertexBuffer();

WORD* indexBuffer = 0;
m_pMesh->LockIndexBuffer(0, (void**)&indexBuffer);
int baseIndex = 0;

int XWidth = m_iMaxX - m_iMinX / CHeightMap::GetInstance()->GetSpacing();
int ZWidth = m_iMaxZ - m_iMaxZ / CHeightMap::GetInstance()->GetSpacing();

for(int i = 0; i < ZWidth - 1; i++)
{
for(int j = 0; j < XWidth - 1; j++)
{

/*indexBuffer[baseIndex] = i * XWidth + j;
indexBuffer[baseIndex + 1] = i * XWidth + j + 1;
indexBuffer[baseIndex + 2] = (i + 1) * XWidth + j;
indexBuffer[baseIndex + 3] = (i + 1) *XWidth + j;
indexBuffer[baseIndex + 4] = i * XWidth + j + 1;
indexBuffer[baseIndex + 5] = (i + 1) * XWidth + j + 1;*/


indexBuffer[baseIndex] = (float) (i+1) * XWidth + (j+0);
indexBuffer[baseIndex + 1] = (float) (i+0) * XWidth + (j+1);
indexBuffer[baseIndex + 2] = (float) (i+0) * XWidth + (j+0);

// Lower-right triangle
indexBuffer[baseIndex + 3] = (float) (i+1) * XWidth + (j+1);
indexBuffer[baseIndex + 4] = (float) (i+0) * XWidth + (j+1);
indexBuffer[baseIndex + 5] = (float) (i+1) * XWidth + (j+0);


baseIndex += 6;

}
}
m_pMesh->UnlockIndexBuffer();

DWORD* attributeBuffer = 0;
m_pMesh->LockAttributeBuffer(0, &attributeBuffer);
for(int i = 0; i < triangleCount; i++)
{
attributeBuffer[i] = 0;
}
m_pMesh->UnlockAttributeBuffer();

std::vector<DWORD> adjacencyBuffer(m_pMesh->GetNumFaces() * 3);
m_pMesh->GenerateAdjacency(0.001f, &adjacencyBuffer[0]);
m_pMesh->OptimizeInplace(D3DXMESHOPT_IGNOREVERTS,
&adjacencyBuffer[0], NULL, NULL, NULL);


}



#18 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 27 August 2006 - 06:00 AM

So, I put in FAILED macros on all my ID3DXMesh functions, DrawSubset calls, and anything else D3D related. Nothing is failing. My framerate is constant with or without trying to force the QuadTree to render all nodes, so obviously nothing is being drawn.

Really stuck here.

#19 TheAdmiral   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 27 August 2006 - 08:25 AM

The routine looks fine, but it uses a lot of functions that mean nothing to us. Have you tried tracing through the for loops to ensure that the first iterations on each variable are creating the correct coordinates? Only you are in the position to do this as we can't verify the results of your GetHeightMapWidth, GetSpacing etc.

Just before your unlock calls, take a look at the memory dumps of the buffers you locked with. Check over each component, with your vertex struct at hand to be absolutely sure that the vertex & index data is spot on. If it is, then the problem must lie in the rendering process.

You have probably already done this, but of course you should comment out the vertex buffer optimisation calls while you're debugging. Also, I trust that you are also doing the Rendering fine, but you haven't showed us that function yet (DrawSubset(0), right?).

If you are still stumped, it may be worth throwing together a very basic vertex shader, simply so you can debug the vertex processing pipeline. If your vertex data is not getting to the card or is somehow getting corrupted, it will be apparent from inside your vertex shader routine.

Regards
Admiral

#20 ChaosPhoenix   Members   -  Reputation: 242

Like
0Likes
Like

Posted 28 August 2006 - 02:45 AM

I tried a few things and still am having a hard time figuring out the issue.

I went ahead and just RAR'd everything(its a very very small project, just a basic D3D window, camera, and currently 1 D3DXMesh cube being rendered), so if anyone has time to just glance over it, that would be amazing.

URL:
http://www.animehack.com/demos/Terrain%20Generator.rar (15Kb)

I'm going to continue playing with things and seeing what I find.

EDIT: Quick camera / debug control overview

W - Forward
S - Backwards
A - Left
D - Right
R - Up
F - Down
Q - Rotate CCW
E - Rotate CW

Mouse = Mouse look

F1 - Wireframe
F2 - Force all Quadtree nodes to render
F3 - Disable CCW Culling
F4 - Enable CCW Culling
F5 - QuadTree render based on Camera Position

Esc - Quit




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS