Hi,
more than a year ago I programmed a coin pusher prototype with OpenSceneGraph and Bullet. When I tried recompiling it against OSG 3.0.0 and the latest release bullet version, the thing suddenly failed. I get objects disappearing and OSG complaining about "nan" values as soon as I start dropping coins into the scene.
Number of colliding pairs: 58
CullVisitor::apply(Geode&) detected NaN,
depth=nan, center=(0 0 0),
matrix={
nan nan nan nan
nan nan nan nan
nan nan nan nan
nan nan nan nan
}
My coin pusher was originally based on the osgBullet sample posted on the OSG Wiki ( http://www.openscenegraph.org/projects/ ... /Tutorials ) which animates a rolling golf ball on a piece of lawn. I modified it to use flat cylindrical collision primitives ("coins") and introduced further collision primitives that push the coins around and to box them in. See it in action here: http://www.youtube.com/watch?v=0bLAq7btZbU
The commit which breaks everything for me has the following log message.
------------------------------------------------------------------------
r2380 | erwin.coumans | 2011-04-09 03:14:21 +0200 (Sa, 09. Apr 2011) | 4 lines
add FractureDemo to AllBulletDemos
improvements in CCD handling
some cleanup of CcdPhysicsDemo and BasicDemo
It would be interesting to see if that commit also breaks the original osgBullet demo.
Christian
Regression:SVN commit r2380 broke my coin pusher application
-
- Posts: 17
- Joined: Fri Apr 10, 2009 6:44 pm
-
- Posts: 17
- Joined: Fri Apr 10, 2009 6:44 pm
Re: Regression:SVN commit r2380 broke my coin pusher applica
It would appear that this piece of code returns OpenGL matrices with all nan's. What it is supposed to do is to get the OpenGL matrix for the osg governed objects and puts that information into the position transform of OpenSceneGraph.
Code: Select all
btScalar m[16];
btDefaultMotionState* myMotionState = (btDefaultMotionState*) _body->getMotionState();
myMotionState->m_graphicsWorldTrans.getOpenGLMatrix(m);
osg::Matrixf mat(m);
osg::PositionAttitudeTransform *pat = dynamic_cast<osg::PositionAttitudeTransform *> (node);
pat->setPosition(mat.getTrans());
pat->setAttitude(mat.getRotate());
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Regression:SVN commit r2380 broke my coin pusher applica
Not sure what could have broken this. Can you try initializing the graphics transform in the motionstate?
Please let us know if/when you find out what the problem is.
Thanks,
Erwin
Please let us know if/when you find out what the problem is.
Thanks,
Erwin