Difference between revisions of "Streams"

Difference between revisions of "Streams"

From BeamNG
(Created page with " <source> [UNFINISHED] List of Streams values: Wheels: array of wheels, each wheel: 0 wd.name 1 wd.radius 2 wd.wheelDir 3 w.angularVelocity 4 w.lastTorque 5 drivet...")
 
Line 1: Line 1:
 +
This page will contain a list of gui stream values, and some tips on how to use them.
  
 
<source>
 
<source>
[UNFINISHED] List of Streams values:
 
 
Wheels:
 
Wheels:
 
array of wheels, each wheel:
 
array of wheels, each wheel:
Line 36: Line 36:
  
 
torqueCurve: [wip]
 
torqueCurve: [wip]
 +
</source>
 +
 +
In your app's update function, you can get the content of the streams as following:
 +
<source>
 +
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
 +
}
 
</source>
 
</source>

Revision as of 16:47, 24 June 2014

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

Wheels:
array of wheels, 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:
	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: [wip]

electrics: [wip]

sensors: [wip]

torqueCurve: [wip]

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
}