a half year ago I wrote a new class for "raycasting to polygon level". (See code and comments)
Now I embedded this code for the vehicle and sensor simulation topic of my diploma thesis.
In general it works fine, but sometimes (e.g. after one minute of many queries) it causes a crash.
It happens while reading the content of a vertex element.
More specific: It happens while reading data from a ManualObject, without indices and the rendering OperationType is a triangle.
This works fine for more than hundred times (with the same ManuaObject).
Here is the C# code where it happens:
Code: Select all
VertexElement posEl = moData.vertexData.vertexDeclaration.FindElementBySemantic(VertexElementSemantic.VES_POSITION);
HardwareVertexBufferSharedPtr vBuff = moData.vertexData.vertexBufferBinding.GetBuffer(posEl.Source);
byte* pVertex = (byte*)vBuff.Lock(HardwareBuffer.LockOptions.HBL_READ_ONLY); // <-- CRASH HERE
Code: Select all
void* HardwareBuffer::Lock( Mogre::HardwareBuffer::LockOptions options )
{
return static_cast<Ogre::HardwareBuffer*>(_native)->lock( (Ogre::HardwareBuffer::LockOptions)options ); // CRASH
}
The Ogre log file has no error or warning.
For me it looks like a problem with LOCK() to the HardWareBuffer.
Is there any idea what could be the reason or what I can do?
Ogre problem?
Hardware problem?
Currently my application still uses Ogre 1.6.5 (with the Glue of the Mogre wrapper).
Is there a real chance to solve the problem, when I update it to Ogre 1.7?
(Ogre 1.8 is still not available for C#.)
Would it be useful to compile/embedd debug libraries of Ogre/Mogre for deeper debugging?
Most of the time for my diploma thesis (university) is gone. The problem is realy disturbing my simulations.
I would be happy about suggestions ...