m_worldUserInfo purpose?

Post Reply

What was m_worldUserInfo meant to do?

Poll ended at Thu Dec 25, 2014 4:42 pm

Placeholder for functionality not yet added
2
67%
Placeholder for functionality that will not be added
1
33%
Reminder for people who forget
0
No votes
Nothing
0
No votes
Padding
0
No votes
 
Total votes: 3

Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

m_worldUserInfo purpose?

Post by Basroil »

Despite having used bullet for a while now, I still don't really know what the damn m_worldUserInfo variable in dynamicsWorld is for. It is literally only used in btDynamicsWorld.h, and can only be added to the world and returned as-is.


Personally I want to just spruce it up a bit so I can enable tick/pretick callbacks from member functions instead of static/ isolated function (to enable a few simplifications to my code), but not sure if it's there for some feature that will be added later
lunkhound
Posts: 99
Joined: Thu Nov 21, 2013 8:57 pm

Re: m_worldUserInfo purpose?

Post by lunkhound »

Yeah it doesn't seem very useful. If I want to add something to the dynamics world I just derive a custom version.

The only case I can think of where that pointer would be useful is where a closed-source 3rd party framework or application is managing dynamicsWorlds so that the user can't derive a custom version.

But that's a pretty weak case, I'd say it's just there to clutter up the code. :)
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: m_worldUserInfo purpose?

Post by drleviathan »

I though the btDynamicsWorld::m_worldUserInfo had a similar purpose as btCollisionObject::m_userObjectPointer: a hook for custom behavior that is not used by Bullet itself. I imagine it might be useful in a custom btDynamicsWorld derivation that needs a backpointer to some larger PhysicsEngine class that owns it... but only if I had code that kept a pointer to a base btDynamicsWorld and didn't necessarily know what type of World it had, and I can't think of a good example right now of when I might have such a situation.
Mako_energy02
Posts: 171
Joined: Sun Jan 17, 2010 4:47 am

Re: m_worldUserInfo purpose?

Post by Mako_energy02 »

drleviathan nailed it. It's just like the user pointer on collision objects for use with wrappers, imo. The part that is odd to me, is why it's on the btDynamicsWorld world and not the base class (btCollisionWorld).
Post Reply