Maximum Height for a Body [SOLVED]

dreadwulgaru

29-01-2009 02:29:09

I have searched around the forums and have not found anything like my problem. I am creating spheres with a mouse click at a certain point and height. For some reason, when I made the height above 101, the ball did not drop. However, for a height of 101 and below, there is no problem. Here is my code:


Vector3 vec = Vector3(15,101,15); // works
//Vector3 vec = Vector3(15,102,15); // doesn't work
tempNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("BallNode" + StringConverter::toString(numBalls),vec); // create node at 15,101,15
tempEntity = mSceneMgr->createEntity("BallMesh" + StringConverter::toString(numBalls),SceneManager::PT_SPHERE); // create ball
tempNode->setScale(.075,.075,.075); // scale
tempNode->attachObject(tempEntity); // attach

OgreNewt::CollisionPrimitives::Capsule *ball = new OgreNewt::CollisionPrimitives::Capsule(mWorld,1.5,1.5); // create a 'capsule' with radius = height (sphere)
OgreNewt::Body *bod = new OgreNewt::Body(mWorld,ball); // create body using ball
bod->attachToNode(tempNode); // attach
bod->setMassMatrix(20,OgreNewt::MomentOfInertia::CalcSphereSolid(20,1.5)); // set mass
bod->setStandardForceCallback(); // gravity
bod->setPositionOrientation(vec,Quaternion::IDENTITY); // set position to 15,101,15

numBalls++; // increment number of balls

mLeftMDown = false; // left mouse button has no longer just been clicked


Thanks for the help!

nullsquared

29-01-2009 02:45:26

Set the world size to something bigger.

dreadwulgaru

29-01-2009 02:51:55

Ah. Yeah, that did it. Thanks :)