3D Physics with ZgeBullet
Moderator: Moderators
Been experimenting with this, like it - I will be creating some presets for the visualizer with this. Some things I noticed with the visualizer -
While testing a cube dropping on a plane in FL Studio - I noticed that with each new run my box was getting stacked on an "Imaginary" rigid body - and performance was taking a huge hit too. This wasn't happening when I ran it in ZGE though.
I don't think OnClose gets executed. Putting this onloaded fixed the problem.
zbtDestroyWorld();
zbtDeleteAllShapes();
zbtClearAllHeightLists();
However, seems that crosstalk does exist - changing the bullet settings in one preset will affect another preset. So when using with FL Studio, you should only use one instance of bullet.
While testing a cube dropping on a plane in FL Studio - I noticed that with each new run my box was getting stacked on an "Imaginary" rigid body - and performance was taking a huge hit too. This wasn't happening when I ran it in ZGE though.
I don't think OnClose gets executed. Putting this onloaded fixed the problem.
zbtDestroyWorld();
zbtDeleteAllShapes();
zbtClearAllHeightLists();
However, seems that crosstalk does exist - changing the bullet settings in one preset will affect another preset. So when using with FL Studio, you should only use one instance of bullet.
bullet in zge test
finally making some progress with bullet in zgeViz - here is a test. It's just a box on a pendulum reacting to a midi note, but it's a start - I really enjoy using bullet too. Here is a youtube vid
http://www.youtube.com/watch?v=lpfsGqFfMk0
I'm going to expand this concept to include more objects and I'm goint try to implement projectiles. I' have a pretty good idea about timing it all.
http://www.youtube.com/watch?v=lpfsGqFfMk0
I'm going to expand this concept to include more objects and I'm goint try to implement projectiles. I' have a pretty good idea about timing it all.
The latest version of ZGEBullet library comes with some improvements in API; see the attached zgebullet.txt. Another step further is support for Android.
Remark: the latest testing application is not compatible with this library! I'll prepare a new version of testing application; hopefully. Currently, I'm personally testing the library on a game Toyland Shooter which is still in development.
Remark: the latest testing application is not compatible with this library! I'll prepare a new version of testing application; hopefully. Currently, I'm personally testing the library on a game Toyland Shooter which is still in development.
- Attachments
-
- libZGEBullet.zip
- libZGEBullet.so for Android (android-8, armeabi)
- (421.84 KiB) Downloaded 859 times
-
- ZGEBullet.zip
- DLL for Windows
- (265.35 KiB) Downloaded 881 times
I'm pleased to announce that ZGEBullet has been published on Google code - see http://code.google.com/p/zgebullet/.
Since now, all new releases of the library, "official" demos, documentation (will come later), related material, etc. can be downloaded from the Google code's project page. Of course, I'll keep you informed also via this forum/topic.
If you are interested in seeing the code, compiling it by yourself, improving it, finding bugs, putting any comments to the issue tracker, etc., please, visit the project page. You are also welcome to become a contributor.
Since now, all new releases of the library, "official" demos, documentation (will come later), related material, etc. can be downloaded from the Google code's project page. Of course, I'll keep you informed also via this forum/topic.
If you are interested in seeing the code, compiling it by yourself, improving it, finding bugs, putting any comments to the issue tracker, etc., please, visit the project page. You are also welcome to become a contributor.
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
not sure how to use the new version,. with the ref stuff?
CurrentModel.Position.X = zbtGetPositionX(rbId);
CurrentModel.Position.Y = zbtGetPositionY(rbId);
CurrentModel.Position.Z = zbtGetPositionZ(rbId);
becomes ??
zbtGetPosition(int collisionObjectId, ref float x, ref float y, ref float z)
CurrentModel.Position= ?
CurrentModel.Position.X = zbtGetPositionX(rbId);
CurrentModel.Position.Y = zbtGetPositionY(rbId);
CurrentModel.Position.Z = zbtGetPositionZ(rbId);
becomes ??
zbtGetPosition(int collisionObjectId, ref float x, ref float y, ref float z)
CurrentModel.Position= ?
iterationGAMES.com
Hi jph,
Should become ..
Haven't tried it myself though.
K
Should become ..
Code: Select all
zbtGetPosition(id, CurrentModel.Position.X, CurrentModel.Position.Y, CurrentModel.Position.Z);
K
You are right Kjell. This is usual OnUpdate code for dynamic objects:
This demo project shows how to use updated API.
Code: Select all
// update position and rotation
zbtGetPosition(RigidBodyId, CurrentModel.Position.X, CurrentModel.Position.Y, CurrentModel.Position.Z);
zbtGetRotation(RigidBodyId, CurrentModel.Rotation.X, CurrentModel.Rotation.Y, CurrentModel.Rotation.Z);
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
thanks for that demo project Rado, that is what I needed to get going,.
is zbtCreateHeightfieldTerrainShape still supported? how to feed the terrain data to this now?
zbtCreateHeightList(); and related functions are gone. I am only look to use a static terrain,. if this is still possible. thanks again.
is zbtCreateHeightfieldTerrainShape still supported? how to feed the terrain data to this now?
zbtCreateHeightList(); and related functions are gone. I am only look to use a static terrain,. if this is still possible. thanks again.
iterationGAMES.com
Hi Jph, all,
BTW today I added more parameters to zbtCreateHeightfieldTerrainShape to have better control over its properties. Up to now, heightmap was always subdivided to diamonds; which is better for smooth (hi-poly) meshes, but simple triangulation is better for low-poly terrains based on larger triangles. So I added a parameter to enable/disable diamond division. Another added parameter is heightScale, which was always 0 (unused?) up to now.
The updated version of ZGEBullet library can be found here. A new demo project, used to demonstrate dynamic heightfield terrains, was also added. Have a fun!
Rado1.
PS. Ville can you please add a new version of zgebullet.txt to ZGE distribution, thanks.
yes, zbtCreateHeightfieldTerrainShape is still supported, and thanks to the xptr parameter for heightfield data, it provides even better performance for dynamic heightmaps.jph_wacheski wrote:is zbtCreateHeightfieldTerrainShape still supported? how to feed the terrain data to this now?
BTW today I added more parameters to zbtCreateHeightfieldTerrainShape to have better control over its properties. Up to now, heightmap was always subdivided to diamonds; which is better for smooth (hi-poly) meshes, but simple triangulation is better for low-poly terrains based on larger triangles. So I added a parameter to enable/disable diamond division. Another added parameter is heightScale, which was always 0 (unused?) up to now.
The updated version of ZGEBullet library can be found here. A new demo project, used to demonstrate dynamic heightfield terrains, was also added. Have a fun!
Rado1.
PS. Ville can you please add a new version of zgebullet.txt to ZGE distribution, thanks.
As you probably noticed here, ZGEBullet was compiled also for 64-bit Windows. It has become a part of "official distribution" and the latest version can always be downloaded from http://code.google.com/p/zgebullet/downloads/list.
ZgeBullet library has been updated to version 1.2; here is the change list:
Added:
- Support for raycast vehicle, a simple car simulation.
- Added demo #3 for raycast vehicle (used car control is little bit weird but it's almost the same on Windows with mouse and on Android with touches).
Changed:
- Updated to Bullet 2.82 (rev.2704) - latest stable version.
- ZGEBullet renamed to ZgeBullet.
- Removed boolean and rotation constants from ZGE external library.
- Demos updated to the latest changes and ZGE language updates.
For details see the ZgeBullet page at Google Code. Download demos and precompiled library for Windows and Android from the download page.
Note: The raycast vehicle demo uses Bullet's height field, which does not provide very reliable collision detection and sometimes objects can pass through. This is a known issue of Bullet library.
Added:
- Support for raycast vehicle, a simple car simulation.
- Added demo #3 for raycast vehicle (used car control is little bit weird but it's almost the same on Windows with mouse and on Android with touches).
Changed:
- Updated to Bullet 2.82 (rev.2704) - latest stable version.
- ZGEBullet renamed to ZgeBullet.
- Removed boolean and rotation constants from ZGE external library.
- Demos updated to the latest changes and ZGE language updates.
For details see the ZgeBullet page at Google Code. Download demos and precompiled library for Windows and Android from the download page.
Note: The raycast vehicle demo uses Bullet's height field, which does not provide very reliable collision detection and sometimes objects can pass through. This is a known issue of Bullet library.
- Attachments
-
- screenshot of raycast vehicle demo
- scr.jpg (87.88 KiB) Viewed 34947 times