jET
1.0beta1


org.jet.tracks
Class Track

java.lang.Object
  |
  +--org.jet.tracks.Track
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
Switch

public class Track
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

The track entity.

See Also:
Serialized Form

Field Summary
static java.lang.String BANK
          Bank enviroment.
static java.lang.String BRIDGE
          Bridge enviroment.
static java.lang.String CANYON
          Canyon enviroment.
protected  int damage
          Track damage flag.
protected  java.lang.String enviroment
          The enviroment.
static java.lang.String FLAT
          Lowlands enviroment.
protected  double friction
          Friction.
protected  double length
          Track length.
static java.lang.String MOUNTAINS
          Mountains enviroment.
protected  java.lang.String name
          The name.
protected  javax.vecmath.Point3d node1
          1st end point of the track.
protected  javax.vecmath.Point3d node2
          2nd end point of the track.
protected  int quality
          Quality of the track.
protected  double radius
          Radius.
static double ROLL
          Maximal track roll in degrees in PKP.
protected  double roll1
          Roll at 1st point.
protected  double roll2
          Roll at 2nd point.
static java.lang.String SECOND_TEXTURE_DEFAULT
          Default second texture name.
protected  java.lang.String secondTexture
          Second texture.
protected  double tapDistance
          Tap distance.
protected  double texHeight
          Texture height.
protected  double texSlope
          Texture slope.
protected  java.lang.String texture
          Texture.
static java.lang.String TEXTURE_DEFAULT
          Default texture name.
protected  double textureLength
          Texture length.
protected  double texWidth
          Texture width.
static java.lang.String TUNNEL
          Tunnel enviroment.
protected  javax.vecmath.Vector3d vec1
          1st control vector of the track.
protected  javax.vecmath.Vector3d vec2
          2nd control vector of the track.
protected static javax.vecmath.Vector3d VECTOR_ZERO
          Vector zero.
protected  boolean visibility
          Visibility flag.
protected  double width
          Track width.
 
Constructor Summary
Track()
          Constructs new empty track.
Track(javax.vecmath.Point3d node1, javax.vecmath.Point3d node2, javax.vecmath.Vector3d vec1, javax.vecmath.Vector3d vec2)
          Constructs new track with Beizer's curve nodes.
 
Method Summary
 java.lang.Object clone()
          Preformes field-to-field copy.
 boolean equals(java.lang.Object o)
          Equality test.
 int getDamage()
          Gets damage track status.
 java.lang.String getEnviroment()
          Gets track enviroment.
 double getFriction()
          Gets track friction.
 double getIncline()
          Gets the track incline.
 double getLength()
          Gets the track length.
 java.lang.String getName()
          Gets the name for the track.
 javax.vecmath.Point3d getPoint1()
          Gets the 1st point of the Bezier curve.
 javax.vecmath.Point3d getPoint2()
          Gets the 2nd point of the Bezier curve.
 int getQuality()
          Gets quality flags.
 double getRadius()
          Gets track radius.
 double getRoll1()
          Gets the roll at the 1st point.
 double getRoll2()
          Gets the roll at the 2nd point.
 java.lang.String getSecondTexture()
          Gets second texture name
 double getTap()
          Gets track tapping.
 java.lang.String getTexture()
          Gets track texture name.
 double getTextureHeight()
          Gets texture height.
 double getTextureLength()
          Gets texture length.
 double getTextureSlope()
          Gets texture slope.
 double getTextureWidth()
          Gets texture width.
 javax.vecmath.Vector3d getVector1()
          Gets the 1st control vector of the Bezier curve.
 javax.vecmath.Vector3d getVector2()
          Gets the 2nd control vector of the Bezier curve.
 double getWidth()
          Gets track width.
 boolean isStraight()
          Returns true if the track is straight.
 boolean isVisible()
          Returns visibility flag of this track.
 void setDamage(int i)
          Sets damage status.
 void setEnviroment(java.lang.String enviroment)
          Sets enviroment.
 void setFriction(double d)
          Sets track friction.
 void setLength(double d)
          Sets the track length.
 void setName(java.lang.String name)
          Sets the name for the track.
 void setPoint1(double[] array)
          Sets the 1st point of the Bezier curve.
 void setPoint1(double x, double y, double z)
          Sets the 1st point of the Bezier curve.
 void setPoint1(javax.vecmath.Point3d p)
          Sets the 1st point of the Bezier curve.
 void setPoint2(double[] array)
          Sets the 2nd point of the Bezier curve.
 void setPoint2(double x, double y, double z)
          Sets the 2nd point of the Bezier curve.
 void setPoint2(javax.vecmath.Point3d p)
          Sets the 2nd point of the Bezier curve.
 void setQuality(int i)
          Sets quality flags.
 void setRadius(double d)
          Sets track radius.
 void setRoll1(double roll)
          Sets the roll at the 1st point.
 void setRoll2(double roll)
          Sets the roll at the 2nd point.
 void setSecondTexture(java.lang.String name)
          Sets second texture name.
 void setTap(double d)
          Sets track tapping.
 void setTexture(java.lang.String name)
          Sets track texture.
 void setTextureHeight(double d)
          Sets texture height.
 void setTextureLength(double d)
          Sets texture length.
 void setTextureSlope(double d)
          Sets texture slope.
 void setTextureWidth(double d)
          Sets texture width.
 void setVector1(double[] array)
          Sets the 1st control vector of the Bezier curve.
 void setVector1(double x, double y, double z)
          Sets the 1st control vector of the Bezier curve.
 void setVector1(javax.vecmath.Vector3d v)
          Sets the 1st control vector of the Bezier curve.
 void setVector2(double[] array)
          Sets the 2nd control vector of the Bezier curve.
 void setVector2(double x, double y, double z)
          Sets the 2nd control vector of the Bezier curve.
 void setVector2(javax.vecmath.Vector3d v)
          Sets the 2nd control vector of the Bezier curve.
 void setVisible(boolean b)
          Sets visibility flag.
 void setWidth(double d)
          Sets track width.
 java.lang.String toString()
          Gets description.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLAT

public static final java.lang.String FLAT
Lowlands enviroment.

See Also:
Constant Field Values

CANYON

public static final java.lang.String CANYON
Canyon enviroment.

See Also:
Constant Field Values

TUNNEL

public static final java.lang.String TUNNEL
Tunnel enviroment.

See Also:
Constant Field Values

MOUNTAINS

public static final java.lang.String MOUNTAINS
Mountains enviroment.

See Also:
Constant Field Values

BANK

public static final java.lang.String BANK
Bank enviroment.

See Also:
Constant Field Values

BRIDGE

public static final java.lang.String BRIDGE
Bridge enviroment.

See Also:
Constant Field Values

ROLL

public static final double ROLL
Maximal track roll in degrees in PKP.

See Also:
Constant Field Values

TEXTURE_DEFAULT

public static final java.lang.String TEXTURE_DEFAULT
Default texture name.

See Also:
Constant Field Values

SECOND_TEXTURE_DEFAULT

public static final java.lang.String SECOND_TEXTURE_DEFAULT
Default second texture name.

See Also:
Constant Field Values

VECTOR_ZERO

protected static final javax.vecmath.Vector3d VECTOR_ZERO
Vector zero.


name

protected java.lang.String name
The name.


node1

protected javax.vecmath.Point3d node1
1st end point of the track.


node2

protected javax.vecmath.Point3d node2
2nd end point of the track.


vec1

protected javax.vecmath.Vector3d vec1
1st control vector of the track.


vec2

protected javax.vecmath.Vector3d vec2
2nd control vector of the track.


length

protected double length
Track length.


width

protected double width
Track width.


friction

protected double friction
Friction.


tapDistance

protected double tapDistance
Tap distance.


quality

protected int quality
Quality of the track. Values are combination of bits.


damage

protected int damage
Track damage flag. Values are combination of bits.


enviroment

protected java.lang.String enviroment
The enviroment.


visibility

protected boolean visibility
Visibility flag.


texture

protected java.lang.String texture
Texture.


textureLength

protected double textureLength
Texture length.


secondTexture

protected java.lang.String secondTexture
Second texture.


texHeight

protected double texHeight
Texture height.


texWidth

protected double texWidth
Texture width.


texSlope

protected double texSlope
Texture slope.


roll1

protected double roll1
Roll at 1st point.


roll2

protected double roll2
Roll at 2nd point.


radius

protected double radius
Radius. It should be 0 for flex and straight tracks.

Constructor Detail

Track

public Track()
Constructs new empty track.


Track

public Track(javax.vecmath.Point3d node1,
             javax.vecmath.Point3d node2,
             javax.vecmath.Vector3d vec1,
             javax.vecmath.Vector3d vec2)
Constructs new track with Beizer's curve nodes.

Parameters:
node1 - Start point.
node2 - End point.
vec1 - The 1st control vector.
vec2 - The 2nd control vector.
Method Detail

getIncline

public double getIncline()
Gets the track incline.

For flex track it will be not true.


toString

public java.lang.String toString()
Gets description.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Equality test.

Overrides:
equals in class java.lang.Object
Parameters:
o - Object to check.
Returns:
True, if tracks are equal.

clone

public java.lang.Object clone()
Preformes field-to-field copy. It does not copy track name field, so x.clone().equals(x) doesn't return true.

Overrides:
clone in class java.lang.Object

setName

public void setName(java.lang.String name)
Sets the name for the track.

Parameters:
name - The name for the track.

getName

public java.lang.String getName()
Gets the name for the track.

Returns:
The name for track.

getPoint1

public javax.vecmath.Point3d getPoint1()
Gets the 1st point of the Bezier curve.


setPoint1

public void setPoint1(javax.vecmath.Point3d p)
Sets the 1st point of the Bezier curve.


setPoint1

public void setPoint1(double x,
                      double y,
                      double z)
Sets the 1st point of the Bezier curve.


setPoint1

public void setPoint1(double[] array)
Sets the 1st point of the Bezier curve.


getPoint2

public javax.vecmath.Point3d getPoint2()
Gets the 2nd point of the Bezier curve.


setPoint2

public void setPoint2(javax.vecmath.Point3d p)
Sets the 2nd point of the Bezier curve.


setPoint2

public void setPoint2(double x,
                      double y,
                      double z)
Sets the 2nd point of the Bezier curve.


setPoint2

public void setPoint2(double[] array)
Sets the 2nd point of the Bezier curve.


getVector1

public javax.vecmath.Vector3d getVector1()
Gets the 1st control vector of the Bezier curve.


setVector1

public void setVector1(javax.vecmath.Vector3d v)
Sets the 1st control vector of the Bezier curve.


setVector1

public void setVector1(double x,
                       double y,
                       double z)
Sets the 1st control vector of the Bezier curve.


setVector1

public void setVector1(double[] array)
Sets the 1st control vector of the Bezier curve.


getVector2

public javax.vecmath.Vector3d getVector2()
Gets the 2nd control vector of the Bezier curve.


setVector2

public void setVector2(javax.vecmath.Vector3d v)
Sets the 2nd control vector of the Bezier curve.


setVector2

public void setVector2(double x,
                       double y,
                       double z)
Sets the 2nd control vector of the Bezier curve.


setVector2

public void setVector2(double[] array)
Sets the 2nd control vector of the Bezier curve.


getRoll1

public double getRoll1()
Gets the roll at the 1st point.


setRoll1

public void setRoll1(double roll)
Sets the roll at the 1st point.


getRoll2

public double getRoll2()
Gets the roll at the 2nd point.


setRoll2

public void setRoll2(double roll)
Sets the roll at the 2nd point.


getLength

public double getLength()
Gets the track length.


setLength

public void setLength(double d)
Sets the track length.


getWidth

public double getWidth()
Gets track width.


setWidth

public void setWidth(double d)
Sets track width.


getFriction

public double getFriction()
Gets track friction.


setFriction

public void setFriction(double d)
Sets track friction.


getTap

public double getTap()
Gets track tapping.


setTap

public void setTap(double d)
Sets track tapping.


getQuality

public int getQuality()
Gets quality flags.


setQuality

public void setQuality(int i)
Sets quality flags.


getDamage

public int getDamage()
Gets damage track status.


setDamage

public void setDamage(int i)
Sets damage status.


getEnviroment

public java.lang.String getEnviroment()
Gets track enviroment.


setEnviroment

public void setEnviroment(java.lang.String enviroment)
Sets enviroment.


isVisible

public boolean isVisible()
Returns visibility flag of this track.


setVisible

public void setVisible(boolean b)
Sets visibility flag.


getRadius

public double getRadius()
Gets track radius.

Returns:
0, when track is flex or straight.

setRadius

public void setRadius(double d)
Sets track radius.


getTexture

public java.lang.String getTexture()
Gets track texture name.


setTexture

public void setTexture(java.lang.String name)
Sets track texture.

Parameters:
name - Name of the texture.

getTextureLength

public double getTextureLength()
Gets texture length.


setTextureLength

public void setTextureLength(double d)
Sets texture length.


getSecondTexture

public java.lang.String getSecondTexture()
Gets second texture name


setSecondTexture

public void setSecondTexture(java.lang.String name)
Sets second texture name.


getTextureHeight

public double getTextureHeight()
Gets texture height.


setTextureHeight

public void setTextureHeight(double d)
Sets texture height.


getTextureWidth

public double getTextureWidth()
Gets texture width.


setTextureWidth

public void setTextureWidth(double d)
Sets texture width.


getTextureSlope

public double getTextureSlope()
Gets texture slope.


setTextureSlope

public void setTextureSlope(double d)
Sets texture slope.


isStraight

public boolean isStraight()
Returns true if the track is straight.


jET
1.0beta1