OgreNewt Tutorial

Maroho

31-03-2010 12:53:05

I don't seem to be having much luck getting Ogre addons working, seems like I've got questions all over this forum. :?

I'm using this tutorial to learn how to integrate OgreNewt into my project, but after setting it all up I'm getting the error:

'OgreNewt::CollisionPrimitives::TreeCollision::TreeCollision' : no overloaded function takes 3 arguments

In this section of code:

OgreNewt::CollisionPtr col( new OgreNewt::CollisionPrimitives::TreeCollision( mWorld, ent,true,0));

There are actually more errors, but they're the same sort of thing for other shapes that are implemented, so I've removed all shapes but one. I believe fixing the above error will also fix the others when I put that code back in.

Now, the TreeCollision function it's talking about does take 5 parameters, as can be seen below, but I believe the last 2 parameters should be default if not set.

TreeCollision( const World* world, Ogre::Entity* ent, bool optimize, int id, FaceWinding fw = FW_DEFAULT );

Attempting to put the last 2 parameters in that code above gives me these 14 errors:


unresolved external symbol "public: __thiscall OgreNewt::World::World(float,int)" (??0World@OgreNewt@@QAE@MH@Z) referenced in function "public: __thiscall OgreNewtApplication::OgreNewtApplication(void)" (??0OgreNewtApplication@@QAE@XZ) OgreNewtApplication.obj

unresolved external symbol "public: __thiscall OgreNewt::World::~World(void)" (??1World@OgreNewt@@QAE@XZ) referenced in function "public: void * __thiscall OgreNewt::World::`scalar deleting destructor'(unsigned int)" (??_GWorld@OgreNewt@@QAEPAXI@Z) OgreNewtApplication.obj

unresolved external symbol "public: void __thiscall OgreNewt::Body::setStandardForceCallback(void)" (?setStandardForceCallback@Body@OgreNewt@@QAEXXZ) referenced in function "public: virtual void __thiscall OgreNewtApplication::createScene(void)" (?createScene@OgreNewtApplication@@UAEXXZ) OgreNewtApplication.obj

unresolved external symbol "public: void __thiscall OgreNewt::Body::setMassMatrix(float,class Ogre::Vector3 const &)" (?setMassMatrix@Body@OgreNewt@@QAEXMABVVector3@Ogre@@@Z) referenced in function "public: virtual void __thiscall OgreNewtApplication::createScene(void)" (?createScene@OgreNewtApplication@@UAEXXZ) OgreNewtApplication.obj

unresolved external symbol "public: __thiscall OgreNewt::CollisionPrimitives::Box::Box(class OgreNewt::World const *,class Ogre::Vector3 const &,int,class Ogre::Quaternion const &,class Ogre::Vector3 const &)" (??0Box@CollisionPrimitives@OgreNewt@@QAE@PBVWorld@2@ABVVector3@Ogre@@HABVQuaternion@5@1@Z) referenced in function "public: virtual void __thiscall OgreNewtApplication::createScene(void)" (?createScene@OgreNewtApplication@@UAEXXZ) OgreNewtApplication.obj

unresolved external symbol "public: void __thiscall OgreNewt::Body::setPositionOrientation(class Ogre::Vector3 const &,class Ogre::Quaternion const &,int)" (?setPositionOrientation@Body@OgreNewt@@QAEXABVVector3@Ogre@@ABVQuaternion@4@H@Z) referenced in function "public: virtual void __thiscall OgreNewtApplication::createScene(void)" (?createScene@OgreNewtApplication@@UAEXXZ) OgreNewtApplication.obj

unresolved external symbol "public: void __thiscall OgreNewt::Body::attachNode(class Ogre::Node *)" (?attachNode@Body@OgreNewt@@QAEXPAVNode@Ogre@@@Z) referenced in function "public: virtual void __thiscall OgreNewtApplication::createScene(void)" (?createScene@OgreNewtApplication@@UAEXXZ) OgreNewtApplication.obj

unresolved external symbol "public: __thiscall OgreNewt::Body::Body(class OgreNewt::World const *,class boost::shared_ptr<class OgreNewt::Collision> const &,int)" (??0Body@OgreNewt@@QAE@PBVWorld@1@ABV?$shared_ptr@VCollision@OgreNewt@@@boost@@H@Z) referenced in function "public: virtual void __thiscall OgreNewtApplication::createScene(void)" (?createScene@OgreNewtApplication@@UAEXXZ) OgreNewtApplication.obj

unresolved external symbol "public: __thiscall OgreNewt::CollisionPrimitives::TreeCollision::TreeCollision(class OgreNewt::World const *,class Ogre::Entity *,bool,int,enum OgreNewt::CollisionPrimitives::FaceWinding)" (??0TreeCollision@CollisionPrimitives@OgreNewt@@QAE@PBVWorld@2@PAVEntity@Ogre@@_NHW4FaceWinding@12@@Z) referenced in function "public: virtual void __thiscall OgreNewtApplication::createScene(void)" (?createScene@OgreNewtApplication@@UAEXXZ) OgreNewtApplication.obj

unresolved external symbol __imp__NewtonConvexCollisionCalculateInertialMatrix referenced in function "public: void __thiscall OgreNewt::ConvexCollision::calculateInertialMatrix(class Ogre::Vector3 &,class Ogre::Vector3 &)const " (?calculateInertialMatrix@ConvexCollision@OgreNewt@@QBEXAAVVector3@Ogre@@0@Z) OgreNewtApplication.obj

unresolved external symbol __imp__NewtonBodySetCentreOfMass referenced in function "public: void __thiscall OgreNewt::Body::setCenterOfMass(class Ogre::Vector3 const &)" (?setCenterOfMass@Body@OgreNewt@@QAEXABVVector3@Ogre@@@Z) OgreNewtApplication.obj

unresolved external symbol "public: __thiscall OgreNewt::BasicFrameListener::BasicFrameListener(class Ogre::RenderWindow *,class OgreNewt::World *,int)" (??0BasicFrameListener@OgreNewt@@QAE@PAVRenderWindow@Ogre@@PAVWorld@1@H@Z) referenced in function "public: virtual void __thiscall OgreNewtApplication::createFrameListener(void)" (?createFrameListener@OgreNewtApplication@@UAEXXZ) OgreNewtApplication.obj

unresolved external symbol "public: void __thiscall OgreNewt::Body::addLocalForce(class Ogre::Vector3 const &,class Ogre::Vector3 const &)" (?addLocalForce@Body@OgreNewt@@QAEXABVVector3@Ogre@@0@Z) referenced in function "public: void __thiscall OgreNewtApplication::crazyCallback(class OgreNewt::Body *,float,int)" (?crazyCallback@OgreNewtApplication@@QAEXPAVBody@OgreNewt@@MH@Z) OgreNewtApplication.obj

13 unresolved externals bin\Debug\PhysicsTest.exe


I'm using the required versions of Ogre, OgreNewt and Newton mentioned in the tutorial and I've also tested it with an older version of OgreNewt to see if that function ever only took 3 parameters, but no dice.

Any ideas?

blackskull

31-03-2010 21:02:32

Check your versions. I had the same kind of errors. I'm using OgreNewt 2.07.1 and Newton 2.18 with Ogre 1.6.5 and it works fine.

Yet I have another problem with the same tutorial. When I make the floor as a tree collision, the other objects does not interact with it. They just pass trough it. Well if I do it with Box collision primitive with the same size it's all fine.

Well how do I fix that so I can use tree collision in my scenes?

(:

kallaspriit

01-04-2010 15:50:05

Does the debug-display show your floor correctly?

Maroho

01-04-2010 16:02:29

Blackskull: I'm using the same versions of Ogre and Newton as you, but I think I'm using OgreNewt 2.0 (from here). Where can I get OgreNewt 2.07.1?

blackskull

02-04-2010 21:54:57

http://www.ogre3d.org/wiki/index.php/Og ... on_Project
On step for it is said how to get it...You'll have to use an SVN client. I think it's not downloadable directly...
(: