AtlasActivationHeightfield cahf?
by Justin Mosiman · in Torque Game Engine Advanced · 04/19/2007 (10:01 pm) · 3 replies
Hello,
I am working on pathfinding with Atlas, and I am trying to figure out exactly how Atlas works. I started at the beginning, with generateChunkFileFromRaw16 from atlasGen.cpp. In atlasGen.cpp there is the following code on line 927:
What is cahf? I did a grep for cahf in the engine directory of TGEA but all it could find was references to cahf, not an actual definition.
Thanks,
Justin
I am working on pathfinding with Atlas, and I am trying to figure out exactly how Atlas works. I started at the beginning, with generateChunkFileFromRaw16 from atlasGen.cpp. In atlasGen.cpp there is the following code on line 927:
AtlasActivationHeightfield cahf(getBinLog2(size), squareSize, vertScale);
What is cahf? I did a grep for cahf in the engine directory of TGEA but all it could find was references to cahf, not an actual definition.
Thanks,
Justin
Torque 3D Owner Mary Westmacott
Actually, the code you quoted is the definition of cahf, as an object of type AtlasActivationHeightfield. But be careful because AtlasGen.cpp and all those other files in the Atlas directory are pre- MS3.5. The Atlas processing code you want to look at, the code currently being used is in the Atlas\editor directory, and the current version of the Atlas\AtlasGen.cpp file would then be Atlas\editor\AtlasOldGenerator.cpp. You'll notice that in that file cahf is defined as an object of type AtlasOldActivationHeightfield. The AtlasOldActivationHeightfield class is defined then in Atlas\editor\AtlasOldGenerator.h
As what it is.... there is the doxygen comments:
/// Adds activation level tracking functionality for AtlasOldHeightfield.
///
/// Activation levels are part of our BTT-based mesh decimation system. So if we
/// end up using a different/better mesh decimation algorithm, we can simply go
/// back to using AHFs.
///
Now I don't understand all of that, but it sounds like AtlasOldActivationHeightfield is an array to keep track of which vertices in the terrain height map that are being thrown away to simplify the mesh. Fewer vertices means faster loading and faster drawing.
That only my guess. Hope that helps
Atlas2 terrain for Boulder Colorado showing the terrain both textured (right side) and in wireframe (left side).
This illustrates how the Atlas terrain mesh is simplified in areas of constant slope.