Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: Sat Sep 30, 2006 3:27 am 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
Update Bullet 2.11:
* more demos have been converted to use btDynamicsWorld
* more consistent memory strategy (who creates things needs to delete them)
* removed Extras/PhysicsInterface folder

Code:
btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld()
{
   //only delete it when we created it
   if (m_ownsIslandManager)
      delete m_islandManager;
   if (m_ownsConstraintSolver)
       delete m_constraintSolver;
}


Thanks for the help, pointing out memory issues, more feedback is welcome!
Erwin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 05, 2006 4:06 pm 
Offline

Joined: Fri Mar 31, 2006 7:13 pm
Posts: 90
What is now with MyMotionState (PHY_IMotionState) is there equivalent for it?
It was really handily to use.

Do Bullet 2.12 support kinematic objects?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 05, 2006 4:52 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
DevO wrote:
What is now with MyMotionState (PHY_IMotionState) is there equivalent for it?
It was really handily to use.

Do Bullet 2.12 support kinematic objects?


There is no replacement at the moment for *MotionState. I consider adding it in Bullet 2.13, together with some logic so it only updates 'active' objects (and not the sleeping/deactivated ones).

There is no replacement for kinematic support yet either (it was in CcdPhysicsEnvironment). You can track the request here:
http://code.google.com/p/bullet/issues/list

Thanks for the feedback,
Erwin


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 15, 2006 6:36 pm 
Offline
User avatar

Joined: Sun Aug 13, 2006 4:41 pm
Posts: 127
Location: Cedar Hill, Texas
There are a bunch of global variables exported by src/BulletDynamics/Dynamics/btRigidBody.h :

Code:
  extern float gLinearAirDamping;
  extern bool gUseEpa;

  extern float gDeactivationTime;
  extern bool gDisableDeactivation;
  extern float gLinearSleepingTreshold;
  extern float gAngularSleepingTreshold;


It's not good to export globals from the API, especially since they don't conform to the 'btXXXX' naming scheme. At least one of the demo's uses them (CcdPhysicsDemo sets gDisableDeactivation) - so if they are reallyimportant, they should probably be rolled into one or other of the main Bullet classes with appropriate get/set functions.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 15, 2006 8:43 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
I agree, and I am against using global variables and singletons. Those were some internal testing globals, and if they prove to be useful they will get a proper API. I will put it on the TODO.

Thanks Steve,
Erwin

SteveBaker wrote:
There are a bunch of global variables exported by src/BulletDynamics/Dynamics/btRigidBody.h :

Code:
  extern float gLinearAirDamping;
  extern bool gUseEpa;

  extern float gDeactivationTime;
  extern bool gDisableDeactivation;
  extern float gLinearSleepingTreshold;
  extern float gAngularSleepingTreshold;


It's not good to export globals from the API, especially since they don't conform to the 'btXXXX' naming scheme. At least one of the demo's uses them (CcdPhysicsDemo sets gDisableDeactivation) - so if they are reallyimportant, they should probably be rolled into one or other of the main Bullet classes with appropriate get/set functions.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 15, 2006 11:12 pm 
Offline
User avatar

Joined: Sun Aug 13, 2006 4:41 pm
Posts: 127
Location: Cedar Hill, Texas
In src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp and in the CcdPhysicsDemo, there are references to:

m_ccdSweptShereRadius

Is that a typo? I presume it should be 'm_ccdSweptSphereRadius'.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 4:46 am 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
SteveBaker wrote:
In src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp and in the CcdPhysicsDemo, there are references to:

m_ccdSweptShereRadius

Is that a typo? I presume it should be 'm_ccdSweptSphereRadius'.


Thanks for pointing it out Steve, it has been fixed in version 2.17

Erwin


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 3:09 am 
Offline
User avatar

Joined: Sun Aug 13, 2006 4:41 pm
Posts: 127
Location: Cedar Hill, Texas
In the sample programs, you have a lot of application program functions that start with the string 'glut' - that's not a wise move. The entire point of having all actual GLUT functions beginning with 'glut' is precisely to avoid the risk of some GLUT function coincidentally havintg the same name as some application function. If you go around calling application functions 'glutXXXXX' then you are asking for problems in the future.

(eg 'glutMotionFuncCallback')


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 28, 2006 3:42 am 
Offline
User avatar

Joined: Sun Aug 13, 2006 4:41 pm
Posts: 127
Location: Cedar Hill, Texas
From reading the demo programs, it seems that the only way to perform some operations on btRigidBody objects is to access the raw member variables of the base class (eg, the Demos/OpenGL/DemoApplication.cpp reads and writes 'm_worldTransform'). This is kinda nasty because it means you can't tell when one of these fields has been touched if you ever need to in the future.

There should be inlined access functions for these things with all of the member variables of public classes made 'private'.

(Also, there is a typo: m_ccdSweptMotionTreshold ...should be 'Threshold')


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 28, 2006 4:53 am 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
SteveBaker wrote:
From reading the demo programs, it seems that the only way to perform some operations on btRigidBody objects is to access the raw member variables of the base class (eg, the Demos/OpenGL/DemoApplication.cpp reads and writes 'm_worldTransform'). This is kinda nasty because it means you can't tell when one of these fields has been touched if you ever need to in the future.

There should be inlined access functions for these things with all of the member variables of public classes made 'private'.

(Also, there is a typo: m_ccdSweptMotionTreshold ...should be 'Threshold')


Thanks for pointing out the typo, I'll rename it.

Bullet software makes distinguishment between classes and structs. The btCollisionObject is a struct at the moment, and for structs I allow direct data access. However, I agree it is not a good habbit. We can clean this up, but in general some structs are really mostly public data, which is not intended to be private.

More important, the world transform should be read/written by btMotionState. I'll probably remove the btRigidBody constructor that passes in a worldtransform, and you just pass the btMotionState (that contains the graphics worldtransform, including potential center-of-mass shifts etc).

Thanks for the useful feedback,
Erwin


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 28, 2006 5:21 pm 
Offline
User avatar

Joined: Sun Aug 13, 2006 4:41 pm
Posts: 127
Location: Cedar Hill, Texas
Erwin Coumans wrote:
Bullet software makes distinguishment between classes and structs. The btCollisionObject is a struct at the moment, and for structs I allow direct data access.


Yeah - for simple structs with no member functions, I would also leave the member variables exposed - but btRigidBody is a CLASS (admittedly derived from a STRUCT). To all intents and purposes, it's a class with exposed internals.

Quote:
More important, the world transform should be read/written by btMotionState. I'll probably remove the btRigidBody constructor that passes in a worldtransform, and you just pass the btMotionState (that contains the graphics worldtransform, including potential center-of-mass shifts etc).


OK - but the problem for application writers is that the only documentation of any use is the demo programs - and they don't seem to be using btMotionState. If the demo's don't use "best practices" then we can't expect application authors to guess what we expect them to do.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 28, 2006 7:00 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
SteveBaker wrote:
Erwin Coumans wrote:
Bullet software makes distinguishment between classes and structs. The btCollisionObject is a struct at the moment, and for structs I allow direct data access.


Yeah - for simple structs with no member functions, I would also leave the member variables exposed - but btRigidBody is a CLASS (admittedly derived from a STRUCT). To all intents and purposes, it's a class with exposed internals.

Quote:
More important, the world transform should be read/written by btMotionState. I'll probably remove the btRigidBody constructor that passes in a worldtransform, and you just pass the btMotionState (that contains the graphics worldtransform, including potential center-of-mass shifts etc).


OK - but the problem for application writers is that the only documentation of any use is the demo programs - and they don't seem to be using btMotionState. If the demo's don't use "best practices" then we can't expect application authors to guess what we expect them to do.


OK. Let's put it on the todo, to modify all demos so they consistently use getCenterOfMassTransform and btMotionState. The demos are using btMotionState to synchronize the graphics for rendering, see DemoApplication::localCreateRigidBody.

Also, I will add this to the Bullet_User_Manual.pdf. Other feedback requests for reorganizing the Wiki so it becomes more useful and adding a User Gallery so users can share their work using Bullet better.

Thanks,
Erwin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 3:45 am 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
Hi Steve,

This has been fixed in SVN: btCollisionObject is a class now. Its members like m_worldTransform are not public anymore, and required set/getWorldTransform(). Also, btMotionState is required now, to synchronize world transform properly.

Thanks for the feedback. Hopefully no big refactoring changes anymore, so we can focus on improving quality and performance ;-)
Erwin


SteveBaker wrote:
Erwin Coumans wrote:
Bullet software makes distinguishment between classes and structs. The btCollisionObject is a struct at the moment, and for structs I allow direct data access.


Yeah - for simple structs with no member functions, I would also leave the member variables exposed - but btRigidBody is a CLASS (admittedly derived from a STRUCT). To all intents and purposes, it's a class with exposed internals.

Quote:
More important, the world transform should be read/written by btMotionState. I'll probably remove the btRigidBody constructor that passes in a worldtransform, and you just pass the btMotionState (that contains the graphics worldtransform, including potential center-of-mass shifts etc).


OK - but the problem for application writers is that the only documentation of any use is the demo programs - and they don't seem to be using btMotionState. If the demo's don't use "best practices" then we can't expect application authors to guess what we expect them to do.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 2:39 am 
Offline
User avatar

Joined: Sun Aug 13, 2006 4:41 pm
Posts: 127
Location: Cedar Hill, Texas
Many thanks!

I'll have a bit of time over the weekend - I'm getting my game back up and working with all of this refactored goodness.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 06, 2006 8:16 am 
Offline

Joined: Mon Aug 21, 2006 5:11 am
Posts: 10
while generating the bt stuff a minor error happened. Just do a
Code:
grep bteral `find <yourbulletdir> *`

(while doing some substitution every "Gen" got replaced by a "bt" what produced a "GNU bteral Public License")

Noehrgel


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: Exabot [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group