KSPWheel icon indicating copy to clipboard operation
KSPWheel copied to clipboard

TODO -- KSPWheelCollider -- low-level component

Open shadowmage45 opened this issue 9 years ago • 0 comments

TODO:

General Implementation

  • Investigate allowing collider to search for a rigidbody if none has been provided and the update method is called (either automatically or manually).
  • Refactor to separate suspension sweep from spring/friction forces integration. Allow external classes to call suspension sweep data and use that for adjustments to friction/etc without them having to run their own raycast.
  • Refactor to separate contact patch data into a separate struct/class -- previous attempt at doing so resulted in... problems....

Sticky friction

  • Add calculations of actual static friction; use slope, gravity, and specified wheel static friction to enable/disable the gravity fixes
  • Investigate force application more thoroughly, still some sliding occurring in some situations
    • Is the gravity vector incorrect for the frame in which the forces are applied? -- is it behind a frame?
      • Minor sliding was still occurring in the unity editor, which used a static gravity vector, so probably not.
    • Could be floating point imprecision?
    • In KSP could it be caused/amplified by rotating reference frame?
  • Should investigate using a joint to finish the sticky implementation

Suspension Forces

  • Need to handle of angled suspension hit; how to handle cases of, for example, wheel laying on its side
    • This should probably be best handled by adding in a 'maximum spring response' for when spring compression increases vastly between physics ticks; probably can be clamped to a percentage of spring travel * spring rate. Still needs to be large enough to handle regular suspension reaction forces and dynamics, but small enough to clamp out spring response that would cause bouncing or launching into the air.
  • Need to handle damper forces properly when going from !grounded to grounded -- zero or add a low multiplier to damper force for that first tick (configurable?)

shadowmage45 avatar May 18 '16 15:05 shadowmage45