Havok RaycastVehicle

A quick port of CannonJS’ RaycastVehicle just to fuck around
It’s using curves to control acceleration and slipping. Those curves are attached as animations to the curves node in the inspector, so they can be viewed and edited using ACE

14 Likes

This is so good!

gotta-go-fast-sonic-the-hedgehog

I’m new to game physics and BabylonJs in general but reading that code I got the feeling all car physics is applied with pure JavaScript and Havok features related to vehicle physics are not taken advantage of.

Am I wrong? (By the way kudos for providing that even if it’s only vanilla Js)

If I am correct with that assumption I hope the team provides documentation for Havok side of things.

Nice work!

We have plenty of documentation regarding physics and havok :slight_smile: Using A Physics Engine | Babylon.js Documentation (babylonjs.com)

@carolhmj I’m reading it right now and learning but I only see one chapter about Havok, which is for using the provided plugin. If I remember correctly (again I am new to game physics world) Havok has modules for fine tune vehicle dynamics (among other things) such as gearing, engine parameters, aerodynamics etc.

By documentation I mean that sort of information if available.

Edit: Also most of the classes and methods defined in the above playground for raycast vehicle system should be available in Havok. If I understand correctly what we have in terms of Havok with Babylon plugin is the general side of physics simulation system, with high performance. Am I mistaken?

Not all of Havok’s capabilities are available currently, we focused on rigid bodies for 6.0. But if there’s interest we can talk to the Havok team to add more :slight_smile:

Yes please :two_hearts:.

Above playground has about 1000 lines of code and I guess this could have been reduced to few dozens (or a hundred?) if we could take advantage of native Havok vehicle physics module.

I’ve open an issue to keep track : [Physics] Car/Vehicle controller · Issue #13800 · BabylonJS/Babylon.js · GitHub

5 Likes

I second the benefit of adding in other Havok modules. Ask em to add em in!

1 Like

Havok Player Controls are going to be awesome! I check every day but no release date yet… :frowning:

Yo @Raggar … Did you notice in the playgrounds Babylon.js Playground

That is has not STOPPING power. When not applying engine force… It just glides forever… Also passing values to wheel.brake does PRACTICALLY nothing… not matter how large the value passed to setBrake… it has very very little stopping power.

I think something muse be wrong with the calcRollingFriction because this is the ONLY function that i see wheel.brake is being used (as maxImpusle) or maybe Havok with friction a bit different and it cant stop the vehicle by this value only.

Now for me to work around this for now, i implemented my own Braking Force by LERPING a bit of linear damping to help slow you down when braking.

But I would to get the make wheel.brake working correctly… What do you think about the whole no braking power issue ?