RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
1.03k stars 178 forks source link

More advanced wheel definition #1274

Open ohlidalp opened 7 years ago

ohlidalp commented 7 years ago

Land vehicle wheels came into my attention. I began evaluating all the info and feedback I have on them:

I tried to think of a completely generic system to build any form of wheel with any set of reinforcements necessary. And I think I figured it out. Below is a mockup of proposed extension to Truckfile format.

WORK IN PROGRESS: Some things may not make sense yet, but you should get the idea.

; WHEEL DEFINITION: Define a named wheel template.
; Principle: 
; 1. define a middle ring of nodes (or band of triangles) which defines segment count.
; 2. Continue by adding extra rings on either side - they automatically link to previous ring.
; 3. Last ring on either side automatically links to it's axis node.
wheel_def

  ; NAME - string without spaces
  name: Name:str

  ; DEFAULTS - like set_[node/beam]_defaults, but internal to this wheel def.
  node-defaults: NodeParams...
  beam-defaults: BeamParams...

  ; MIDDLE RING: radius, number of segments, params of nodes (uniform) and ring-beams (uniform)
  middle: Radius:float NumSeg:uint NodeParams..., BeamParams...

  ; MIDDLE BAND: Transforms the middle ring defined above into a band of triangles.
  ; HalfWidth defines width of the band, BeamParams define interconnecting beams (uniform)
  middle-band: HalfWidth:float, BeamParams...

  ; EXTRA RINGS - these define the surface of the wheel
  ; indexed from 0 (the middle ring): positive=right, negative=left
  ; Anchor: L/R is left/right axis node, M is the middle ring/band. Adding % enables relative positioning.
  ; Offset: Position relative to given anchor, specified by absolute or relative (Mid->side) value.
  ; Skip: reduces number of segments. 0=keep all, 1=half the count, 2=quarter the count...
  ring: Index:int, Radius:float, Skip:uint, Anchor:[L/R/M(%)], Offset:float, NodeParams... BeamParams...

  ; REINFORCEMENTS - distributes a circular set of support beams along the wheel
  ; Beam is defined by
  ;    ring indices (start/end) - see "ring:" above. 0 means mid-ring (or midband side).
  ;         NOTE: EndIndex can be R/L instead - this will link to axis nodes and "EndSkip" will be ignored.
  ;    skip (start/end) - how many nodes to skip between placing beam. 
  ;                         0=use all nodes, 1=skip every other node...
  ;    distance - num. nodes to go across.
  ;               0 only makes sense if StartIndex <> EndIndex, obviously
  reinforce: Distance:uint, StartIndex:int, StartSkip:uint, EndIndex:[int/L/R], EndSkip:uint, BeamParams...

end_wheel_def
ohlidalp commented 7 years ago

Feedback from Discord chat:

derbymutt - Yesterday at 5:16 PM

The rigidity node works best when you make sas with a 2d axle, and is usually pointless for independent suspension It will not stop expansion Connecting every other node in the wheel with a beam will stop expansion and still allow the tire to flex I feel the need to say though, your suggested format makes very little sense There is no reason for giving people the opportunity to change the beam ordering, that is not user friendly and leads to idiots breaking things

DarthCain - Yesterday at 7:21 PM

not really even sure what I'm looking at. other than I don't think I've ever really seen anything use wheels2 other than some old submesh things

Michael10055 - Today at 1:51 PM

I know Ulteq wanted to fix the expanding wheels, but some opposed it because some mods actually benefit from it I believe derby's lotus is one of them