Strange behavior when firing cylinders in demo 1 and my app

trs79

28-08-2006 17:55:55

Hi,

I'm new to Newton and OgreNewt, but it seems great so far. However, I ran into some strange behavior. When I run demo 1 where you fire cylinders at a barrel by pressing the space bar, it works just fine if I don't strafe the camera left or right.

However, if I strafe the camera very far either left or right and then press space, the cylinder fires but stops right at my position, i.e. it doesn't fall at all. I have incorporated OgreNewt into one of my own apps and the cylinders won't fall at all, (they exhibit the same strange behavior as the demo). I really don't know what would cause this, it seems the cylinders should fall at any camera angle, position, etc. due to gravity. Any help would be greatly appreciated, thanks!

walaber

28-08-2006 19:00:35

you are outside the limits of the World. have a look at World::setSize(). this sets the overall size of the world. any bodies created outside these limits are ignored... that's what's happening in the demo.

trs79

28-08-2006 19:11:37

Thanks for the info and quick response. I don't know if my numbers are totally off or not but I tried this:

m_World->setWorldSize(Ogre::AxisAlignedBox(-5000,-5000,-5000,5000,5000,5000));

and still have the same problem. I also tried much larger numbers but to no avail. My camera is at:

cameraNode->setPosition( 0.0, -10.0, 20.0);

Are my numbers/units just totally screwed up?

Thanks.

trs79

29-08-2006 03:14:42

Ok, turns out I just needed to do a world->update call in my framestarted loop. I wasn't using the OgreNewt basic frame listener class so I hadn't noticed I needed a world update call.