Simple (very much so) physics engine.

Blitz3D Forums/Blitz3D Beginners Area/Simple (very much so) physics engine.

psychicbottle(Posted 2012) [#1]
ok i know there are some physics engines out there, but they look complex to use (though i haven't looked into them a ton) and i was thinking it musn't be that hard to code a simple "drop and fall" engine that would be able to handle basically just say ive got a cube that is falling at an angle, once it hits the ground physics would kick in and essentially rotate it to a flat side Via gravity. any help at all here? :)

P.S. i have no idea if i am overusing these forums too much or not, i just have a lot of things i want to do right and make sure i can make the right mistakes. If i am overusing them please let me know.


Kryzon(Posted 2012) [#2]
Filax just released EasyTok for free. It used to be a commercial Blitz3D physics wrapper.
You might want to take a look: http://blitz3dfr.com/hedgehog/data/documents/EasyTok.zip

(Originally from Blitz3DFR)


psychicbottle(Posted 2012) [#3]
thank! will do :)


psychicbottle(Posted 2012) [#4]
hmm it does not seem to download for me... :/


Mikorians(Posted 2012) [#5]
How about a simple angular calculation ala breakout?

Pseudo:
If we fell then
if we hit then delay a bit (based on velocity)
else
we're done delaying...
if impact angle>180 then rotate -1
if impact angle<180 then rotate +1
end if
end if
I did a real simple fall routine in my gameinputupdate routine without impact rotation


Mikorians(Posted 2012) [#6]
of course this doesn't account for terrain slope, but I believe there's a command for that somewhere...


gradualcheetah(Posted 2012) [#7]
oh wow i didnt even see this, thanks for the response :)


Mikorians(Posted 2012) [#8]
Mousey try to help kitty, he he


psychicbottle(Posted 2012) [#9]
please dont eat me... :(


Yasha(Posted 2012) [#10]
Two physics engines here: http://www.blitzbasic.com/Community/posts.php?topic=92434#1053339

The Verlet-based engine is pure Blitz code, but also much slower than ODE.


...I wouldn't actually recommend either for production use, but you can take a look to see just how complex physics is (e.g. all that code used in the Verlet engine... isn't enough to make an even half serviceable physics engine: the ODE one is probably the bare minimum).


psychicbottle(Posted 2012) [#11]
how fast do you think easytok is? i was excited at first till i saw the frame rate X)


Kryzon(Posted 2012) [#12]
If you have US$13 to spare you can get a license of BlitzBullet: http://tools.mirage-lab.com/ - By Mirage-lab Team.

That is sure to have a good performance. They made a commercial game with it (probably the best current example of what one can achieve with Blitz3D).


Yue(Posted 2012) [#13]
Kryzon mirage lab use PhysX lib on your game.

Last edited 2012