[fixed in trunk] getCollisonNode() fail in IMetaTriangleSel

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.
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Re: Collision bug? getCollisonNode() fail with IMetaTriangle

Post by Strong99 »

Here is a patch which fixes bug1 and 2. But it will still occur for many other collisionmethods
Patch

For example there is still a nested problem with the getCollisionResultPosition. If you look at the stack:
1. getCollisionResultPosition
2. collideEllipsoidWithWorld
3. collideWithWorld

Where 2 uses all the triangles to search for the triangle index returned from 3, which uses a box as filter. I can add the box filter for the getSceneNodeFromTriangle but the collision manager itself would still have the problem.

The filter used in the collisionmanager isn't only the ray or bounding box but it also requires the correct transformation for the box. That transforation is applied after setting the node's transformation in the TriangleSelectors. So to be sure to you get the correct triangle for the given index we should pass the exact same parameters like filter and transformation to the getSceneNodeFromTriangle methods.

Thus we should somehow pass these from 3. collideWithWorld to the 2. collideEllipsoidWithWorld and I'm not sure if thats the correct thing. This could be done through extending the SCollisionData structure with the boundingbox and the used transformation,

@Hybrid, any suggestions?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Collision bug? getCollisonNode() fail with IMetaTriangle

Post by hybrid »

I'm not really into this collision system, maybe CuteAlien can help better!?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Collision bug? getCollisonNode() fail with IMetaTriangle

Post by CuteAlien »

Sorry, that hope's in vain currently.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Collision bug? getCollisonNode() fail with IMetaTriangle

Post by CuteAlien »

Stuff got rewritten now (svn trunk r5350) and I hope it also fixed all those bugs. Basically in the past the indices of triangles returned got mixed up with indices used inside triangle-selectors - which couldn't work as those are not identical. But this couldn't easily be fixed with old interface, so won't be fixed for Irrlicht 1.8, but only Irrlicht 1.9
On the up-side a new feature got added while fixing this (meshbuffer selection).

edit: Fix had a bug. Fixed again in r5352 and another bug with box selectors in r5353.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply