C-API - ready for use?

quantum
Posts: 6
Joined: Sun Sep 02, 2007 4:26 pm

C-API - ready for use?

Post by quantum »

I have a C based BSP game engine and I'm trying to fold in Bullet. I've included the core bullet projects and I'm able to compile everything and do simple calls like:

plNewBulletSdk
plCreateDynamicsWorld

I'm getting handles back so it appears I'm ready to get started. However as I get farther into the API, I see the following are not implemented (or they call dummy functions):

plNewStaticTriangleMeshShape
plNewMeshInterface
plAddTriangle

Won't I need these for loading the BSP world mesh?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: C-API - ready for use?

Post by Erwin Coumans »

quantum wrote:I have a C based BSP game engine and I'm trying to fold in Bullet. I've included the core bullet projects and I'm able to compile everything and do simple calls like:

plNewBulletSdk
plCreateDynamicsWorld

I'm getting handles back so it appears I'm ready to get started. However as I get farther into the API, I see the following are not implemented (or they call dummy functions):

plNewStaticTriangleMeshShape
plNewMeshInterface
plAddTriangle

Won't I need these for loading the BSP world mesh?
The C-API is work in progress. Only very basic functionality is hooked up (see DinoDemo), but for a BSP mesh you probably need more.
Are you familiar with C++? In that case, you could help completing the C-API a bit. Alternatively, please tell which functions you most urgently need.

Thanks for the feedback,
Erwin
quantum
Posts: 6
Joined: Sun Sep 02, 2007 4:26 pm

Re: C-API - ready for use?

Post by quantum »

I consider myself fluent in C and know the basics of C++ but I'm not a guru with C++. However I will fill in the blanks quickly and I'll be glad to assist in completing the C-API.

I've already done some refactoring (see attached) which you can take or not as you think best. Having the C-API separate makes it nice that I can do this refactoring and still accept big changes to your base code without having a big headache with merging it down the road.

I think my first step is to load level geometry and then be able to retrieve the list so I can do debug drawing using gl_lines to verify the physics engine sees what I think it should see. I can feed verts, triangles, or polygons.

Is btTriangleMesh appropriate to load a BSP level? It appears you started on that with:
plNewMeshInterface
plAddTriangle
plNewStaticTriangleMeshShape

Or can the same thing be done using what's already in the C-API?
You do not have the required permissions to view the files attached to this post.
quantum
Posts: 6
Joined: Sun Sep 02, 2007 4:26 pm

Re: C-API - ready for use?

Post by quantum »

This is my first attempt to integrate a physics API. Bullet is mostly devoid of documentation so I was pretty lost right away, but I found the very extensive documentation for Ageia Physx works well for Bullet. The functionalities and terms are close enough and it's helpful in giving an overview.

With that I see that I definitely want btTriangleMesh for large amounts of game level data so I'll see if I can add it to the C-API, or maybe Erwin will beat me to it :wink:
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: C-API - ready for use?

Post by Erwin Coumans »

quantum wrote:This is my first attempt to integrate a physics API. Bullet is mostly devoid of documentation so I was pretty lost right away
Did you check out the Bullet_User_Manual.pdf and doxygen documentation?

Can you give some feedback on which specific parts you would like to see documented most urgently?

Thanks a lot,
Erwin
telengard
Posts: 5
Joined: Mon Sep 03, 2007 8:32 pm

Re: C-API - ready for use?

Post by telengard »

I'm just getting to the point of adding a physics engine to my project which is pure C based (SDL/OpenGL/embedded python and SWIG) so I'm wondering the same thing. I just need the basics right now so it seems it may work OK based on the Dino demo. I can contribute patches for wrappers to things I need to get at. As long as there is basic collision detection and a means to have objects interact when they do collide I'll be set. I'm building a pinball type game.

~telengard
quantum
Posts: 6
Joined: Sun Sep 02, 2007 4:26 pm

Re: C-API - ready for use?

Post by quantum »

Erwin Coumans= wrote:Did you check out the Bullet_User_Manual.pdf and doxygen documentation?
Somehow I missed that. Sorry. I saw the Bullet_FAQ.pdf and I missed the second file. It does provide some good overview info which is what I was looking for.

I still find the Physx docs complement this library well.

Physx has a term called "actors". Does this correspond to Bullet "shapes"?