Log inGet started
World

Torque Valley: Driving, Drift and Crash Sandbox

README.md

driveCams

Checks driveCams.cams and the DriveCam component, without the play camera:

  • Modes: modes() is the eight modes in cycle order (as a copy). has() knows exactly those, and every mode has a label and a field of view.
  • Behaviours: behaviorOf maps chase, cockpit/hood/bumper/rear (mount rig), orbit, tv and heli to their behaviour components, all of which resolve. An unknown mode runs chase.
  • Mounts: read from a car's car.mountSeat / car.mountHood / car.mountBumper / car.size values (source = "values"), including a real assembled torqueCars coupe matching its catalog mounts (skipped without torqueCars). A car with no values falls back to points worked out from its size.
  • Cars: carOf walks from a wheel or tyre up to the chassis, and speedOf reads car.speed, else car.kmh, else 0.
  • Switching: Cams.set on a camera with a DriveCam writes the mode and car there, and refuses an unknown mode. Cams.cycle, DriveCam:cycle (honouring cycleModes) and setMode step the mode. Without a DriveCam, Cams.set applies follow and field of view to the Camera directly.

It leaves alone the per-frame camera motion (rig smoothing, chase FOV widening, the TV and helicopter cameras' shot choice) and the cycle input binding, all of which run only in play. Cameras and stand-in cars are spawned far below the play area and despawned after each test.

Run it in edit mode:

return asset.resolve("driveCams", "testSuite"):run()