Box2D for ZGE

Use of external libraries (DLLs) from ZGE.

Moderator: Moderators

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

Post by VilleK »

Looking great Rado1!

Calling external libraries is probably the most important feature of ZGE because that allows people like you to add functionality without having to buy a Delphi license and learn the ZGE code base. And it pleases me a lot to see efforts like this.

Have you been able to contact Diki? It would be best if you could join his Google Code project and commit your code there, but I'm guessing that is what you intend to do.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Thanks Ville for encouraging words.
VilleK wrote:Have you been able to contact Diki? It would be best if you could join his Google Code project and commit your code there, but I'm guessing that is what you intend to do.
I tried to contact Diki, but without success. Since I'm not a member of his box2dzge project and my library is called differently (ZGEBox2D) I think about a separate Google project.
airpas
Posts: 48
Joined: Wed Apr 18, 2012 11:50 am

Post by airpas »

thanks for this good wrapping , smooth and fast
there is denpendency of MSVCR100.dll , could you compile it with mingw ?
mingw with a good switchs produce faster code than MSVC
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

airpas wrote:there is denpendency of MSVCR100.dll , could you compile it with mingw ? mingw with a good switchs produce faster code than MSVC
At the beginning, I tried to load the Box2D project to CodeBlocks and compile it with mingw, but there were some problems. Therefore, I decided for MSVC where the compilation runs without problems (original Box2D has project for VS 2012 easily loadable to VC 2010). Anyway, removing the dependency on MSVCR100.dll is easy even in MSVC; see the attachment with updated DLL.

This version contains some more features:
- filtering of collisions; read this page, section 6.2, part Filtering for more information about how to use it
- setting restitution for bodies
- setting body to be a sensor; again see the aforementioned manual, section 6.3 Sensors for details

To access these features, copy/paste the content of the attached file zgebox2d.txt to ZExternalLibrary component for ZGEBox2D.
Attachments
zgebox2d-adaptor.zip
Updated definition of ZExternalLibrary for ZGEBox2D
(1.42 KiB) Downloaded 784 times
ZGEBox2D.zip
DLL without dependency on MSVCR100.dll
(77.97 KiB) Downloaded 788 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Nice :)

Thanks for setting this up,. it seems you have jammed in a load of the features,. . Now I will need to find time to build something with this!
iterationGAMES.com
airpas
Posts: 48
Joined: Wed Apr 18, 2012 11:50 am

Post by airpas »

becomes much better , thanks for your effort
I tried to load the Box2D project to CodeBlocks and compile it with mingw, but there were some problems
i can successfully build Box2D 2.3.0 with C:B
this is the lib file
Attachments
libBox2D.zip
(89.56 KiB) Downloaded 775 times
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

airpas wrote:i can successfully build Box2D 2.3.0 with C:B
this is the lib file
Nice work. Now, I have MSVC-based building set up and running so there's a little reason to switch to C:B at the current stage. However, when going to public, I'll probably have a look at C:B to provide alternative way of building. It can also bring different performance/optimization and/or final dll size, maybe better.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

To attract you with new features, namely joints, motors, user data for bodies/joints, and some other minor improvements, a next demo from the current development version of the library was produced. It contains 3 objects: hanging ladder, chain and auto-moving recursive roto-something. You can drag/drop bodies with LMB and destroy them with RMB.

Personal opinion: I feel that ZGEBox2D can become ready for production very soon.

Any comments are welcome.
Attachments
demo2_v1.zip
demo project and dll
(109.08 KiB) Downloaded 808 times
screenshot
screenshot
scr.jpg (11.12 KiB) Viewed 28179 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Yup,. I have been messing around with the last version you posted, and I too belive you have gotten this thing far enough along for building something quite interesting with it,. and that was before this update!

Nice work ;)
iterationGAMES.com
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

I'm glad you like it. I'm waiting for your projects, demos, games, trials... to tune the library for your needs!!! The best code comes only with intensive usage and feedback of users. I'm open to any kind of questions, requests for features, providing priorities for further development, comments, discussions...

Plan: to provide more joint types, compound bodies, chain shape and some improvements of the existing code during next weekend.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

ZGEBox2D is now on Google code. The library contains all important features from Box2D; including promised edge and chain bodies, compound bodies, most of the joint types (just the friction joint is missing because I do not fully understand how can it be used practically), and some more settings for bodies and functions on world (such as deleting all bodies).

Because Google Code disabled downloads for new projects, compiled versions of the library, testing ZGE projects, demos, and other related files are stored separately :?

The project's URL: http://code.google.com/p/zgebox2d/
Downloads: https://googledrive.com/host/0BxwfQ8la8 ... lDTUhNU00/

Instead of several different demo projects, I decided to create one "big testbed ZGE project" with several scenes. You can download it from here. Use keys 1, 2, 3 to switch scenes, LMB to drag/drop dynamic objects, and RMB to delete objects (dynamic or static). For now, the Testbed application runs only on Windows, but will be reworked to Android soon. Later, it will contain also scenes for testing other features, such as other joint types, raycasting, dynamic changes of world/body/joint properties, etc.

Even if the library is feature-complete, the current version is still "only" 0.9, because not all features have already been tested. Here, your help is warmly welcomed. Please report me any requests, questions, problems, etc. I'm looking forward to your 2D physics projects.

Ville, can some next version of ZGE include this external library? Its definition is here or can also be obtained from the testbed project.
Attachments
screenshots of ZGEBox2D Testbed, v0.9
screenshots of ZGEBox2D Testbed, v0.9
scr.jpg (111.39 KiB) Viewed 28112 times
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Updated version v0.91 of the ZGEBox2D library has been published today. For more info see the release notes and manual how to use the library in ZGE project. Precompiled DLL + .so libraries and updated ZGEBox2D Testbed project (with a new raycast test scene and running on Android now) can be found at the download page.

I'm going to create my 1st 2D physic game in ZGE with the purpose to test the library, and when finished, stable v1.0 of the ZGEBox2D will be published.

Any comments are welcome.
Attachments
ZGEBox2D Testbed raycast test
ZGEBox2D Testbed raycast test
scr.jpg (52.61 KiB) Viewed 28030 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Wow, this is all looking very very good! I hope to get to work with this soon-ish ('time is always against us.') and will report any issues I find,. seems good and stable and fully featured from a quick first look. thanks again.
iterationGAMES.com
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Jph, I'm looking forward to your 2D physics games. Anyway, I'm working on my own game now, so some features are being continuously improved. For instance, the sensor functionality was reimplemented to get rid of relatively restricted Box2D sensors. Now, sensor bodies produce standard collision points, but do not react to collisions - that's the original meaning of sensors. Also mass properties are updated automatically if a body changes its shape.

Unofficial latest builds from trunk will from now on appear in a new directory "Latest trunk build" on the ZGEBox2D download site. The mentioned improvements are already included there.
airpas
Posts: 48
Joined: Wed Apr 18, 2012 11:50 am

Post by airpas »

good work Rado1
seems mingw produce smaller binary than VC
i rebuild your wrapper with C::B i get ZGEBox2D.dll=177kb!
Post Reply