strange behaviour

voom

22-04-2010 13:25:27

hi,
the if statement if(mEntity->getMesh()->sharedVertexData) seems to be true although it shouldnt. why? as a result addStaticVertexData fails.

thanks

Fish

22-04-2010 15:02:49

It seems to be working fine here with MSVC8 using a debug build and Ogre 1.7. Are you sure the entity coming into the addEntity method is completely valid?
Are you able to step into the addStacticVertex method and verify that the incoming vertex_data is indeed 0? You didn't mention how it fails, is an exception thrown? Does windows throw a protection fault when it tries to use the 'VertexData *data' in the addStacticVertex method, if so does windows tell you an "access violation at 0x00000000 or is it some other memory location?

You might try a clean build and verify that you are linking the correct libraries into the test application.

- Fish

voom

22-04-2010 18:44:28

hi,

sorry my description wasnt that detailed. i'm using MSVC8 too. and i think the entity should be valid. i use the normal cube.mesh from the media directory and then use OgreBulletCollisions::StaticMeshToShapeConverter(cube_entity) just for testing.
yes i am able to step into addstaticvertexdata. there vertex_data isnt 0, but data->vertexDeclaration is, so data->vertexDeclaration->findElementBySemantic(Ogre::VES_POSITION);
fails with "unhandled exeption at 0x00d39c6f in test.exe: 0xc0000005: excess violation at 0x00000000".

Fish

22-04-2010 19:49:11

If you comment out the use of OgreBullet in your Test code do you see a cube? Also, check the ogre.log to make sure there are no errors when you create the entity. Are you building in Release mode with Debug Symbols? If so you may want to rebuild in debug mode and step through your code from the time the entity is created and into staticMeshToShapeConverter().

I'm guessing that the entity is not valid, but it's hard to tell.

-Fish