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:
behaviorOfmaps 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.sizevalues (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:
carOfwalks from a wheel or tyre up to the chassis, andspeedOfreadscar.speed, elsecar.kmh, else 0. - Switching:
Cams.seton a camera with aDriveCamwrites the mode and car there, and refuses an unknown mode.Cams.cycle,DriveCam:cycle(honouringcycleModes) andsetModestep the mode. Without a DriveCam,Cams.setapplies follow and field of view to theCameradirectly.
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()