net.ctdp.rfdynhud.gamedata
Class _TelemetryDataCapsule

java.lang.Object
  extended by net.ctdp.rfdynhud.gamedata._TelemetryDataCapsule

public abstract class _TelemetryDataCapsule
extends java.lang.Object

Our world coordinate system is left-handed, with +y pointing up. The local vehicle coordinate system is as follows: +x points out the left side of the car (from the driver's perspective) +y points out the roof +z points out the back of the car Rotations are as follows: +x pitches up +y yaws to the right +z rolls to the right

Author:
Marvin Froehlich (CTDP)

Constructor Summary
protected _TelemetryDataCapsule()
           
 
Method Summary
abstract  float getBrakeTemperature(Wheel wheel)
           
abstract  byte[] getBuffer()
           
abstract  float getClutchRPM()
           
abstract  short getCurrentGear()
           
abstract  int getCurrentLapNumber()
           
abstract  float getDeltaTime()
           
abstract  short[] getDentSevirity()
           
abstract  float getEngineMaxRPM()
           
abstract  float getEngineOilTemperature()
           
abstract  float getEngineRPM()
           
abstract  float getEngineWaterTemperature()
           
abstract  float getFuel()
           
abstract  float getGripFraction(Wheel wheel)
           
abstract  float getLapStartET()
           
abstract  float getLastImpactMagnitude()
           
abstract  TelemVect3 getLastImpactPosition(TelemVect3 lastImpactPos)
          location of last impact
abstract  float getLastImpactTime()
           
abstract  float getLateralAcceleration()
           
abstract  float getLateralForce(Wheel wheel)
           
abstract  TelemVect3 getLocalAcceleration(TelemVect3 localAccel)
          acceleration (meters/sec^2) in local vehicle coordinates
abstract  TelemVect3 getLocalRotation(TelemVect3 localRot)
          rotation (radians/sec) in local vehicle coordinates
abstract  TelemVect3 getLocalRotationalAcceleration(TelemVect3 localRotAccel)
          rotational acceleration (radians/sec^2) in local vehicle coordinates
abstract  TelemVect3 getLocalVelocity(TelemVect3 localVel)
          velocity (meters/sec) in local vehicle coordinates
abstract  float getLongitudinalAcceleration()
           
abstract  short getNumberOfScheduledPitstops()
           
abstract  TelemVect3 getOrientationX(TelemVect3 oriX)
          top row of orientation matrix (also converts local vehicle vectors into world X using dot product)
abstract  TelemVect3 getOrientationY(TelemVect3 oriY)
          mid row of orientation matrix (also converts local vehicle vectors into world Y using dot product)
abstract  TelemVect3 getOrientationZ(TelemVect3 oriZ)
          bot row of orientation matrix (also converts local vehicle vectors into world Z using dot product)
abstract  TelemVect3 getPosition(TelemVect3 position)
          world position in meters
abstract  float getPositionX()
           
abstract  float getPositionY()
           
abstract  float getPositionZ()
           
abstract  float getRideHeight(Wheel wheel)
           
abstract  float getScalarVelocity()
           
abstract  float getSteeringArmForce()
           
abstract  SurfaceType getSurfaceType(Wheel wheel)
           
abstract  java.lang.String getTerrainName(Wheel wheel)
           
abstract  float getTireLoad(Wheel wheel)
           
abstract  float getTirePressure(Wheel wheel)
           
abstract  float getTireTemperature(Wheel wheel, WheelPart part)
           
abstract  float getTireWear(Wheel wheel)
           
abstract  java.lang.String getTrackName()
           
abstract  float getUnfilteredBrake()
           
abstract  float getUnfilteredClutch()
           
abstract  float getUnfilteredSteering()
           
abstract  float getUnfilteredThrottle()
           
 long getUpdateId()
          This is incremented every time the info is updated.
abstract  java.lang.String getVehicleName()
           
abstract  float getWheelRotation(Wheel wheel)
           
abstract  float getWheelSuspensionDeflection(Wheel wheel)
           
abstract  boolean isAnythingDetached()
           
abstract  boolean isOverheating()
           
abstract  boolean isWheelDetached(Wheel wheel)
           
abstract  boolean isWheelFlat(Wheel wheel)
           
abstract  void loadFromStream(java.io.InputStream in)
           
protected  void onDataUpdated()
          Increments the update ID.
abstract  void writeToStream(java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

_TelemetryDataCapsule

protected _TelemetryDataCapsule()
Method Detail

getBuffer

public abstract byte[] getBuffer()

getUpdateId

public final long getUpdateId()
This is incremented every time the info is updated.

Returns:
the current update id.

onDataUpdated

protected void onDataUpdated()
Increments the update ID.


loadFromStream

public abstract void loadFromStream(java.io.InputStream in)
                             throws java.io.IOException
Throws:
java.io.IOException

writeToStream

public abstract void writeToStream(java.io.OutputStream out)
                            throws java.io.IOException
Throws:
java.io.IOException

getDeltaTime

public abstract float getDeltaTime()
Returns:
time since last update (seconds)

getCurrentLapNumber

public abstract int getCurrentLapNumber()
Returns:
current lap number

getLapStartET

public abstract float getLapStartET()
Returns:
time this lap was started

getVehicleName

public abstract java.lang.String getVehicleName()
Returns:
current vehicle name

getTrackName

public abstract java.lang.String getTrackName()
Returns:
current track name

getPosition

public abstract TelemVect3 getPosition(TelemVect3 position)
world position in meters

Parameters:
position - output buffer
Returns:
the outbut buffer back again.

getPositionX

public abstract float getPositionX()
Returns:
world position in meters

getPositionY

public abstract float getPositionY()
Returns:
world position in meters

getPositionZ

public abstract float getPositionZ()
Returns:
world position in meters

getLocalVelocity

public abstract TelemVect3 getLocalVelocity(TelemVect3 localVel)
velocity (meters/sec) in local vehicle coordinates

Parameters:
localVel - output buffer
Returns:
the output buffer back again.
See Also:
getScalarVelocity()

getScalarVelocity

public abstract float getScalarVelocity()
Returns:
velocity (meters/sec)
See Also:
getLocalVelocity(TelemVect3)

getLocalAcceleration

public abstract TelemVect3 getLocalAcceleration(TelemVect3 localAccel)
acceleration (meters/sec^2) in local vehicle coordinates

Parameters:
localAccel - output buffer
Returns:
the output buffer back again.

getLongitudinalAcceleration

public abstract float getLongitudinalAcceleration()
Returns:
longitudinal acceleration (meters/sec^2)

getLateralAcceleration

public abstract float getLateralAcceleration()
Returns:
lateral acceleration (meters/sec^2)

getOrientationX

public abstract TelemVect3 getOrientationX(TelemVect3 oriX)
top row of orientation matrix (also converts local vehicle vectors into world X using dot product)

Parameters:
oriX - output buffer
Returns:
the output buffer back again.

getOrientationY

public abstract TelemVect3 getOrientationY(TelemVect3 oriY)
mid row of orientation matrix (also converts local vehicle vectors into world Y using dot product)

Parameters:
oriY - output buffer
Returns:
the output buffer back again.

getOrientationZ

public abstract TelemVect3 getOrientationZ(TelemVect3 oriZ)
bot row of orientation matrix (also converts local vehicle vectors into world Z using dot product)

Parameters:
oriZ - output buffer
Returns:
the output buffer back again.

getLocalRotation

public abstract TelemVect3 getLocalRotation(TelemVect3 localRot)
rotation (radians/sec) in local vehicle coordinates

Parameters:
localRot - output buffer
Returns:
the output buffer back again.

getLocalRotationalAcceleration

public abstract TelemVect3 getLocalRotationalAcceleration(TelemVect3 localRotAccel)
rotational acceleration (radians/sec^2) in local vehicle coordinates

Parameters:
localRotAccel - output buffer
Returns:
the output buffer back again.

getCurrentGear

public abstract short getCurrentGear()
Returns:
-1=reverse, 0=neutral, 1+=forward gears

getEngineRPM

public abstract float getEngineRPM()
Returns:
engine RPM

getEngineWaterTemperature

public abstract float getEngineWaterTemperature()
Returns:
Celsius

getEngineOilTemperature

public abstract float getEngineOilTemperature()
Returns:
Celsius

getClutchRPM

public abstract float getClutchRPM()
Returns:
clutch RPM

getUnfilteredThrottle

public abstract float getUnfilteredThrottle()
Returns:
ranges 0.0-1.0

getUnfilteredBrake

public abstract float getUnfilteredBrake()
Returns:
ranges 0.0-1.0

getUnfilteredClutch

public abstract float getUnfilteredClutch()
Returns:
ranges 0.0-1.0

getUnfilteredSteering

public abstract float getUnfilteredSteering()
Returns:
ranges -1.0-1.0 (left to right)

getSteeringArmForce

public abstract float getSteeringArmForce()
Returns:
force on steering arms

getFuel

public abstract float getFuel()
Returns:
amount of fuel (liters)

getEngineMaxRPM

public abstract float getEngineMaxRPM()
Returns:
rev limit

getNumberOfScheduledPitstops

public abstract short getNumberOfScheduledPitstops()
Returns:
number of scheduled pitstops

isOverheating

public abstract boolean isOverheating()
Returns:
whether overheating icon is shown

isAnythingDetached

public abstract boolean isAnythingDetached()
Returns:
whether any parts (besides wheels) have been detached

getDentSevirity

public abstract short[] getDentSevirity()
Returns:
dent severity at 8 locations around the car (0=none, 1=some, 2=more)

getLastImpactTime

public abstract float getLastImpactTime()
Returns:
time of last impact

getLastImpactMagnitude

public abstract float getLastImpactMagnitude()
Returns:
magnitude of last impact

getLastImpactPosition

public abstract TelemVect3 getLastImpactPosition(TelemVect3 lastImpactPos)
location of last impact

Parameters:
lastImpactPos - output buffer
Returns:
the output buffer back again.

getWheelRotation

public abstract float getWheelRotation(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
radians/sec

getWheelSuspensionDeflection

public abstract float getWheelSuspensionDeflection(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
meters

getRideHeight

public abstract float getRideHeight(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
meters

getTireLoad

public abstract float getTireLoad(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
Newtons

getLateralForce

public abstract float getLateralForce(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
Newtons

getGripFraction

public abstract float getGripFraction(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
an approximation of what fraction of the contact patch is sliding

getBrakeTemperature

public abstract float getBrakeTemperature(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
Kelvin

getTirePressure

public abstract float getTirePressure(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
kPa

getTireTemperature

public abstract float getTireTemperature(Wheel wheel,
                                         WheelPart part)
Parameters:
wheel - the requested wheel
part - the requested wheel part
Returns:
Kelvin

getTireWear

public abstract float getTireWear(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
wear (0.0-1.0, fraction of maximum) ... this is not necessarily proportional with grip loss

getTerrainName

public abstract java.lang.String getTerrainName(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
the material prefixes from the TDF file

getSurfaceType

public abstract SurfaceType getSurfaceType(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
surface under the wheel

isWheelFlat

public abstract boolean isWheelFlat(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
whether tire is flat

isWheelDetached

public abstract boolean isWheelDetached(Wheel wheel)
Parameters:
wheel - the requested wheel
Returns:
whether wheel is detached