Why am I seeing this assertion error during Collada DOM loading?

  • Why am I seeing this assertion error during Collada DOM loading? EddieV223

    D3DXMATRIX ColladaFileLoader::processMatrix(daeElement* node)
    D3DXMATRIX matWorld;
    daeTArray<daeElementRef> nodeChildren = node->getChildren();
    for (int i = 0; i < nodeChildren.getCount(); i++)
        string type = nodeChildren[i]->getAttribute("sid");
        if (type == "rotationX")
            string data = nodeChildren[i]->getCharData();
            stringstream stm(data);
            stm >> matWorld.m[0][0];
            stm >> matWorld.m[0][1];
            stm >> matWorld.m[0][2];
            stm >> matWorld.m[0][3];
        if (type == "rotationY")
            string data = nodeChildren[i]->getCharData();
            stringstream stm(data);
            stm >> matWorld.m[1][0];
            stm >> matWorld.m[1][1];
            stm >> matWorld.m[1][2];
            stm >> matWorld.m[1][3];
        if (type == "rotationZ")
            string data = nodeChildren[i]->getCharData();
            stringstream stm(data);
            stm >> matWorld.m[2][0];
            stm >> matWorld.m[2][1];
            stm >> matWorld.m[2][2];
            stm >> matWorld.m[2][3];
        if (type == "location")
            string data = nodeChildren[i]->getCharData();
            stringstream stm(data);
            stm >> matWorld.m[3][0];
            stm >> matWorld.m[3][1];
            stm >> matWorld.m[3][2];
            matWorld.m[3][3] = 1;
    return matWorld;

    This function will run run debug assertion failed after it ends the first pass through the loop. The loop will run correctly, it will enter the last if statement and set all values correctly. However when the pass is done and before it starts the next pass it will debug assertion failed on me. I think it is trying to destroy the string type variable but something is breaking when it does tries to delete it. I don't know what the problem is. It seems to do this on other parts of my program that get strings from the file and place in std::string. I fixed those by just removing those entirely but this one cannot be removed it needs to exist.

    Don't know if this has anything to do with it, but I'm using visual studio 11 dev preview, and using compiler vs100 (vs10's compiler) settings.

    dbgheap.c Line:1322

    Expression: _CrtISValidHeapPointer(pUserData)

    also when i use debugger none of my vars from this function show up after the error.

  • You can use assert(_CrtCheckMemory()); to check the whole heap for corruption.

    By adding lots of those tests you should be able to narrow down the line of code that causes the corruption.

  • Is node null (or otherwise invalid)?

    Are you sure getCharData doesn't modify the object it's called on?

  • Ok found the problem after nearly a week of beating my head against the wall, for others who may have run into this issue in the future I'll post the solution.

    The version of colladaDOM I used was compiled with /mDd library (multi-threaded debug dll) while my project was using /mtd (multi threaded debug static) settings. After changing my project to /MDd all my problems vanished.

    Another possible solution would be to rebuild DOM with /mtd to match the project settings.

c++ directx collada
Related questions and answers
  • collided with are deleted. However I am having trouble getting the INITIAL COLLISION with the wall to be detected correctly. the result is the playe incorrectly losing 4 lives after hitting 1 wall... in the main function * not Finally.. but i believe that te numb_coll problem has something to do with the time and framrate. When running full speed i quickly die upon entering a wall as numb_coll... theScreen("ascreen"); string splashScreen[24] = { // HERE"S THE SPLASH ! // 1 2 3 4 5 6 7 8

  • )Point[0], (float)Point[1], (float)Point[2])); // set rotation btVector3 EulerRotation; QuaternionToEuler(TObject-&gt;getOrientation(), EulerRotation); node-&gt;setOrientation(1,(Ogre::Real)EulerRotation[0], (Ogre::Real)EulerRotation[1], (Ogre::Real)EulerRotation[2]); //node-&gt;rotate(Ogre::Vector3(EulerRotation[0], EulerRotation[1], EulerRotation[2])); } } void GameState... = TObject-&gt;getCenterOfMassPosition(); node-&gt;setPosition(Ogre::Vector3((float)Point[0], (float)Point[1], (float)Point[2])); // Convert the bullet Quaternion to an Ogre quaternion

  • I am quite new to OpenGL, I have managed after long trial and error to integrate Nehe's Cel-Shading rendering with my Model loaders, and have them drawn using the Toon shade and outline..., In); // Get The Current Line ( NEW ) shaderData[i][0] = shaderData[i][1] = shaderData[i][2] = float(atof (Line)); // Copy Over The Value ( NEW ) } fclose... float frac = (time - (float)(frameIndex1 - startFrame) / (float)(endFrame - startFrame + 1)) * (endFrame - startFrame + 1); // I ADDED THESE FROM NEHE'S TUTORIAL FOR FIRST PASS

  • (highlander house) 1 directional light If I reload the scene and look again at the house the assertion fires and it is very strange. I have tried to debug the code and the only reason for the assertion to fire that I have found is the hash being changed after the node was inserted on the map. Any ideas how can I find a solution to it? Which data and information I can provide to help debug this? Also I...I started playing around with terrain and I am getting this assertion in QueuedRenderableCollection::addRenderable: "Error inserting new pass entry into PassGroupRenderableMap" I am trying to find

  • (); }; #endif If I call Init() from game.cpp, the code works fine, if I call cube->init(), just as this function is entered (not when the other one is left), the device pointer suddenly has an address...); UINT offset = 0; device-&gt;IASetVertexBuffers(0, 1, &pBuffer, &stride, &offset); device-&gt;IASetIndexBuffer(iBuffer, DXGI_FORMAT_R32_UINT, 0); D3DXMATRIX matRotate, matView... memcpy(pVoid, OurVertices, sizeof(OurVertices)); // copy the vertices to the buffer pBuffer-&gt;Unmap(); // create the index buffer out of DWORDs DWORD OurIndices[] = { 0, 1, 2, // side 1

  • #0 0xb6dc563d in std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) () from /usr/lib/libstdc++.so.6 #1 0xb73bb3c2 in std...; &gt;::_M_insert_(std::_Rb_tree_node_base const*, std::_Rb_tree_node_base const*, Ogre::Node* const&) () from /usr/local/lib/libOgreMain.so.1.7.1 #2 0xb73b5a52 in _M_insert_unique... a crash. Here is the source code for the main class : https://github.com/balazsbela/OgreVisualizer/blob/master/src/VisualizerApplication.cpp#L221 Also the crashes seem to happen less often when I

  • I'm rendering to a depth map in order to use it as a shader resource view, but when I sample the depth map in my shader, the red component has a value of 1 while all other channels have a value of 0...; #if defined(DEBUG) || defined(_DEBUG) deviceFlags |= D3D11_CREATE_DEVICE_DEBUG | D3D11_RLDO_DETAIL; #endif This is how I create my depth map. I've omitted error checking for the sake of brevity... stencil are set on the output merger, and I'm using the depth map shader resource view as a texture in my shader, but the depth value in the red channel is constantly 1. I'm not getting any runtime

  • a = 0; a < (int)groups.size(); a++) { if(groups[a].type == "prop") { //Code for rotation glPopMatrix(); glPushMatrix(); float x,y,z; x = y = z = 0; int...(vertices[vertexIndex].Dimensions[_x], vertices[vertexIndex].Dimensions[_y], vertices[vertexIndex].Dimensions[_z]); } glEnd(); } } glPopMatrix(); glfwSwapBuffers(); Since I don't know the exact centre of the propeller, that's what the for loop before the rotation is for. It finds the average of the y and z co-ordinates. After I find it, I translate to -y,-z , rotate

  • the console, but cannot run the actual game. Here is what I did: Downloaded the source code from the game repo Downloaded and installed the DirectX SDK Purchased, downloaded and installed Doom 3 from... installation path. This is the default command line arguments used to run the project from vstudio. +set fs_basepath "C:\Program Files (x86)\Steam\steamapps\common\doom 3" +set com_allowConsole 1 +set si... initialization... WARNING: idChoiceWindow::InitVars: gui 'guis/mainmenu.gui' window 'SNDBPrimary' references undefined cvar 's_driver' 1 warnings Type 'help' for dedicated server info. I don't know

Data information