Strange memory access violation
BlitzMax Forums/BlitzMax Programming/Strange memory access violation
| ||
I cant see what I'm doing wrong here, I'm using Irrlicht and PhysX.Global cloth_mesh:IAnimatedMesh=Null cloth_mesh = smgr.getMesh("pol.b3d") cloth_node = smgr.addAnimatedMeshSceneNode(cloth_mesh) Global cloth_body = CreateClothSpecial(cloth_mesh) pxClothAttachVertexToPos (cloth_body, 399, -10,30,10) pxClothAttachVertexToPos (cloth_body, 440, 9,30,10) Function CreateClothSpecial(cloth_mesh:IAnimatedMesh) Local entity:IMesh = cloth_mesh.getmesh(0) Local surf:IMeshBuffer = entity.getMeshBuffer(1) Local nvert% = surf.getVertexCount() 'HERE Local nface% = surf.getIndexCount()/3 'HERE It points to either of the two above where I've marked 'HERE, if I swap them around it'll point to the top one. The file path is correct. |
| ||
If it happens on either line, it's probably the line above where you return the MeshBuffer. It's probably returning in invalid pointer and then the next line writes to memory it doesn't have access too. I don't use Irrlicht or PhysX though, so more than that, I can't say. |
| ||
make sure this loaded something cloth_mesh = smgr.getMesh("pol.b3d") i.e. If cloth_mesh = Null then end |
| ||
Thanks, I'll have a look into it, it's just I have other code which is similar yet it works, I'm hoping it's not a physics problem. H&K Yes I did double check that. |
| ||
not sure if this is still up in the air but getMeshBuffer() is zero based so to get the first one use 0 instead of 1. |