irado
31-10-2006 17:01:51
i am trying collide one people that move and the this people cross one house that are stop, the project compile without problem, but when i cross the house the people dont stop.
I'm not using:
ExampleFrameListener.h
ExampleApplication.h
ogrenewtonframelistener.h
I am using the BasicFrameLister the ogrenewt.
I see the demos the ogrenewt but i dont find one solution for this problem. What i can do for that when the people arrived in house the people stop, this collide???
the code is:
I'm not using:
ExampleFrameListener.h
ExampleApplication.h
ogrenewtonframelistener.h
I am using the BasicFrameLister the ogrenewt.
I see the demos the ogrenewt but i dont find one solution for this problem. What i can do for that when the people arrived in house the people stop, this collide???
the code is:
mOgreNewtListener = new OgreNewt::BasicFrameListener( a_window, a_scene_mgr, mWorld, 120 );
a_root->addFrameListener( mOgreNewtListener );
jogador = new Jogador(a_scene_mgr, "Ninja1", "mainCharacter.mesh", "NinjaNode");
jogador->nodeJog->setPosition(Vector3(30000,15,30000));
jogador->nodeJog->setScale( Vector3(30.0f,30.0f,30.0f) );
jogador->entJog->setMaterialName("mainBodyTexture");
jogador->entJog->setNormaliseNormals(true);
col = new OgreNewt::CollisionPrimitives::Cylinder( mWorld, 15, 300 );
jogbody = new OgreNewt::Body( mWorld, col);
jogbody->attachToNode( jogador->nodeJog );
jogbody->setPositionOrientation( jogador->nodeJog->getPosition(), Ogre::Quaternion::IDENTITY );
delete col;
Ogre::Vector3 dir, vec;
vec = Ogre::Vector3(0,0,1);
dir = jogador->nodeJog->getWorldOrientation() * vec;
jogbody->setVelocity( (dir * 200.0) );
Ogre::Real mass = 10.0;
Ogre::Vector3 inertia = OgreNewt::MomentOfInertia::CalcBoxSolid( mass, jogador->nodeJog->getScale() );
jogbody->setMassMatrix( mass, inertia );
jogbody->setStandardForceCallback();
//adiciona e configura a casa
Entity *ent3 = a_scene_mgr->createEntity("Casa", "tudorhouse.mesh");
SceneNode *node3 = a_scene_mgr->getRootSceneNode()->createChildSceneNode("CasaNode");
node3->attachObject(ent3);
node3->yaw((Ogre::Radian)-90);
node3->setPosition(Vector3(31000,550,31000));
ent3->setNormaliseNormals(true);
col = new OgreNewt::CollisionPrimitives::Box( mWorld, Vector3(30,300,30) );
casabody = new OgreNewt::Body( mWorld, col);
casabody->attachToNode( node3 );
casabody->setPositionOrientation( node3->getPosition(), Ogre::Quaternion::IDENTITY );
casabody->setStandardForceCallback();
delete col;