Objects don't collide

Jallen

02-02-2008 14:05:11

When doing this:

mOgreNewtListener = new OgreNewt::BasicFrameListener( mWindow, mgr, mWorld, 120 );
mRoot->addFrameListener( mOgreNewtListener );

I could not run without really strange errors. So i ended up doing this:

mWorld->update( 1.0f );

In my frame listener.

When running (Both using setStandardForceCallback();) both of my objects fall to the bottom of the world and stop there. However they do not collide with each other. Also, if i do not use setStandardForceCallback(); will other objects still collide with it?

dudeabot

04-02-2008 02:27:13

1) chances are your world size is small (-10000 to 10000) should be enough before tuning ;)

2) yes, standarforcecallback simulates gravity on your bodies, the simply fact of creating two bodies in the same world should give you 'instant collision behavior'(unless you ask not to behave like this in the collision callback, which is optional)

ps: world->update(1.0) seems frame rate independent, which may not be good, but probably someone else can clarufy it better :?

albino

04-02-2008 06:21:10

well if they fall down, everything seems to be working?
i wonder how the scene looks like
add a floor which the ball would fall on.

Jallen

04-02-2008 20:55:19

I did, and it doesn't collide with it. It goes straight through it...

walaber

07-02-2008 00:27:32

have you got the debug visualizer working, and confirmed that you actually have objects where you think that you have them?

viperman1271

07-02-2008 14:58:46

I have had this problem before. If you collision meshes intersect each other in any way when they are created (the physics meshes that is) then the objects will not collide. If you are using the OgreNewtFrameListener then you should already have access to visual debugging (I think the key is F3, don't completely remember though). Like walaber said, you should confirm with visual debugging that everything is actually where you think it is. Hope this helps

Jallen

07-02-2008 15:55:06

have you got the debug visualizer working, and confirmed that you actually have objects where you think that you have them?
The basic frame listener would not work.

viperman1271

07-02-2008 18:39:28

I had the same problem, and I couldn't resolve it. I think it has something to do with the way the predefined project generates the library files. I solved this problem by temporarily including the OgreNewt source files. I must warn you that there are many source files because of the boost library, meaning that rebuilding takes a while. Hope this helps.

walaber

08-02-2008 16:46:48

what is the problem with the basicframelistener?

what compiler / IDE are you using?

Jallen

08-02-2008 17:31:30

what is the problem with the basicframelistener?

what compiler / IDE are you using?

When adding the basic OgreNewt framelistener in the way shown in the tutorial, it would not even compile, saying that that the constructor only takes 4 arguments instead of the 5 shown in the tutorial. I cut it down to what intellisence told me to do, and then it just broke to a file called utility in my vc8 folder (from the creation of the listener).

I'm using VC++2005 Express.

Jallen

12-02-2008 22:18:29

Anyone know how to fix this? Ideally fixing the standard listener would be best, otherwise help me to get my objects to collide?

albino

13-02-2008 18:20:00

i am interested how you do it, i need a feature where 2 objects shoudlnt collide but can be dragged.

anyway, if the objects fall your physics are running well, theres a bug in the
collision shapes. want to post some code of where you setup collisions to bodies?