OgreNewt and PLSM Raycast

baronvonarrow

19-08-2006 19:54:46

I'm currently working on implementing raycast vehicles with a PLSM landscape. I've used the built in Newton vehicle joints, but they are just too slow and the extra physical realism is butting heads with "fun" physical gameplay.

Anyway, I'm having an issue with OgreNewt raycasting and the PLSM integration. The rigid bodies interact with the terrain correctly, but OgreNewt raycasts don't intersect with the terrain at all. They intersect fine with the vehicle chassis and other physical objects (a large plane, for example). I'm using the wiki's setup for creating a tree collision from each paged landscape tile. Does anyone know why the raycasts might not be intersecting with the terrain, when the rigid bodies seem to be interacting with them correctly?

Note that this is not a world size issue, like most other problems!

Edit: Also, the Ogre ray scene queries work correctly, just not OgreNewt's.

walaber

19-08-2006 22:28:59

since the pages are TreeCollision objects... it should be working fine. are you using a custom RayCast class implementation, or the BasicRaycast class that comes with OgreNewt?

baronvonarrow

19-08-2006 22:57:05

The standard BasicRaycast. Again, it correctly detected collisions with the vehicle chassis itself, but if the ray was cast below the chassis (like it should be) it would consistently set the mDistance to -1.

walaber

20-08-2006 01:58:06

does getHitCount() return zero?

baronvonarrow

21-08-2006 18:54:50

Yeah, it's returning zero. Very strange indeed!

BergBoy

24-10-2006 09:42:22

I am getting this same issue. It doesnt happen in debug tho... just it happens in release. Every object EXCEPT the treecollision world is being able to be hit by a raytrace. Very odd... At least now I know its not my code *goes to investigate*

BergBoy

25-10-2006 23:54:55

for anyone who gets this issue, it appears I had some objects which were falling into the treecollision object and im assuming got stuck. Looks like for whatever reason, the raycsting wont work if this happens. Looking further into this so I can give a definative solution to anyone getting the same issue. I found this issue when I simply stopped all my guards rom having their collide boxes activated at world load. Only 2 of the 9 guards fell through the world and I have no idea why. Removing those gaurds has fixed the issue in my project. FOr those having the same problem, try freezing objects on world load and find which objects are breaking ur world. I will post again if i find a solution.