pekanino
10-04-2008 23:18:03
Hey all!
First of all I would like to thank betajaen for the wonderful work he is doing with NxOgre, everyday this keeps getting better!
Second I would like to apologize for the questions I am posting not being related to Bleeding edition...
Here they go...
I'm trying to make a ball stick to a wall when it collides with it by creating a fixed joint when some key is pressed and there is a collision. The thing I would like to do is to have the ball stuck as long as I keep the key pressed so I have a bool that tells if that key is still pressed and control the joint life cycle using that bool. This way when I release the key I delete the joint.
The first thing I tried was removing the joint through the scene using scene->releaseJoint() but when I close the game it crashes when deleting the world.
I went a little deeper and found out that the joint destructor calls the releasejoint method in the scene and so I tried simply deleting the joint reference. Same crash.
I then checked the world variable and to my surprise the scene joints vector had one entry (the joint I had created but all messed up). I searched for the releaseJoint code and my guess is that although the joint is deleted it isn't removed from the container which is causing the program to crash when deleting world. I changed the code to remove the entry from the container and then got the same crash on the world descructor but I really can't tell what's happening now...
Has anyone had similar problems? Will this go away if I start using bleeding? I believe I have the version that got released before it...
I ended up commenting the call to world's destructor and found out another strange behavior in the fixed joints. When i hit space if the ball is touching a cube I create a fixed joint between them. I have another ball attached to the ball stuck in the cube which I pull away to check if the ball stuck in the cube is really stuck or if it moves. The thing is the behavior is different if I change the call to the creation of the fixed joint.
If I call
scene->createFixedJoint(ball,cube)
I can see the ball is stuck to the cube but it can move a little bit which is quite annoying and not the effect I was looking for.
However if I call
scene->createFixedJoint(cube,ball)
It works like a charm!
Shouldn't both calls produce the exact same result?
Sorry for the size of the post and for not using the latest version of NxOgre yet
Any help would be appreciated... I thank you in advance
First of all I would like to thank betajaen for the wonderful work he is doing with NxOgre, everyday this keeps getting better!
Second I would like to apologize for the questions I am posting not being related to Bleeding edition...
Here they go...
I'm trying to make a ball stick to a wall when it collides with it by creating a fixed joint when some key is pressed and there is a collision. The thing I would like to do is to have the ball stuck as long as I keep the key pressed so I have a bool that tells if that key is still pressed and control the joint life cycle using that bool. This way when I release the key I delete the joint.
The first thing I tried was removing the joint through the scene using scene->releaseJoint() but when I close the game it crashes when deleting the world.
I went a little deeper and found out that the joint destructor calls the releasejoint method in the scene and so I tried simply deleting the joint reference. Same crash.
I then checked the world variable and to my surprise the scene joints vector had one entry (the joint I had created but all messed up). I searched for the releaseJoint code and my guess is that although the joint is deleted it isn't removed from the container which is causing the program to crash when deleting world. I changed the code to remove the entry from the container and then got the same crash on the world descructor but I really can't tell what's happening now...
Has anyone had similar problems? Will this go away if I start using bleeding? I believe I have the version that got released before it...
I ended up commenting the call to world's destructor and found out another strange behavior in the fixed joints. When i hit space if the ball is touching a cube I create a fixed joint between them. I have another ball attached to the ball stuck in the cube which I pull away to check if the ball stuck in the cube is really stuck or if it moves. The thing is the behavior is different if I change the call to the creation of the fixed joint.
If I call
scene->createFixedJoint(ball,cube)
I can see the ball is stuck to the cube but it can move a little bit which is quite annoying and not the effect I was looking for.
However if I call
scene->createFixedJoint(cube,ball)
It works like a charm!
Shouldn't both calls produce the exact same result?
Sorry for the size of the post and for not using the latest version of NxOgre yet
Any help would be appreciated... I thank you in advance