Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suspension subclassing; CARSUSPENSIONINFO struct.
11-18-2010, 07:11 PM,
#3
 
Currently the configuration looks something like

Quote:[wheel/fl]
texture = oem_wheel.png, oem_wheel-misc1.png
mesh = oem_wheel.joe
orientation = left
position = -0.69, 1.27, -0.49
suspension = double-wishbone
upper-chassis-rear = -0.35, 1.27, -0.07
upper-chassis-front = -0.35, 1.33, -0.07
lower-chassis-rear = -0.28, 1.22, -0.44
lower-chassis-front = -0.28, 1.32, -0.44
upper-hub = -0.64, 1.28, -0.37
lower-hub = -0.64, 1.27, -0.56

camber = -1.27
caster = 4.9
toe = 1.2
ackermann = 7.9
steering = 32.8

This would only apply to double wishbone suspension, I intend to implement further suspension types also (I started with DW because it's the most complex independent suspension system, and should give a good idea of what needs to be present). Currently this is all done in LoadSuspension, which I've moved to a static member function of CARSUSPENSION so that CARDYNAMICS doesn't have to know anything about different suspension types. A different scheme similar to what zim suggested with the info about hinge points in a separate config block might make sense also, eg.

Quote:[wheel/fl/wishbone-hinges]
upper-chassis-rear = -0.35, 1.27, -0.07
upper-chassis-front = -0.35, 1.33, -0.07
lower-chassis-rear = -0.28, 1.22, -0.44
lower-chassis-front = -0.28, 1.32, -0.44
upper-hub = -0.64, 1.28, -0.37
lower-hub = -0.64, 1.27, -0.56


[wheel/fl]
texture = oem_wheel.png, oem_wheel-misc1.png
mesh = oem_wheel.joe
orientation = left
position = -0.69, 1.27, -0.49
suspension = double-wishbone
camber = -1.27
caster = 4.9
toe = 1.2
ackermann = 7.9
steering = 32.8


My prelim implementation virtualises GetWheelPosition (pure virtual), SetSteering (rotational travel offset), and Init. At the moment I have moved the hinge from the CARSUSPENSIONINFO struct directly into CARSUSPENSION. Unless you're expecting to one day have a thousand of the same type of car in a particular game instance, I'm not convinced about the data sharing Wink — but that's just my opinion, of course.
EDIT: Actually it doesn't make Init virtual so much as admit it takes overloading now. I might change the access to protected.
Reply


Messages In This Thread
[No subject] - by NaN - 11-18-2010, 11:04 AM
[No subject] - by fudje - 11-18-2010, 07:11 PM
[No subject] - by fudje - 11-18-2010, 08:02 PM
[No subject] - by fudje - 11-19-2010, 12:39 AM
[No subject] - by NaN - 11-19-2010, 01:13 PM
[No subject] - by NaN - 11-19-2010, 02:28 PM
[No subject] - by fudje - 11-19-2010, 04:20 PM
Patch for LE data. - by fudje - 11-20-2010, 01:08 AM
[No subject] - by fudje - 11-20-2010, 01:55 AM
[No subject] - by fudje - 11-20-2010, 04:19 AM
[No subject] - by NaN - 11-20-2010, 07:41 AM
[No subject] - by fudje - 11-20-2010, 03:41 PM
[No subject] - by fudje - 11-21-2010, 04:46 AM
[No subject] - by NaN - 11-21-2010, 07:32 AM
[No subject] - by NaN - 11-21-2010, 07:36 AM
[No subject] - by fudje - 11-21-2010, 11:30 AM
[No subject] - by joevenzon_phpbb2_import3 - 11-21-2010, 02:20 PM
[No subject] - by fudje - 11-21-2010, 09:02 PM
[No subject] - by fudje - 11-22-2010, 07:51 PM
[No subject] - by fudje - 11-26-2010, 01:24 AM
[No subject] - by NaN - 11-26-2010, 07:53 PM
More stuff - by fudje - 12-01-2010, 06:08 AM
[No subject] - by NaN - 12-01-2010, 12:59 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)