I find another mistake

SusanDing

13-06-2006 13:40:50

Look at this code
OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::Box( m_World, size );
OgreNewt::Body* bod = new OgreNewt::Body( m_World, col );
delete col;


We usually use OgreNewt like this, But I find there is a mistake!
After delete the collsion,
bod->getCollision()
will not return the correct collision,so If anyone need to know the Collision from the body, he will be disappointed.

I know in Newton, we can do like this ,but in OgreNewt, we can't. :?

And Thanks a lot walaber for your hard working! I like OgreNewt very much! Hope it will be better and better!

walaber

13-06-2006 16:09:49

that is not an error. it is just they way it works. if you need to access the Collision later, you should not delete it. if you will never need it again, you can safely delete it.

SusanDing

14-06-2006 03:05:39

Thanks a lot!
I have fixed my program! :oops: