[nobug]getSceneNodeFromRayBB and Terrain

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
MickeyKnox
Posts: 58
Joined: Tue Apr 10, 2007 7:49 pm
Location: Karlsruhe

[nobug]getSceneNodeFromRayBB and Terrain

Post by MickeyKnox »

When a ray collides with Terrain, the SceneNode given back by ISceneCollisionManager::getSceneNodeFromRayBB
seems not to return the TerrainSceneNode: its ID is always -1, no matter what value i
assign to the Terrain as its ID.

I printed out the memory address of the SceneNode, which didn't match the
memory address of the Terrain. Even more strange, that address changed when doing
collision testing severall times, even on the very same position.

Also the type of the returned SceneNode is not ESNT_TERRAIN.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

What parameters are you passing to the getSceneNodeFromBB call and what is the scene node id that you're using?

Travis
MickeyKnox
Posts: 58
Joined: Tue Apr 10, 2007 7:49 pm
Location: Karlsruhe

Post by MickeyKnox »

The parameter to getSceneNodeFromRayBB is only the ray, the ID i assigned to the Terrain is 1000.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

If you provide a simple test case demonstrating this problem it'll speed up the process of getting it fixed.

Thank you
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
MickeyKnox
Posts: 58
Joined: Tue Apr 10, 2007 7:49 pm
Location: Karlsruhe

Post by MickeyKnox »

Allright, i'll do that tomorrow.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

If I had to guess, I'd say that the camera is being selected. For this to work correctly, you need to set the camera id so that it doesn't match the selection mask. Setting it to zero will do the trick.

You could verify this behavior by displaying the type of the scene node that is actually selected.

Travis
MickeyKnox
Posts: 58
Joined: Tue Apr 10, 2007 7:49 pm
Location: Karlsruhe

Post by MickeyKnox »

I made a simple test case, that did not reproduce the bug i thought i discovered.

Yesterday, when i stumbled over this problem, i just printed out the type of the returned
SceneNode, which was a funny big number. I suspected it just wasn't initialized.

Today i had a closer look at the type enum and discovered, that these types are indeed
created in a funny way. I did cast the type to u8* and printed it out. (By the way, is there a
better way doing this?)

Well, the returned SceneNode is a Billboard, which actually makes sense. My bad.
Sorry for bothering in the Bug reports forum... :oops:

What i still don't get is way this only happends, when i hit the terrain. When i hit another
player (a MeshSceneNode), the returned SceneNode is that player, not the billboard.
Post Reply