Physics Wheel

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Thu Jul 23, 2009 8:50 am

I think I've figured a way to get a physically accurate car behavior.

What would be required is a top-down wheel object that outputs:
[list:18yeyyxo]
[*:18yeyyxo]force in each axis (x,y) to be applied to the car
[/*:m:18yeyyxo][*:18yeyyxo]torque to be applied to the car
[/*:m:18yeyyxo][*:18yeyyxo]amount of skidding, measured in force lost (this becomes displaced material, sound and heat)
[/*:m:18yeyyxo][*:18yeyyxo]Angular speed of the wheel (for animation and sound).[/*:m:18yeyyxo][/list:u:18yeyyxo]
It would require as an input:
[list:18yeyyxo]
[*:18yeyyxo]A car body to which it is attached, as a sprite with physics and all drag set to 0.
[/*:m:18yeyyxo][*:18yeyyxo]The position relative to the car body where it's attached.
[/*:m:18yeyyxo][*:18yeyyxo]static and dynamic friction coefficient (change in runtime when terrain changes, set to 0 when on air)
[/*:m:18yeyyxo][*:18yeyyxo]Car body's weight (or mass and gravity)
[/*:m:18yeyyxo][*:18yeyyxo]Torque being applied to the wheel[/*:m:18yeyyxo][/list:u:18yeyyxo]

And the equations are pretty standard physics. How does it sound?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Jul 23, 2009 6:35 pm

A real car physical car model models each wheel individually and stuff... it's kinda complicated...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Jul 23, 2009 9:13 pm

yeah that's why I'm talking about a single wheel object, not a car object.
This wheel would produce the info needed to apply the proper force to the car body, which in turn would drag the wheels.
It's complex but not hard :) pretty well documented and I studied it at some point.
I just gotta start working on the SDK.

One thing that could be annoying is weight. The wheel needs to know how much weight its supporting, but if I get this info automagically from a physics car body (based on body weight and relative position and assuming all wheels are at the same height) then you don't get to create multi-part articulated wheeled vehicles (8-wheelers, bycicles, etc) or to model suspension.
But suspension and weight distribution aren't trivial to calculate, doing so in events would make a physics wheel behavior really difficult to use.

Perhaps the behavior could have utility expressions to calculate those things. Hmm.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Jul 29, 2009 9:16 am

Sounds promising :)
B
11
S
3
G
4
Posts: 622
Reputation: 3,186


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests