dudeabot
01-02-2008 03:54:36
here is my problem
http://img409.imageshack.us/img409/6672/ragbodyen1.jpg
1) ok, quite a stupid question, but how do i lower the node on the body?
heres is my initialization code
2) also how i stop it from rotating, when the player collide against him (just want to push him away, do i have to change the shape?)
http://img409.imageshack.us/img409/6672/ragbodyen1.jpg
1) ok, quite a stupid question, but how do i lower the node on the body?
heres is my initialization code
OgreNewt::Collision* ncol;
//ncol = new OgreNewt::CollisionPrimitives::ConvexHull(mWorld,mRagNode);
ncol=new OgreNewt::CollisionPrimitives::Ellipsoid( mWorld, Vector3(1.8,1.8,1.8) ); // create a collision for the body
ncol->calculateInertialMatrix(inertia, offset);
ragBody = new OgreNewt::Body( mWorld, ncol );
delete ncol;
ragBody->setMassMatrix( mass, inertia*mass );
//comment for ellipsoid
ragBody->setCenterOfMass( offset );
ragBody->setStandardForceCallback();
ragBody->attachToNode( mRagNode );
ragBody->setPositionOrientation(mRagNode->getPosition(),mRagNode->getOrientation());
ragBody->setType(Poli3D::BT_ENEMY);
ragBody->setUserData(this);
ragBody->setMaterialGroupID(ragBodyMat);
OgreNewt::BasicJoints::UpVector* uv = new OgreNewt::BasicJoints::UpVector(mWorld,ragBody,Vector3::UNIT_Y);
2) also how i stop it from rotating, when the player collide against him (just want to push him away, do i have to change the shape?)