3D Physics with ZgeBullet

Use of external libraries (DLLs) from ZGE.

Moderator: Moderators

User avatar
VilleK
Site Admin
Posts: 2151
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Mon Nov 28, 2011 4:18 pm

I like the addition of the ragdoll :)
Definitely a very interesting project!
And a good idea to remove the dependency. I'd say don't focus too much on file size now because functionality is more important at this point. I can always help trying to trim the size down later.

StevenM
Posts: 149
Joined: Thu Jan 20, 2011 10:03 am

Post by StevenM » Tue Nov 29, 2011 10:23 am

OMG thats a great update. This is just the coolest thing ever...ZGE+Bullet! I'm going to work on some parameterized visualizer demos.

Edit - Just a minor detail -

To get it working in the visualizer, I had to include the file file extension in the ModuleName ("ZGEBullet.dll" instead of just ZGEBullet).

User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski » Sat Dec 03, 2011 3:59 pm

Just working to learn how to use this,. I made a little peg board test.

So far this is quite a lot of fun to work with, although tweaking the simulation to get the "right" bouncing can suck up loads of time, as it is interesting to just watch it run. Just posting the .exe as I this is largely just a hack of the demo script so far.

I am thinking about how to deal with collisions so we can get game level responses. i.e. scoring, pegs die when hit, sounds are triggered by bounces, etc. For now I could use ZGE collision tests, however that seems to duplicate what Bullet already is doing. I will keep running tests to see what works best.

Thanks a bunch for building this for us to use, what are you licencing expectations, can we use that for anything? (obviously giving credit!)
Attachments
PichinkoZ_004.zip
exe with the dll it uses.
(267.96 KiB) Downloaded 547 times
iterationGAMES.com

StevenM
Posts: 149
Joined: Thu Jan 20, 2011 10:03 am

Post by StevenM » Sat Dec 03, 2011 8:33 pm

Just working to learn how to use this,. I made a little peg board test.
Very cool - so much possible with this. It is a lot of fun to - really amazing how all that motion is being tracked and calculated with so much accuracy and speed.

User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Sun Dec 04, 2011 11:18 pm

ZGEBullet v3 comes with the following features:

- global and object-local collision detection (propagation to ZGE)
- detection and control of activation and deactivation of objects
- constraint motors
- better support for dynamic objects (their mass > 0), fixed objects (mass == 0) and kinematic objects (mass < 0)
- minor improvements of existing functions

The attached demo project has been extended by:

- displaying the overall number of collisions
- by pressing D you can switch to the mode which displays the current collided objects in red (collisions with the floor are excluded) and inactive objects in yellow; consequent pressing the D key switched to the normal color mode
- by pressing S you can reset linear and angular velocities of all objects
- by pressing 6 you can generate a "mobilus" object - a box with two rotating arms; used to demonstrate motors
- by pressing 0 you can generate dominoes; I used it for testing collisions, so switching to the collision displaying mode is recommended

I hope you will enjoy these improvements, because ZGEBullet is slightly becoming more and more game production ready.

Note 1: Because I do not provide ZGEBullet help, I still recommend to read the Bullet documentation to understand the concepts. Many functions are directly mapped to the Bullet methods.

Note 2: I have not decided how and whether to publish ZGEBullet source files yet; I think about Google code. Questions about publishing and licensing I will solve during the Christmas holidays. However, there are no restrictions regarding to usage of the compiled DLL, you can use it freely.
Attachments
Physics_v3.zip
ZGEBullet.dll v3 + demo ZGE project
(240.53 KiB) Downloaded 562 times
scr2.jpg
screenshot
scr2.jpg (73.1 KiB) Viewed 13797 times

User avatar
VilleK
Site Admin
Posts: 2151
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Mon Dec 05, 2011 8:34 pm

Just getting better and better. The domino example is great!

Google code would be best imo. I vote for making it open source but of course it is up to you!

nadams
Posts: 9
Joined: Wed Nov 30, 2011 10:52 am

Post by nadams » Tue Dec 06, 2011 4:21 pm

VilleK wrote:Just getting better and better. The domino example is great!

Google code would be best imo. I vote for making it open source but of course it is up to you!
This is my opinion as well.
If you are concerned about monetary benefits - you could always charge for personal help (or accept donations).

User avatar
diki
Posts: 140
Joined: Thu Sep 11, 2008 7:53 pm
Location: GMT+1
Contact:

Post by diki » Wed Dec 07, 2011 7:58 pm

this is awesome! :D

i would recommend github over google code; but i guess it really depends on how & what you want to share.

User avatar
VilleK
Site Admin
Posts: 2151
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Wed Dec 07, 2011 9:16 pm

*waves to diki* Still checking this forum from time to time eh? :)

Github is where all the trendy kids hang these days but good old Google Code provides a selection of source control software while Github requires Git which is a pain to use on Windows, at least in my experience.

User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski » Sat Dec 17, 2011 8:48 pm

attached, just more random tests,. same peg board set up. I think I see a game in this,. even this simple setup could be fun. still thinking about it, so just thoughts and weird experiments currently. any new developments on the dll? perhaps ray-casting would be useful for shooters, and object picking, and such.
Attachments
PichinkoZ_010.zip
(273.6 KiB) Downloaded 527 times
iterationGAMES.com

User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Sat Dec 17, 2011 10:34 pm

Jph, I'm looking forward to your PichinkoZ game.

Back to your question: I'm currently working on collision shapes based on numbers of points, ie., heightfield terrain shape and triangle mesh shape. The tricky, already done, part was passing and management of height/point lists. A nice feature will be the possibility to change these shapes dynamically. I'm preparing a demo now. I expect I'll deliver this update next week.

A related "challenge" is to provide functions for loading meshes from files and their processing. To avoid this functionality in ZGEBullet, I really appreciated if ZGE itself would be able to load 3DS files in runtime and would provide some functions/components for processing imported meshes, eg., providing information about triangles and points (even if a point list can be obtained in MeshExpression and put to an array, however, this is a very cumbersome way).

Then, I'll have a look at ghost object, raycast vehicle, and raycasting in general. These will not be too difficult but will take some time to implement a good interface.

Another parallel activity is preparing a CHM help for ZGEBullet. I already started, but this will take some more time to have a complete version ready.

User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski » Sun Dec 18, 2011 3:56 pm

That sounds like a great plan. I'm very happy with just the primitive shapes in here now! Heightfield terrain will be interesting with the primitives too. Custom meshes would, of course, be good to have also, but seems a lesser issue, although I suppose it could making level building easier.

The bullet "raycast vehicle" seems interesting, a bit complex though. These will be fun on the terrain.

I find the Bullet help a bit difficult to navigate, is there a search on that page?

Anyway, if there is anything I can do to help just ask. I am loving the complex physics reactions.
Attachments
PhysicsTest4.zip
Just hacking around with your testbead,. I made a caterpillar from a string of mobiluii, press 6! G to toggle gravity.., etc.
(287.15 KiB) Downloaded 525 times
iterationGAMES.com

User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Mon Dec 19, 2011 10:27 am

Nice caterpillar :-) I use CHM version of the Bullet 2.73 API reference manual, which also provides index and search: http://www.continuousphysics.com/ftp/pu ... erence.zip

I could not find CHM for 2.79. (If you had some time you could try to create it with doxygen.)

User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Sat Dec 24, 2011 12:02 pm

A Christmas version of the ZGEBullet library is here. It contains the following improvements:

- New shapes based on sets of points: height field terrain, convex hull, and triangle mesh.
- Simple raycasting used to find objects in specified directions, their hit points and hit normals.
- Renaming of "id" parameters to more self-descriptive variants, such as "shapeId", "rigidBodyId", and "constraintId".
- New function for setting collision margins of shapes.

This version of the library comes also with an improved demo project. It now has the following features:

- By pressing W you can switch a dynamic wave ground on and off. This is modeled by height field terrain.
- Mouse pointer enables to select objects - a selected object becomes blue. This is a demo of raycasting.
- By pressing LMB you can shoot heavy and low-gravity balls in the direction of mouse pointer.
- By pressing RMB you delete the selected (blue) object.

Note 1: To demonstrate the new features, I recommend the following scenarios: press 2 for longer time or press 9 when the wave is switched on; use RMB to create continuous cuts to "tower" or "cube" formations; delete some parts of compound objects; shoot spheres to everything, etc.

Note 2: The demo project is maybe not optimal; its primary purpose is to be didactic.

Note 3: Please help! For waves I used a simple shader (WaveShader used in the GroundMaterial) I created from the scratch by looking at some examples. Because I'm not (yet) an GLSL programmer, the shader is incorrect. When it is used, all texts disappear. I have no clue why. Please help me to create a better shader with proper behavior and visual properties, such as correct light intensity, etc. Thanks. BTW which version of GLSL is used in ZGE?
Attachments
scr3.jpg
screenshots
scr3.jpg (100.07 KiB) Viewed 13566 times
Physics_v4.zip
ZGEBullet.dll v4 + demo ZGE project
(307.25 KiB) Downloaded 546 times

User avatar
VilleK
Site Admin
Posts: 2151
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Sun Dec 25, 2011 10:25 am

Superb stuff! It's ready for production use don't you think? Who'll be the first to create a 3d-clone of Angry Birds using ZGE ;). This definitely fits into the "projects that inspires me to keep developing ZGE" category, thanks for bringing it to us.

About the missing text when you use the shader it is my fault. I found out it was a bug in ZGE mistakenly introduced when working on passing array parameters as textures in the Visualizer. It should be fixed now so please test next beta update.

The version of GLSL supported is all down to your graphics hardware and driver. When starting ZGE you will see a "GL shaders: x.yy" text in the log window. This is the version your graphics card supports. On my computer this is 3.30. It's up to you as a developer to decide a GLSL-version that you'll expect the users of your project will have.

Post Reply