demo.helicopter
Class CollisionDetectionTerrainReader

java.lang.Object
  extended bydemo.helicopter.CollisionDetectionTerrainReader

public class CollisionDetectionTerrainReader
extends java.lang.Object


Field Summary
 java.util.Vector data
           
 java.util.Vector index
           
 int[] xCoordIndexArray
           
 double[] xFacetNormal
           
 double[] xValsArray
           
 int[] yCoordIndexArray
           
 double[] yFacetNormal
           
 double[] yValsArray
           
 int[] zCoordIndexArray
           
 double[] zFacetNormal
           
 double[] zValsArray
           
 
Constructor Summary
CollisionDetectionTerrainReader()
           
 
Method Summary
 void calcNormals()
          calcNormals() - calculates the normals from the information from the terrain file
 void createArrayData(java.io.StreamTokenizer st)
          createArrayData() - creates the array data from the data from the input terrain file
 void createFullArray()
          createFullArray() - create complete array of all coordinate data using index information
 boolean extractArrayValues()
          extractArrayValues() - processes each token and puts in vector if its a vertex
 void getNormalHeight(double xCoord, double yCoord, double[] normalHeight)
          getNormalHeight - return normal vector of current location in array indices 0-2 and height in position 3
static void main(java.lang.String[] args)
          Main routine for CollisionDetectionTerrainReader clss
 void parseFile()
          parseFile() - the parsfile for reading the terrain
 void transform()
          transform ()- rotate and translate coordinates into VRML; for rotate about axis v vector where u = normal(v) S = Matrix[(0,-u3,u2) (u3,0,-u1) (-u2,u1,0)] R (rotation matrix) = u*u + cos(alpha)*(Identity -u*u) + sin(alpha)*S then translate VRML into PDU coordinates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xValsArray

public double[] xValsArray

yValsArray

public double[] yValsArray

zValsArray

public double[] zValsArray

xCoordIndexArray

public int[] xCoordIndexArray

yCoordIndexArray

public int[] yCoordIndexArray

zCoordIndexArray

public int[] zCoordIndexArray

xFacetNormal

public double[] xFacetNormal

yFacetNormal

public double[] yFacetNormal

zFacetNormal

public double[] zFacetNormal

data

public java.util.Vector data

index

public java.util.Vector index
Constructor Detail

CollisionDetectionTerrainReader

public CollisionDetectionTerrainReader()
Method Detail

parseFile

public void parseFile()
parseFile() - the parsfile for reading the terrain

Returns:
- void

createArrayData

public void createArrayData(java.io.StreamTokenizer st)
createArrayData() - creates the array data from the data from the input terrain file

Returns:
- void

extractArrayValues

public boolean extractArrayValues()
extractArrayValues() - processes each token and puts in vector if its a vertex

Returns:
boolean if success

transform

public void transform()
transform ()- rotate and translate coordinates into VRML; for rotate about axis v vector where u = normal(v) S = Matrix[(0,-u3,u2) (u3,0,-u1) (-u2,u1,0)] R (rotation matrix) = u*u + cos(alpha)*(Identity -u*u) + sin(alpha)*S then translate VRML into PDU coordinates

Returns:
void

createFullArray

public void createFullArray()
createFullArray() - create complete array of all coordinate data using index information

Returns:
void

calcNormals

public void calcNormals()
calcNormals() - calculates the normals from the information from the terrain file

being used.

Returns:
- void

getNormalHeight

public void getNormalHeight(double xCoord,
                            double yCoord,
                            double[] normalHeight)
getNormalHeight - return normal vector of current location in array indices 0-2 and height in position 3


main

public static void main(java.lang.String[] args)
Main routine for CollisionDetectionTerrainReader clss