BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
igrok
Gnoblar
Posts: 3
Joined: Sat Feb 07, 2009 6:41 am
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (9.2.9)

Post by igrok »

I've noticed that the Bullet demos use various colored lines to denote behavior when debug draw is on. For instance, colliding objects are colored differently than objects at rest. Additionally, each object's X, Y and Z axes are drawn with R, G and B. The current debug drawing in BtOgre makes everything white.

I've attached a patch which uses an Ogre ManualObject to draw the colored lines. It seems to work great and is a bit simpler than the custom object currently in BtOgre. The patch also includes quite a few whitespace fixes my editor made (sorry || you're welcome).

Hope it helps!
Attachments
debug_draw.zip
(6.43 KiB) Downloaded 361 times
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

BtOgre now has it's own git repository, at:-
BtOgre github Repository

If you don't really want to use git, you can also easily get an archive (zip/tarball) by clicking 'download' on that page.
ripper9100
Gnoblar
Posts: 4
Joined: Sun Jan 18, 2009 9:23 am

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by ripper9100 »

Hi,

How do you use BtOgre in order to set up the physics for an object that has a set of animations?
Maggot
Gnoblar
Posts: 3
Joined: Wed Mar 25, 2009 1:20 pm

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by Maggot »

What libraries do you need to include in the BtOgreTest project for it to compile? Getting linker errors, I tried including some bullet library, OgreMain.lib and OIS.lib
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

Maggot wrote:What libraries do you need to include in the BtOgreTest project for it to compile? Getting linker errors, I tried including some bullet library, OgreMain.lib and OIS.lib
What are the linker errors you get?

There's a premake.lua file you can use with premake for easy setup, but read the premake.lua file's comments first for what you have to do.
Maggot
Gnoblar
Posts: 3
Joined: Wed Mar 25, 2009 1:20 pm

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by Maggot »

Gives this with OgreMain.lib and OIS.lib included:

Code: Select all

------ Build started: Project: BtOgreTest, Configuration: Release Win32 ------
Compiling...
main.cpp
Linking...
BtOgre.obj : error LNK2019: unresolved external symbol "void * __cdecl btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal@@YAPAXIH@Z) referenced in function "public: static void * __cdecl btConvexShape::operator new(unsigned int)" (??2btConvexShape@@SAPAXI@Z)
main.obj : error LNK2001: unresolved external symbol "void * __cdecl btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal@@YAPAXIH@Z)
BtOgre.obj : error LNK2019: unresolved external symbol "void __cdecl btAlignedFreeInternal(void *)" (?btAlignedFreeInternal@@YAXPAX@Z) referenced in function "public: static void __cdecl btConvexShape::operator delete(void *)" (??3btConvexShape@@SAXPAX@Z)
main.obj : error LNK2001: unresolved external symbol "void __cdecl btAlignedFreeInternal(void *)" (?btAlignedFreeInternal@@YAXPAX@Z)
BtOgre.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall btConvexShape::~btConvexShape(void)" (??1btConvexShape@@UAE@XZ) referenced in function "public: virtual __thiscall btConvexInternalShape::~btConvexInternalShape(void)" (??1btConvexInternalShape@@UAE@XZ)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAM@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBEMXZ)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(void)const " (?getContactBreakingThreshold@btCollisionShape@@UBEMXZ)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::setLocalScaling(class btVector3 const &)" (?setLocalScaling@btConvexInternalShape@@UAEXABVbtVector3@@@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual class btVector3 __thiscall btConvexInternalShape::localGetSupportingVertex(class btVector3 const &)const " (?localGetSupportingVertex@btConvexInternalShape@@UBE?AVbtVector3@@ABV2@@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::getAabbSlow(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabbSlow@btConvexInternalShape@@UBEXABVbtTransform@@AAVbtVector3@@1@Z)
BtOgre.obj : error LNK2019: unresolved external symbol "protected: __thiscall btConvexInternalShape::btConvexInternalShape(void)" (??0btConvexInternalShape@@IAE@XZ) referenced in function "public: __thiscall btSphereShape::btSphereShape(float)" (??0btSphereShape@@QAE@M@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btSphereShape::getAabb(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabb@btSphereShape@@UBEXABVbtTransform@@AAVbtVector3@@1@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btSphereShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btSphereShape@@UBEXMAAVbtVector3@@@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual class btVector3 __thiscall btSphereShape::localGetSupportingVertex(class btVector3 const &)const " (?localGetSupportingVertex@btSphereShape@@UBE?AVbtVector3@@ABV2@@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual class btVector3 __thiscall btSphereShape::localGetSupportingVertexWithoutMargin(class btVector3 const &)const " (?localGetSupportingVertexWithoutMargin@btSphereShape@@UBE?AVbtVector3@@ABV2@@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(class btVector3 const *,class btVector3 *,int)const " (?batchedUnitVectorGetSupportingVertexWithoutMargin@btSphereShape@@UBEXPBVbtVector3@@PAV2@H@Z)
BtOgre.obj : error LNK2019: unresolved external symbol "public: __thiscall btConvexHullShape::btConvexHullShape(float const *,int,int)" (??0btConvexHullShape@@QAE@PBMHH@Z) referenced in function "public: class btConvexHullShape * __thiscall BtOgre::VertexIndexToShape::createConvex(void)" (?createConvex@VertexIndexToShape@BtOgre@@QAEPAVbtConvexHullShape@@XZ)
BtOgre.obj : error LNK2019: unresolved external symbol "public: __thiscall btBvhTriangleMeshShape::btBvhTriangleMeshShape(class btStridingMeshInterface *,bool,bool)" (??0btBvhTriangleMeshShape@@QAE@PAVbtStridingMeshInterface@@_N1@Z) referenced in function "public: class btBvhTriangleMeshShape * __thiscall BtOgre::VertexIndexToShape::createTrimesh(void)" (?createTrimesh@VertexIndexToShape@BtOgre@@QAEPAVbtBvhTriangleMeshShape@@XZ)
BtOgre.obj : error LNK2019: unresolved external symbol "public: void __thiscall btTriangleMesh::addTriangle(class btVector3 const &,class btVector3 const &,class btVector3 const &,bool)" (?addTriangle@btTriangleMesh@@QAEXABVbtVector3@@00_N@Z) referenced in function "public: class btBvhTriangleMeshShape * __thiscall BtOgre::VertexIndexToShape::createTrimesh(void)" (?createTrimesh@VertexIndexToShape@BtOgre@@QAEPAVbtBvhTriangleMeshShape@@XZ)
BtOgre.obj : error LNK2019: unresolved external symbol "public: __thiscall btTriangleMesh::btTriangleMesh(bool,bool)" (??0btTriangleMesh@@QAE@_N0@Z) referenced in function "public: class btBvhTriangleMeshShape * __thiscall BtOgre::VertexIndexToShape::createTrimesh(void)" (?createTrimesh@VertexIndexToShape@BtOgre@@QAEPAVbtBvhTriangleMeshShape@@XZ)
BtOgre.obj : error LNK2019: unresolved external symbol "public: __thiscall btPolyhedralConvexShape::btPolyhedralConvexShape(void)" (??0btPolyhedralConvexShape@@QAE@XZ) referenced in function "public: __thiscall btBoxShape::btBoxShape(class btVector3 const &)" (??0btBoxShape@@QAE@ABVbtVector3@@@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::getAabb(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabb@btBoxShape@@UBEXABVbtTransform@@AAVbtVector3@@1@Z)
BtOgre.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btBoxShape@@UBEXMAAVbtVector3@@@Z)
BtOgre.obj : error LNK2019: unresolved external symbol "public: __thiscall btCylinderShapeX::btCylinderShapeX(class btVector3 const &)" (??0btCylinderShapeX@@QAE@ABVbtVector3@@@Z) referenced in function "public: class btCylinderShape * __thiscall BtOgre::VertexIndexToShape::createCylinder(void)" (?createCylinder@VertexIndexToShape@BtOgre@@QAEPAVbtCylinderShape@@XZ)
main.obj : error LNK2019: unresolved external symbol "public: __thiscall btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(class btDispatcher *,class btBroadphaseInterface *,class btConstraintSolver *,class btCollisionConfiguration *)" (??0btDiscreteDynamicsWorld@@QAE@PAVbtDispatcher@@PAVbtBroadphaseInterface@@PAVbtConstraintSolver@@PAVbtCollisionConfiguration@@@Z) referenced in function "public: __thiscall BtOgreTestApplication::BtOgreTestApplication(void)" (??0BtOgreTestApplication@@QAE@XZ)
main.obj : error LNK2019: unresolved external symbol "public: __thiscall btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver(void)" (??0btSequentialImpulseConstraintSolver@@QAE@XZ) referenced in function "public: __thiscall BtOgreTestApplication::BtOgreTestApplication(void)" (??0BtOgreTestApplication@@QAE@XZ)
main.obj : error LNK2019: unresolved external symbol "public: __thiscall btCollisionDispatcher::btCollisionDispatcher(class btCollisionConfiguration *)" (??0btCollisionDispatcher@@QAE@PAVbtCollisionConfiguration@@@Z) referenced in function "public: __thiscall BtOgreTestApplication::BtOgreTestApplication(void)" (??0BtOgreTestApplication@@QAE@XZ)
main.obj : error LNK2019: unresolved external symbol "public: __thiscall btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(struct btDefaultCollisionConstructionInfo const &)" (??0btDefaultCollisionConfiguration@@QAE@ABUbtDefaultCollisionConstructionInfo@@@Z) referenced in function "public: __thiscall BtOgreTestApplication::BtOgreTestApplication(void)" (??0BtOgreTestApplication@@QAE@XZ)
main.obj : error LNK2019: unresolved external symbol "public: __thiscall btAxisSweep3::btAxisSweep3(class btVector3 const &,class btVector3 const &,unsigned short,class btOverlappingPairCache *,bool)" (??0btAxisSweep3@@QAE@ABVbtVector3@@0GPAVbtOverlappingPairCache@@_N@Z) referenced in function "public: __thiscall BtOgreTestApplication::BtOgreTestApplication(void)" (??0BtOgreTestApplication@@QAE@XZ)
main.obj : error LNK2019: unresolved external symbol "public: __thiscall btRigidBody::btRigidBody(float,class btMotionState *,class btCollisionShape *,class btVector3 const &)" (??0btRigidBody@@QAE@MPAVbtMotionState@@PAVbtCollisionShape@@ABVbtVector3@@@Z) referenced in function "protected: virtual void __thiscall BtOgreTestApplication::createScene(void)" (?createScene@BtOgreTestApplication@@MAEXXZ)
MSVCRT.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
bin/release/BtOgreTest.exe : fatal error LNK1120: 30 unresolved externals
Build log was saved at "file://c:\Program Files\Git\cmd\btogre\demo\obj\release\BuildLog.htm"
BtOgreTest - 33 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I made a new project with premake and added the paths libraries and links like there was told to in the comments but I still get the same linker errors
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

There are no problems with Ogre or OIS there. Are you sure you added all the Bullet libaries, in the right order? There are 3 Bullet libraries you have to link too (bulletdynamics, bulletcollision, bulletmath).

EDIT: It seems I forgot to mention the Bullet libraries in the premake.lua comments, it's updated now on git.
Maggot
Gnoblar
Posts: 3
Joined: Wed Mar 25, 2009 1:20 pm

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by Maggot »

Tried it in this order: OgreMain.lib OIS.lib libbulletdynamics.lib libbulletcollision.lib libbulletmath.lib

Still gives this kind of a linker error, what is the order the libraries have to be in if thats wrong?

Code: Select all

------ Build started: Project: BtOgreTest, Configuration: Release Win32 ------
Compiling...
main.cpp
BtOgre.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\utility(57) : warning C4244: 'initializing' : conversion from 'const unsigned short' to 'const unsigned char', possible loss of data
        ..\BtOgre.cpp(147) : see reference to function template instantiation 'std::pair<_Ty1,_Ty2>::pair<unsigned short,BtOgre::Vector3Array*>(const std::pair<unsigned short,_Ty2> &)' being compiled
        with
        [
            _Ty1=const unsigned char,
            _Ty2=std::vector<Ogre::Vector3> *
        ]
Generating Code...
Linking...
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
MSVCRT.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
bin/release/BtOgreTest.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\btogre\demo\obj\release\BuildLog.htm"
BtOgreTest - 2 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

Seems to be a main/WinMain problem.
LunarEffect
Gnoblar
Posts: 10
Joined: Sat Apr 11, 2009 5:18 am

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by LunarEffect »

Thank you Nikki, this is amazing, I love it! Exactly what I was looking for! =D

The only thing that is missing as far as I can see is the adaption of the scale of the SceneNode. I'll try and implement that this afternoon! =)
f00bar
Halfling
Posts: 57
Joined: Sun Feb 15, 2009 4:00 am
x 1

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by f00bar »

@nikki
thanks a lot for your awesome work.

@Maggot
I had to add the following to premake.lua:
package.buildflags = { "no-main" }
package.kind = "winexe"


I have 2 little problems:
1) I have a player, that has the origin at his feet. Now the box shape is centered at his feet. I'm not sure if I understand the class RigidBodyState correctly: getWorldTransform does not return the data that is set with setWorldTransform? Is this an error (missed to set mTransform in setWorldTransform?)? I don't understand the intended purpose of mTransform. I will now change the class such that mTransform is used as offset between graphics and physics representation. What should the transformation you pass to RigidBodyState do? Should createBox create it at the correct location?
[edit]
now I see, mTransform is just the initial position. Is it? I now added the new parameter for the offset, works fine.

2) I use ngf (thanks again). I use the following code in the constructor of class LevelGeometry. But in the first level of the tutorial, the physic body of the tower is on the wrong location (in the middle of the terrain). And in the second level, the physics representation of the terrain is offset too (it's in the air), and the towers are on a wrong location too. Has anybody an idea, what I do wrong?

Code: Select all

		//Create shape.
		BtOgre::StaticMeshToShapeConverter converter(mEntity);
		mShape = converter.createTrimesh();
		//Calculate inertia.
		btScalar mass = 0;
		btVector3 inertia;
	    //Create MotionState (no need for BtOgre here, you can use it if you want to though).
	    btDefaultMotionState* groundState = new btDefaultMotionState(btTransform(btQuaternion(0,0,0,1),btVector3(0,0,0)));
	    //Create the Body.
	    mBody = new btRigidBody(0, groundState, mShape, btVector3(0,0,0));
		Globals::phyWorld->addRigidBody(mBody);
Attachments
ngf bullet problem
ngf bullet problem
ngf_problem1.JPG (172.97 KiB) Viewed 8707 times
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

f00bar wrote:@nikki
thanks a lot for your awesome work.
You're welcome. ;)
f00bar wrote:2) I use ngf (thanks again). I use the following code in the constructor of class LevelGeometry. But in the first level of the tutorial, the physic body of the tower is on the wrong location (in the middle of the terrain). And in the second level, the physics representation of the terrain is offset too (it's in the air), and the towers are on a wrong location too. Has anybody an idea, what I do wrong?

Code: Select all

		//Create shape.
		BtOgre::StaticMeshToShapeConverter converter(mEntity);
		mShape = converter.createTrimesh();
		//Calculate inertia.
		btScalar mass = 0;
		btVector3 inertia;
	    //Create MotionState (no need for BtOgre here, you can use it if you want to though).
	    btDefaultMotionState* groundState = new btDefaultMotionState(btTransform(btQuaternion(0,0,0,1),btVector3(0,0,0)));
	    //Create the Body.
	    mBody = new btRigidBody(0, groundState, mShape, btVector3(0,0,0));
		Globals::phyWorld->addRigidBody(mBody);
Here, you have to make a choice. Do you want to use BtOgre's MotionState, or btDefaultMotionState? I chose not to use BtOgre's MotionState in the demo because trimeshes don't move anyway, and updating the position of a Node there is redundant. Either way, you're forgetting to pass in the initial position of the object. Do the MotionState creation this way, if you want to use btDefaultMotionState:-

Code: Select all

//'pos' and 'rot' are the Vector3 and Quaternion constructor parameters.
btDefaultMotionState* state = new btDefaultMotionState(btTransform(BtOgre::Convert::toBullet(rot),BtOgre::Convert::toBullet(pos)));
Or for BtOgre's MotionState:-

Code: Select all

//'mNode' is our SceneNode.
BtOgre::RigidBodyState *state = new BtOgre::RigidBodyState(mNode);
f00bar
Halfling
Posts: 57
Joined: Sun Feb 15, 2009 4:00 am
x 1

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by f00bar »

Thanks a lot. No idea what I was thinking...
Heizer
Gnoblar
Posts: 8
Joined: Sat May 02, 2009 10:05 am
Location: Ruhrpott, Germany
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by Heizer »

Hello,

I have a similar problem. I want to create rigid body based on a mesh, which is not alligned to orgin.
The way over the SceneNode does not work, because the Position is allways Vector3::ZERO. Only the mesh
has a offset defined by the mesh itselfs.

When I passed the transform vector, the bounding box is alligned to the grafic, but the mass calculation
is not.

RigidBodyState(const btTransform& startTrans, Ogre::SceneNode &Node);
vs
btDefaultMotionState(const btTransform& startTrans,const btTransform& centerOfMassOffset)

It seems to me, that the centerOfMassOffset is not supported in btOgre.
Maybe I miss something and there is a other way to setup a rigid body with the respect that it is
not alligned to orgin ?

Some help would be nice.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

Ok, seems I hadn't added any support for offset in the BtOgre motion state. I've added it now on git, try it, tell me if it works (I'm bad at math :roll: ).
Heizer
Gnoblar
Posts: 8
Joined: Sat May 02, 2009 10:05 am
Location: Ruhrpott, Germany
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by Heizer »

Thanks for your fast response.

Your fix does exactly that what expected. :D
I try it with my car model and my wheels moving now in the right direction.

Adapting bullet to ogre caused also some problems to me, because you can not take the right coordinates from the 3d model and build the physic system.
Its required to translate all points to the orgin alligned system from bullet. :roll:
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

What? I'm surprised it worked! I actually made a silly error trying to modify a const value (I didn't test the code before uploading). :?

Anyway, I fixed that error now. New update on git.
Heizer
Gnoblar
Posts: 8
Joined: Sat May 02, 2009 10:05 am
Location: Ruhrpott, Germany
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by Heizer »

Sorry, changed only the required lines in my code without thinking over compiler errors. :oops:
I have include only the required thinks in my project, because Im not sure, if bullet is the right choise for me.

I will include the whole packet later, when I got the basic physics ( hinged suspension ) working.
Many thanks for your work.
Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 1005
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 49
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by Crashy »

Hi everybody :)

I'm using btOgre for my project, everything is fine.
But(there is always a but), I need to force position and orientation of my collisions in my game editor. When doing that, the physic simulation is not running of course, to avoid possible problems. The main issue is that I cannot find a way to do this correctly.
I tried to change the world transform of my RigidBodyState, but using debug draw, it seems to have totally no effect.

Any tip?
Thanks
Follow la Moustache on Twitter or on Facebook
Image
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

btRigidBody::setWorldTransform() should work.
Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 1005
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 49
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by Crashy »

Yup thanks, I've found the btRigidBody::getCenterOfMassTransform() and setCenterOfMassTransform() functions.
Follow la Moustache on Twitter or on Facebook
Image
bulareanuadrian
Gnoblar
Posts: 15
Joined: Tue Jan 06, 2009 11:00 pm
Location: Baicoi && Brasov
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by bulareanuadrian »

Hi,

When I run my test it gives me segmentation fault and i notice that the problem is here
fizica->getWorld()->stepSimulation(evt.timeSinceLastFrame, 10);
if I change params to 0 the test works(ofcourse without physics). I use ubuntu 64 9.04. Please help.
Lumea nu crede in puterea programelor open source.
The world do not believe in power of open sources programs.

Sorry for my bad english.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

bulareanuadrian wrote:Hi,

When I run my test it gives me segmentation fault and i notice that the problem is here
fizica->getWorld()->stepSimulation(evt.timeSinceLastFrame, 10);
if I change params to 0 the test works(ofcourse without physics). I use ubuntu 64 9.04. Please help.
Try stepping into the function using your debuuger and seeing what exactly the problem is.
bulareanuadrian
Gnoblar
Posts: 15
Joined: Tue Jan 06, 2009 11:00 pm
Location: Baicoi && Brasov
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by bulareanuadrian »

I tried to debug the code but it blocks my computer. I copiled the demo and works fine then i have copied the code from demo to my test and i have the same error "Segment fault".
Lumea nu crede in puterea programelor open source.
The world do not believe in power of open sources programs.

Sorry for my bad english.
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)

Post by nikki »

bulareanuadrian wrote:I tried to debug the code but it blocks my computer. I copiled the demo and works fine then i have copied the code from demo to my test and i have the same error "Segment fault".
Well, I don't know enough about your program to be able to help you. 'Segment fault' is a memory error, check your pointers. Make sure the physics world etc. are properly constructed before using them.
Post Reply