Oh I just pasted that code in the scene collision and I am running it
I am reading this comment
/**
* This scene demonstrates a bug in newton that disables
* the collision between static scene node collisions and other rigid bodies or rays.
* The reason for this seems to be that when the node collision is translated outside
* the AABB of the compound scene collision the AABB of the compound is not updated
* and thus the node collision is ignored.
* Use 'F' and 'G' to toggle node collision positions and drag a box onto the node collision.
* Another potential problem for developers is that node collision pointers cannot be cached
* and this is not written anywhere in the documentation.
*/
this is what I see
when I hit key F I see the big part of the scene disappear, and if I touch any of the small box the fall through the map.
I expect thi Is the correct behavior
if I hi the G key then the map is restored and the collision is normal again, I also expect this behavior
you say that the bug happen when it is pace outside the AABB hwo do I do that in the test?
also you say the node are no cache, but the are. the node you get when you call NewtonSceneCollisionGetNodeByIndex never change unless you delete the node.
node are unique to their owner.
you may be trying to get a node from one scene collision instance and then use then on a copy that result from the creation of another compound.
when you create a body and you pass a collision shape, the collision in the body is a copy of the one pass in, If the passed in is a scene collision, all the children nodes will no map to the children node of the l original
can you explain me how do I make the bug happen? maybe a video
I looked at the part
- Code: Select all
if (scene->GetRootWindow()->GetKeyState ('F'))
{
// NOTE: if we translate the collision outside of the scene collision tree initial
// AABB the collision won't be tracked by newton
matrix.m_posit[0] = (maxX-minX);
// this even happens if half of the collision is still inside the aabb
// then only one half will collide
// uncomment the following line to test it
// matrix.m_posit[0] = (maxX-minX)*0.5f;
}
else if (scene->GetRootWindow()->GetKeyState ('G'))
{
// return to spawn origin
}
but it does no seem to do the translation, I am confused as to how to make it happen.