Streams

Streams

From BeamNG

Revision as of 17:03, 24 June 2014 by Metalmuncher (talk | contribs)

This page will contain a list of gui stream values, and some tips on how to use them.

wheelInfo

This is an array of wheels, for each wheel:

  • This is an array of wheels, for each wheel:
    • 0 wd.name
    • 1 wd.radius
    • 2 wd.wheelDir
    • 3 w.angularVelocity
    • 4 w.lastTorque
    • 5 drivetrain.wheelInfo[wd.wheelID].lastSlip
    • 6 wd.lastTorqueMode

engineInfo

This has stuff to do with the drivetrain and some general physics current values and settings.

  • 0 v.data.engine.idleRPM
  • 1, v.data.engine.maxRPM
  • 2, v.data.engine.shiftUpRPM
  • 3, v.data.engine.shiftDownRPM
  • 4, drivetrain.rpm
  • 5, drivetrain.gear
  • 6, v.data.engine.fwdGearCount
  • 7, v.data.engine.revGearCount
  • 8, drivetrain.torque
  • 9, drivetrain.torqueTransmission
  • 10, obj:getVelocity():length() -- airspeed
  • 11, drivetrain.fuel
  • 12, drivetrain.fuelCapacity
  • 13, sensors
  • 14, Settings.gravity

stats

electrics

sensors

torqueCurve

Using Streams

In your app's update function, you can get the content of the streams as following:

MyApp.prototype.update = function(streams){
    streams.wheelInfo   //<- there's your wheelinfo
    streams.wheelInfo[0] // <- first wheel
    streams.wheelInfo[0][0] // <- name of the first wheel

    streams.sensors.position.x // <- x-Coordinate of the position of the current vehicle
}