Oddball's PhysLite vehicle

BlitzMax Forums/BlitzMax Programming/Oddball's PhysLite vehicle

Hezkore(Posted 2013) [#1]
I recently found Oddball's PhysLite module and the editors and everything is rather neat!

But I'm having some issues understanding how to create a vehicle.
Does anyone have any idea on how I would rotate two wheels that are attached to my advanced body?
None of the tutorials that comes with the module really demonstrates this...

There is a Spin() function for the advanced body, but it rotates the entire body, I would like to rotate the wheels only that are attached to the vehicle.

The Lunar Buggy game/example Oddball made does have a working car, but there doesn't seem to be any source released.
It comes with a body.plb, wheel1.plb and wheel2.plb which leads me to believe that I would have to somehow attach two separate wheels to the body of my vehicle, rather than having them integrated from the start in my .plb file.

If you don't know about the module, you can find it here - http://www.blitzbasic.com/Community/post.php?topic=99691&post=1171828


Hezkore(Posted 2013) [#2]
I've made an example using the chassi and wheels from the Lunar Buggy demo.
The wheels need to be attached to the chassi somehow though...

Here's the link: https://dl.dropbox.com/u/2842751/vehicle_test.rar


Oddball(Posted 2013) [#3]
I don't keep old source so that example has long since been deleted. However to join two advance bodies together find the masses that you want to link using TAdvBody.MassGet() and manually connect them using TConstraint.Create(). Then create a separate TBody and add your new constraints to that. Hope that helps.


Hezkore(Posted 2013) [#4]
Yes, thank you Oddball, this has solved everything. :)


Hezkore(Posted 2013) [#5]
Just a heads up Oddball...
Your documentation mentions "MASS_MASS" twice instead of "MASS_ZONE".

"A value of MASS_MASS means the event is between a TMass and a TZone."

Also, for anyone who might come across this thread at a later stage, I ended up using the X and Y between the collision and mass to get the angle of the collision, which means I can move my vehicle forward by using massget(x).move(sin(angle),cos(angle)) instead of using real rotating wheels.
It may be "fake" but it makes the whole thing a lot easier and manageable and means I don't have to create complex wheels that need be perfectly round and even then works a bit weird.

Thanks a again Oddball! :)