Free bullet physics system.

Blitz3D Forums/Blitz3D Userlibs/Free bullet physics system.

Yue(Posted 2015) [#1]
Free bullet physics system.


;*******************************************************************
;*******************************************************************
;***                                        
;***	Example of use BlitzBullet 
;***	(Physics Bullet Library wrapper for Blitz3D) 
;***   
;***	(c) 2010-2011 Mirage-lab Team 
;***	www.tools.mirage-lab.com                       
;***                                                  
;*******************************************************************
;*******************************************************************



Hi, I exchanged a few emails with the author of the bullet physics library, which for me is one of the best I've had a chance to use. And the author has granted me a license key for free distribution in the community.

Something that feature I love about this system is its incorpordado physical purification system, where I had the opportunity to learn many things.

So enjoy, and a special thanks to its Author Andry Svershko. Thank you :).













































Rick Nasher(Posted 2015) [#2]
Great one Yue! That's a very nice addition for the community.
Haven't been here much recently due to a burnout which limits me severly, but I have to comment on this one. Seen you did make a lot of progress recently: my compliments.

I personally am more a fan of NVIDIA's PhysX system as it appeared more evolved, but I may be wrong.

I've seen you have been doing really nice things with the Bullet system like Pawn and MarsRover, so you appear to have a lot of experience with it. Therefore I have a few questions:

- Is it faster than NVIDIA's PhysX?
- Is it easier to use?


Yue(Posted 2015) [#3]
Hi, I tried a time PhysX lib, but I could never understand in depth because they do not speak English, I'm not a programmer and the only way to learn it is under trial and error.

However something that I love bullet system is its purification system where I could understand certain concepts that before could not understand and from my point of view I think the bullet library is much better than others I have tried using only just look at the examples.

Regards. :)


RemiD(Posted 2015) [#4]
The Bullet physics engine seems fast from the tests that i have done, however i have not found a way to make a turning moving body stop after a certain anglevelocity / linearvelocity, so i was a bit annoyed by this. Else i like it.
I wanted to use it to add destructions (of floors, walls, ceilings, columns) to an underground structure that i was building.


Yue(Posted 2015) [#5]
I now jam I meet is not how to make my player to take a box in his hands and transport to another location. I guess if there is a way to do it, just do not know.


RustyKristi(Posted 2015) [#6]
Thanks Yue! This is awesome :D


Cocopino(Posted 2015) [#7]
Hi, Fantastic library!

I have a couple of questions should there be an expert here reading this:

Is there an English help file around? My Russian is a little rusty :)

Has someone tried this on a terrain? I'm playing around with example "7. Terrain" but I don't understand these lines:
bodyTerrain=btbodyCreateTerrain(terrain,5,50,5)
btBodySetPosition(bodyTerrain,160,24,160)


If I change the terrain scale to e.g. 15,50,15 the balls are not reacting to the terrain as expected. Probably a change in the numbers 160,24,160 is also needed but I can't see the mathematical connection between these numbers...?

Also, I would like to know if it would be possible to create a multi-textured (grass,sand,rock etc.) terrain in which each of the textures would allow for different physics settings (sand very soft + more friction, rock very hard/bouncy etc.)?

Thanks!


Yue(Posted 2015) [#8]
btDebugDrawSetMode(1+2)
scaleEntity(Terrain,100,100,100)
btBodySetScale(bodyTerrain%, 100,100,100)


Unfortunately there is no help in English, but I think if you activate the cleaning system you can understand many things.


Cocopino(Posted 2015) [#9]
Thanks for the debugDraw function - I rewrote part of the terrain example to make it accept other heightmap sizes and scales. Still have no clue why it needs this offset though:

Local terrain=LoadTerrain( "..\media\heightmap_256.bmp" ) 

Local scalex% = 3.0
Local scaley% = 30.0
Local scalez% = 3.0
Local heightmapsize% = 256.0

ScaleEntity terrain,scalex,scaley,scalez
Local bodyTerrain=btbodyCreateTerrain(terrain,scalex,scaley,scalez)

Local bodyTerrainX% = (160.0 / 5.0) * scalex + ((heightmapsize-64) * (scalex/2.0))
Local bodyTerrainY% = (24.0 / 50.0) * scaley
Local bodyTerrainZ% = (160.0 / 5.0) * scalez + ((heightmapsize-64) * (scalez/2.0))

btBodySetPosition (bodyTerrain,bodyTerrainX,bodyTerrainY,bodyTerrainZ)



Blitzplotter(Posted 2016) [#10]
Cant believe I missed this, very capable looking lib, great work :-D


_PJ_(Posted 2016) [#11]
Very nice, well done for obtaining this license, Yue and thanks for sharing!