|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ctdp.rfdynhud.gamedata.Track
public class Track
Model of a track with waypoints and utility methods
Nested Class Summary | |
---|---|
protected static class |
Track.Waypoint
|
Constructor Summary | |
---|---|
protected |
Track(Track.Waypoint[] waypointsTrack,
Track.Waypoint[] waypointsPitlane,
float sector1Length,
float sector2Length,
float trackLength,
float pitlaneLength,
float minXPos,
float maxXPos,
float minYPos,
float maxYPos,
float minZPos,
float maxZPos,
float maxWidth)
|
Method Summary | |
---|---|
float |
getInterpolatedAngleToRoad(ScoringInfo scoringInfo)
Gets the interpolated angle of the viewed vehicle to the road. |
void |
getInterpolatedPosition(boolean pitlane,
float trackDistance,
float scale,
java.awt.geom.Point2D.Float point)
|
boolean |
getInterpolatedVector(boolean pitlane,
float trackDistance,
TelemVect3 vector)
Gets an interpolated vector along the track at the given waypoint. |
int |
getMaxTrackWidth(float scale)
Gets the maximum track width. |
float |
getMinXPos()
|
float |
getMinYPos()
|
float |
getMinZPos()
|
int |
getNumWaypoints(boolean pitlane)
Gets the number of waypoints of the main track or the pitlane. |
float |
getPitlaneLength()
|
float |
getScale(int targetWidth,
int targetHeight)
Calculates a scale factor for all values, if the track should be drawn on the given size. |
float |
getSector1Length()
Gets the length of sector 1 in meters. |
float |
getSector2Length(boolean includingSector1)
Gets the length of sector 2 in meters. |
float |
getSector3Length()
Gets the length of sector 3 in meters. |
float |
getTrackLength()
Gets the track length in meters. |
void |
getWaypointPosition(boolean pitlane,
int waypointIndex,
float scale,
java.awt.Point point)
|
void |
getWaypointPosition(boolean pitlane,
int waypointIndex,
float scale,
java.awt.geom.Point2D.Float point)
|
void |
getWaypointPosition(boolean pitlane,
int waypointIndex,
TelemVect3 position)
Gets the waypoint's position. |
byte |
getWaypointSector(boolean pitlane,
int waypointIndex)
Gets the sector, the requested waypoint is in. |
void |
getWaypointVector(boolean pitlane,
int waypointIndex,
java.awt.geom.Point2D.Float vector)
|
int |
getXExtend(float scale)
Gets the extend along the x axis. |
int |
getYExtend(float scale)
Gets the extend along the y axis. |
int |
getZExtend(float scale)
Gets the extend along the z axis. |
protected static net.ctdp.rfdynhud.gamedata.Track.ParseContainer |
parseAIW(java.io.File aiw)
|
static Track |
parseTrackFromAIW(java.io.File aiw)
Parses an AIW file and returns a Track instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Track(Track.Waypoint[] waypointsTrack, Track.Waypoint[] waypointsPitlane, float sector1Length, float sector2Length, float trackLength, float pitlaneLength, float minXPos, float maxXPos, float minYPos, float maxYPos, float minZPos, float maxZPos, float maxWidth)
Method Detail |
---|
public final float getSector1Length()
public final float getSector2Length(boolean includingSector1)
includingSector1
-
public final float getSector3Length()
public final float getTrackLength()
public final float getPitlaneLength()
public final float getMinXPos()
public final float getMinYPos()
public final float getMinZPos()
public float getScale(int targetWidth, int targetHeight)
targetWidth
- the target width to draw ontargetHeight
- the target height to draw on
public final int getXExtend(float scale)
scale
- the scale. See getScale(int, int)
public final int getYExtend(float scale)
scale
- the scale. See getScale(int, int)
public final int getZExtend(float scale)
scale
- the scale. See getScale(int, int)
public final int getMaxTrackWidth(float scale)
scale
- the scale. See getScale(int, int)
public final int getNumWaypoints(boolean pitlane)
pitlane
- waypoints of main track or pitlane?
public final byte getWaypointSector(boolean pitlane, int waypointIndex)
pitlane
- waypoint of main track or pitlane?waypointIndex
- the index of the waypoint
public final void getWaypointPosition(boolean pitlane, int waypointIndex, TelemVect3 position)
pitlane
- waypoint of main track or pitlane?waypointIndex
- the index of the waypointposition
- output bufferpublic final void getWaypointPosition(boolean pitlane, int waypointIndex, float scale, java.awt.Point point)
pitlane
- waypoint of main track or pitlane?waypointIndex
- the index of the waypointscale
- the scale. See getScale(int, int)
point
- output bufferpublic final void getWaypointPosition(boolean pitlane, int waypointIndex, float scale, java.awt.geom.Point2D.Float point)
pitlane
- waypoint of main track or pitlane?waypointIndex
- the index of the waypointscale
- the scale. See getScale(int, int)
point
- output bufferpublic final void getWaypointVector(boolean pitlane, int waypointIndex, java.awt.geom.Point2D.Float vector)
pitlane
- waypoint of main track or pitlane?waypointIndex
- the index of the waypointvector
- output bufferpublic final void getInterpolatedPosition(boolean pitlane, float trackDistance, float scale, java.awt.geom.Point2D.Float point)
pitlane
- waypoint of main track or pitlane?trackDistance
- the distance along the track in metersscale
- the scale. See getScale(int, int)
point
- output bufferpublic final boolean getInterpolatedVector(boolean pitlane, float trackDistance, TelemVect3 vector)
pitlane
- waypoint of main track or pitlane?trackDistance
- the distance along the track in metersvector
- output buffer
public final float getInterpolatedAngleToRoad(ScoringInfo scoringInfo)
scoringInfo
-
protected static net.ctdp.rfdynhud.gamedata.Track.ParseContainer parseAIW(java.io.File aiw) throws java.io.IOException
java.io.IOException
public static Track parseTrackFromAIW(java.io.File aiw) throws java.io.IOException
Track
instance.
aiw
- the AIW file to parse
Track
instance for the parsed AIW file.
java.io.IOException
- if there's something wrong with the file (missing, not readable, etc.).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |