Class Cannon

java.lang.Object
  extended by java.lang.Thread
      extended by Cannon
All Implemented Interfaces:
java.lang.Runnable

public class Cannon
extends java.lang.Thread

Title: Cannon Description: Final project for MV-4472, Physically-based modeling. This project models the motion of a projectile. Through an instantiation of the 'InputPanel' class, it allows the user to alter the initial firing angle & velocity, as well as the the direction and velocity of any influencing wind. Also, air density and variable density (due to altitude changes) can be selected for application in the model. The resulting motion model will be depicted on an instantiation of the 'Display' class. This class is designed to work with the CannonProjectII.wrl vrml model. By selecting the 'enable vrml interface' button, an instantiation of the ProjectileDISSender class will be created that will be used to transmit state packets to the .wrl file, allowing the the resulting projectile motion to be visible via 3D. The physics for this model(with the exception of wind) is based on those in the 'Computational Physics' textbook by Nicholas J. Giordano. The following assumptions apply: - b2m is based on a projectile of approximately 10 cm in diameter, this value corresponds to the approximate drag coefficient experienced by the projectile - Wind affects the model as follows constant effect throughout range of projectile the effects of wind are not affected by drag the head/tail component of the wind on the projectile are taken into account for determining the drag affect on the projectile's velocity Future work: - add descriptive lables to the display graphs - allow VRML scene control of the model - altering howitzer's turret/barrel alters the direction and angle of fire - use a touch sensor to fire the projectile - allow altering of angle in input panel to alter the barrel elevation Copyright: Copyright (c) 2002


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Cannon()
          The constructor
 
Method Summary
 void changeAngle(int angle)
           
 void clearDisplay()
          clears the display
 void enableVRML(boolean setting)
          Used to enable the VRMl interface
 void fireCannon(int initVel, int a, int wD, double wV)
          Initiates the projectile motion based on the provided information
static void main(java.lang.String[] args)
          The main method that starts it all
 void setChangingDensities(boolean setting)
          used to indicate if changing densities is to be included in the current model
 void setDrag(boolean setting)
          Used to indicate if drag is to be included in the current model
 void setScaleFactor(int scale)
          Used to alter the scale factor for the motion data
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cannon

public Cannon()
The constructor

Method Detail

fireCannon

public void fireCannon(int initVel,
                       int a,
                       int wD,
                       double wV)
Initiates the projectile motion based on the provided information

Parameters:
initVel - The initial velocity in Meters/second
a - The firing angle in degrees
wD - The wind direction
wV - The wind velocity

clearDisplay

public void clearDisplay()
clears the display


setDrag

public void setDrag(boolean setting)
Used to indicate if drag is to be included in the current model


setChangingDensities

public void setChangingDensities(boolean setting)
used to indicate if changing densities is to be included in the current model


enableVRML

public void enableVRML(boolean setting)
Used to enable the VRMl interface


setScaleFactor

public void setScaleFactor(int scale)
Used to alter the scale factor for the motion data


changeAngle

public void changeAngle(int angle)

main

public static void main(java.lang.String[] args)
The main method that starts it all