Use cases for btCollisionWorld.h or PhysicsClientC_API.h

Post Reply
brent
Posts: 10
Joined: Tue May 05, 2020 4:01 pm

Use cases for btCollisionWorld.h or PhysicsClientC_API.h

Post by brent »

Hi - a few random questions which I can't quite wrap my head around.

1.)
Is drawOpenGL https://github.com/bulletphysics/bullet ... Drawer.cpp the correct place to be looking to see how the Example Browser is implemented?

2.)Is there a way to get the data returned from dynamicsWorld->getNumCollisionObjects() (https://github.com/bulletphysics/bullet ... r.cpp#L751) from pybullet? It seem that pybullet

Code: Select all

getBodyInfo
is returning a different data set?

3.)
When building a 3d application; should the c++ apis be used directly; and not pybullet? 

4.)What is the correct way to think of the relationship (if there is any) between https://github.com/bulletphysics/bullet ... ionWorld.h and https://github.com/bulletphysics/bullet ... entC_API.h ?
Is one a superset of the other? Or are their specific use cases where one is better suited than the other?

Thanks
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Use cases for btCollisionWorld.h or PhysicsClientC_API.h

Post by drleviathan »

(1) The ExampleBrowser is open source and its full implementation can be found in bullet/examples/ExampleBrowser. That is the correct place to see how it is implemented.

The ExampleBrowser is an application written in C++. When you build the entire C++ library and all the examples you will end up with an executable ExampleBrowser. When I build on linux I can find the example broswer at: .../build_cmake/examples/ExampleBrowser/App_ExampleBrowser

The ExampleBrowser allows you to try the various examples using a GUI. The examples are also built into their own standalone executables which can be found in similar locations as the browser itself. Search for executable files in the build directory.

(2) This question does not compute. Perhaps you have a typo or should reword it. It seems like you're asking about getNumBodies which is mentioned in the pybullet quickstart guide, and yet you bring up getBodyInfo.

(3) Whether you should use C++ or Python depends on what you really want to do. What do you really want to do?

(4) You should not draw a line between btCollisionWorld C++ implementation and PhysicsClientC_API.h. The former is the base class for the C++ world simulation... it is a detail of how the C++ physics simulation is done. The latter declares an an abstraction layer for communicating with a physics simulation, subsequently hiding the details underneath.
brent
Posts: 10
Joined: Tue May 05, 2020 4:01 pm

Re: Use cases for btCollisionWorld.h or PhysicsClientC_API.h

Post by brent »

Thank you for the answers.

Rephrasing question 2 slightly

Would btCollisionWorld->getNumCollisionObjects() return the same total as pybullet.getNumBodies()?

And is it conceptually "the same" data structures that are being accessed between one entry of btCollisionWorld->getCollisionObjectArray and the correct corresponding call to pybullet.getBodyInfo()?

As pointed out in your previous answer; I understand these are in different interfaces; so they wouldn't ever be used together; but I'm just trying to see if my mental model of the code set is roughly correct.
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Use cases for btCollisionWorld.h or PhysicsClientC_API.h

Post by drleviathan »

(2 redux) I'm not a pybullet user but I would expect getBodyInfo to actually obtain the info about a particluar body, rather than info about all bodies. So, I believe the answer to your question is: "no".

(4 redux) No. To compare btCollisionWorld with PhysicsClientC_API would be like... comparing the specification for a class of diesel engines with the set of instructions for how to ship your goods with the trucking industry. One the one hand you have a description of what some engines should deliver (details), and in the other you hold a description of how to go about employing trucks (overview) to move your stuff, some of which are probably using engines which fall in the aforementioned category.
brent
Posts: 10
Joined: Tue May 05, 2020 4:01 pm

Re: Use cases for btCollisionWorld.h or PhysicsClientC_API.h

Post by brent »

Yes; got it.

Thank you very much for the responses; its very helpful to confirm some things and orientate my thinking a bit better on others.

Cheers
Post Reply