Princess_Conecloon
11-01-2007 19:10:40
I've been working on getting OgreNewt to work with PLSM and everything seemed to be working for a short time until I started getting a series of crashes. Viewing the collision mesh with the OgreNewt debugger, I have found that some tile collision meshes are upside down while, seemingly random ones, are right side up. How would I go about checking where the collision mesh is pointing? Also, would looking at a TreeCollision mesh through debugger showLines that is not pointing toward the camera during the frame cause it to crash? That is what I am basing this on, since I can go to part of the mesh and view it from above and below, but the ones I view from below I can not view from above becuase it crashes. I have looked through the forums and tried many different searches, some came up with the following fix:
That fix overturns all of the tiles, instead of the ones that are in the wrong direction. If I am wrong about the showLines not being able to view upside down collision meshes, is there anything else that could be causing this?
Crashes happen at two points:
using the showLine
creating a BasicRaycast
Both appear only to happen when the collision mesh is pointing downwards. Any help would be appreciated. Thanks
EDIT:
Been looking at the code and have put it through a random series of tests. The raycast crashes have occuted at the following 'endpts':
The start points are the same x,z with the y varying.
As far as I can tell, they seem random, since I can pass the same point during the next run without a crash. All raycast errors seem to point to these lines in OgreNewt_Raycast.cpp:
EDIT 2:
The RayCast Error is in
Which is inside OgreNewt_RayCast.cpp This line leads into Newton itself and I cannot find the source code or think that it is available which means I am stuck. What could cause a crash with a call to NewtonWorldRayCast. I have looked on the Newton forums, but I am sure it has to do with PLSM geometry somehow. Anyone have any ideas?
//invert vertex winding (otherwise, raycasting won't work???)
poly_verts[0] = vertices[*curIndex]; curIndex++;
poly_verts[1] = vertices[*curIndex]; curIndex++;
poly_verts[2] = vertices[*curIndex]; curIndex++;
That fix overturns all of the tiles, instead of the ones that are in the wrong direction. If I am wrong about the showLines not being able to view upside down collision meshes, is there anything else that could be causing this?
Crashes happen at two points:
using the showLine
creating a BasicRaycast
Both appear only to happen when the collision mesh is pointing downwards. Any help would be appreciated. Thanks
EDIT:
Been looking at the code and have put it through a random series of tests. The raycast crashes have occuted at the following 'endpts':
23:41:20: Init the Ray. (-207.869,-8000,-4923.97)
23:42:46: Init the Ray. (0.255164,-8000,4015.84)
23:44:25: Init the Ray. (29703.8,-8000,1235.08)
23:49:12: Init the Ray. (88.2088,-8000,1102.01)
23:50:14: Init the Ray. (-367.063,-8000,5681.23)
00:05:51: Init the Ray. (25041.2,-8000,-6917.84)
00:06:59: Init the Ray. (-204.935,-8000,5571.87)
The start points are the same x,z with the y varying.
As far as I can tell, they seem random, since I can pass the same point during the next run without a crash. All raycast errors seem to point to these lines in OgreNewt_Raycast.cpp:
if (me->userPreFilterCallback( bod ))
return 1;
else
return 0;
EDIT 2:
The RayCast Error is in
NewtonWorldRayCast( world->getNewtonWorld(), (float*)&startpt, (float*)&endpt, OgreNewt::Raycast::newtonRaycastFilter, this, OgreNewt::Raycast::newtonRaycastPreFilter );
Which is inside OgreNewt_RayCast.cpp This line leads into Newton itself and I cannot find the source code or think that it is available which means I am stuck. What could cause a crash with a call to NewtonWorldRayCast. I have looked on the Newton forums, but I am sure it has to do with PLSM geometry somehow. Anyone have any ideas?