Pro Class Vehicle Physics And Driving Mechanics

Yo @Pryme8 … I made car physics playground. I am going for Pro Class Vehicle Physics With Burnouts, Donuts and Skidding/Drifting something like this: YouTube

I pretty much got the physics and driving mechanics working, but i need to emit wheel smoke like in the video above.

If you (or anyone else) can help out by adding wheel smoke to the playground at the TODO place holders… That would be freaking awesome.

Here is the Test Playground: Babylon.js Playground


Note: Full throttle with Full Turning on Burnouts (Under 10 MPH) will kick in donut mode


Right Trigger - Throttle
Left Trigger - Brakes
Left Thumb Stick - Steering
X or Square Button - Hand Brake (Skidding/Drifting)

Real nice, MK! Fun! A little steeper steering-angle might be nice… which you’ll need for driftin’ the dirt track circuits, anyway. :slight_smile: vrooom! [ link to a video ]

Ok, ok, yes, a different kind of car. :slight_smile:

Thanks @Wingnut … Actually the steering angles are configurable… that car is setup for high speed track racing with steer dampening.

If wanted to you can change the default 0.165 steering angle with
standardCarController.lowSpeedAngle = 0.2
for example

1 Like

Really cool @MackeyK24!

Yeah I got you, do you have a variable for wheel contact amount and like slip amount or something?
If so then it should be ezpz.

Yep… in the standardCarController.onUpdateVehicleInformation callback function … skid_FL etc…

Yo @Pryme8 … I fix the Gear Box Shifting Issue when going in reverse then back to forward.

Please refresh your browser with disable cache to make sure you get the latest project.js and SampleScene.gltf loaded

1 Like

I’ll take a look at it today!

I have not forgotten about you, I will get to it asap. Real work took precedence. I will have a solution for you soon though.

Thanks Andy :slightly_smiling_face:

cars on FIRE!

1 Like

Something like this?

It needs a smoke texture, and for the gravity and some of the other settings to be tweaked.

Honestly to make it even more realistic too, we would need to have like “tire temperature” and not base it off of skid, but have the skid, skid duration and speed affect the tire temperature, then at a certain level start discharging it. That way we can control the color a little better as the higher temperature long duration “burn outs” should produce more smoke.

Plus then you tie the tire temp variable back into the skid calculations cause a warmer tire tends to give more control. AND THEN YOU GOTTA DO PITS STOPS!!! oooooo… this kinda sounds like a must have.

Also then customizing the car with simple tire options, like off-road, snow, hard-surface, medium and slick or something all with different cooling ratios, contact ratios, skid ratios, and durability, will add tons of fun for the player.

Made it a little easier to do donuts.

1 Like



luv doughnuts/cookies in 3d… as much as real life.


BLENDMODE_ONEONE and BLENDMODE_ADD the wheel smoke. Interesting!

How did you do those tire skids… (looking).

+1 for “Skid Intensity”

Very cool. Impressive. Hope to buy this on xbox someday.

Nice @Pryme8 … I am working on Engine Torque Curve and removing baseEnginePower…

Now it will get the torque amount from the animation curve based on the current engine rpm…

Alot smoother on take of and acceleration thru the gears… But you can still tweak the the burnout coefficient and donut boost to desired effect… I will also add a function to get the the SMOKE texture from the standard car controller.

Question: Can this be done with GPUParticleSystem instead. I tried just switching to GPUParticleSystem but things dont quite work the same… For instance even when emitRate = 0… It still emits smoke particles… Are there issues with the GPU Particle System ???

Yo @Pryme8 … I added Smoke Texture… But it does not seem to look much different.

Do the card coded Color1 and Color2 have anything to do with it… I assume the smoke would look more gray like the smoke texture.

Can you please take a look at playground with smoke texture from standard car controller:

Yeah the color stuff just shifts the textures color, and we do need a smoke texture, then we need to ramp up the particle count and make the opacity very very small.

It will be fun to mess with all these variable to come up with different cars.

Yeah we can do it with the GPU particles I assume and it will prolly work all the same visually, Honestly I would really like to do volumetric smoke, but I dont have the time to refine that system for you yet.

I added smoke texture in version 8 of playground… but it still looks really white… even if I don’t update color 1 and 2 … still white… is the colors additive or what… why is it not gray like the texture…

Btw, I would really love to see what volumetric smoke looks like… if you get time for that in da future, I would really appreciate another approach to wheel smoke to go what my driving mechanics

I think I sent you the volumetric smoke cube demo right?

It might not be the best choice because it will be very intensive on the client even though it looks cool, raymarching volumes can just eat resources.

We need to drop the opacity way way way down on the smoke texture or the particles themselves,. I’ve struggled with getting particle opacity to ever cooperate though. It would be nice if like we could just do particleSystem.globalAlpha = 0.05 or something.

With smoke the smaller the particles and the more transparent the better as long as you can ramp the count up to fill stuff back in.

Thats what i dont get… If the color1, color2 and colorDead control the color… WHAT IS PARTICLE TEXTURE for ???

I dont see ANY coloring from the actual smoke texture.

Yo @Deltakosh … You got any input on this smoke texture color issue. The smoke texture has a gray color to it. But it seems the color1, color2 and colorDead override what should be a gray color from the texture. But you get an error if you dont have a particle texture at all. I just dont get what i expect the coloring of the particles should be.

What is the purpose of particle texture vs color1 and color2… Can i take disable or tone down or something the color1 and color2 so the actual gray coloring from the smoke texture is used ???

As always… Thanks for your help :slight_smile:

1 Like