Well, this is embarrassing ... Apparently, the problem lies with ntdll.dll.
My code is this:
Code:
void OgreApp1::createScene(void)
{
SimpleVolume<MaterialDensityPair44> volData(PolyVox::Region(Vector3DInt32(0,0,0),Vector3DInt32(63,63,63)));
createSphereInVolume(volData, 20);
//createCubeInVolume(volData,30);
SurfaceMesh<PositionMaterialNormal> mesh;
CubicSurfaceExtractorWithNormals<SimpleVolume, MaterialDensityPair44> surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
surfaceExtractor.execute();
Ogre::ManualObject* test;
test = mSceneMgr->createManualObject("Surface");
test->setDynamic(true);
test->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST);
{
const std::vector<uint32_t>& vecIndices = mesh.getIndices();
const std::vector<PolyVox::PositionMaterialNormal>& vecVertices = mesh.getVertices();
for (std::vector<PolyVox::PositionMaterialNormal>::const_iterator itVertex = vecVertices.begin(); itVertex != vecVertices.end(); ++itVertex)
{
const PolyVox::PositionMaterialNormal& vertex = *itVertex;
const PolyVox::Vector3DFloat& vertPos = vertex.getPosition();
test->position(vertPos.getX(), vertPos.getY(), vertPos.getZ());
test->normal(vertex.getNormal().getX(), vertex.getNormal().getY(), vertex.getNormal().getZ());
}
for (std::vector<uint32_t>::const_iterator itIdx = vecIndices.begin(); itIdx != vecIndices.end(); ++itIdx)
{
test->index(*itIdx);
}
}
test->end();
Ogre::SceneNode* testNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
testNode->attachObject(test);
std::list<Vector3DInt32> listResult;
AStarPathfinderParams<SimpleVolume, MaterialDensityPair44> params(&volData, Vector3DInt32(0,0,0), Vector3DInt32(63,63,63), &listResult);
AStarPathfinder<SimpleVolume, MaterialDensityPair44> Astar(params);
Astar.execute();
}
The app compiles with no problem, but it crashes on runtime without any errors (not responding). When in debug mode, the dll above keeps popping up:
ntdll.dll!77b215de()
Does that mean anything?
When viewing the disassembly, VS2010 points to this line:
77B215DE add esp,4
Also, I am using the 11.dec.2011 snapshot of PolyVox. Could it be that that version had some kind of bug or instability issue when using the AStarPathfinder?
Then again ... maybe my OS has gone haywire. I'm using Windows 7 (64bit).
If I can provide any other info that could prove helpful, please let me know. Also, has anyone had any experience with other AI libraries that worked with PolyVox and Ogre3D?
Thank you for all your help.