summaryrefslogtreecommitdiff
path: root/src/tesseract/objects/tank
diff options
context:
space:
mode:
authorPhillip <pacardon@u.washington.edu>2011-03-14 17:06:12 +0000
committerPhillip <pacardon@u.washington.edu>2011-03-14 17:06:12 +0000
commitfc967a54d875b57599c87e8f6fef520f13b5cb9a (patch)
tree3e4e4dc70f4e77d454b43820ec790b53b29576a2 /src/tesseract/objects/tank
parent3c7fbd589bb5625395c63ce8c1e896b7380f9ccf (diff)
added code to allow for gun emitter.
Diffstat (limited to 'src/tesseract/objects/tank')
-rw-r--r--src/tesseract/objects/tank/Body.java5
-rw-r--r--src/tesseract/objects/tank/Tank.java18
2 files changed, 15 insertions, 8 deletions
diff --git a/src/tesseract/objects/tank/Body.java b/src/tesseract/objects/tank/Body.java
index bd7e0b0..c256d5b 100644
--- a/src/tesseract/objects/tank/Body.java
+++ b/src/tesseract/objects/tank/Body.java
@@ -14,6 +14,8 @@ import javax.media.j3d.TransformGroup;
import javax.vecmath.Color3f;
import javax.vecmath.Vector3f;
+import tesseract.World;
+
import com.sun.j3d.utils.geometry.Box;
import com.sun.j3d.utils.geometry.Cylinder;
import com.sun.j3d.utils.geometry.GeometryInfo;
@@ -32,7 +34,8 @@ public class Body {
private TransformGroup barrel;
private Vector3f[] vectors;
- public Body(Color trackColor, Color bodyColor, float theScale, Color turretColor) {
+
+ public Body(Color trackColor, Color bodyColor, float theScale, Color turretColor, World theWorld) {
body = new TransformGroup();
turret = new TransformGroup();
barrel = new TransformGroup();
diff --git a/src/tesseract/objects/tank/Tank.java b/src/tesseract/objects/tank/Tank.java
index f487ba5..d9975b3 100644
--- a/src/tesseract/objects/tank/Tank.java
+++ b/src/tesseract/objects/tank/Tank.java
@@ -8,6 +8,7 @@ import javax.media.j3d.TransformGroup;
import javax.vecmath.Point3f;
import javax.vecmath.Vector3f;
+import tesseract.World;
import tesseract.objects.remote.RemoteObject;
public class Tank extends RemoteObject {
@@ -26,19 +27,22 @@ public class Tank extends RemoteObject {
private static final int maxBarrelElevation = 14;
private static final int minBarrelElevation = -1;
- public Tank(Vector3f thePosition, float mass) {
- this(thePosition, mass, DEFAULT_SCALE);
+ public Tank(final Vector3f thePosition, final float mass,
+ final World theWorld) {
+ this(thePosition, mass, DEFAULT_SCALE, theWorld);
}
- public Tank(Vector3f thePosition, float mass, float theScale) {
+ public Tank(final Vector3f thePosition, final float mass,
+ final float theScale, final World theWorld) {
this(thePosition, mass, theScale, DEFAULT_BODY_COLOR,
- DEFAULT_TRACK_COLOR, DEFAULT_TURRET_COLOR);
+ DEFAULT_TRACK_COLOR, DEFAULT_TURRET_COLOR, theWorld);
}
- public Tank(Vector3f thePosition, float mass, float theScale,
- Color bodyColor, Color trackColor, Color turretColor) {
+ public Tank(final Vector3f thePosition, final float mass,
+ final float theScale, final Color bodyColor, final Color trackColor,
+ final Color turretColor, final World theWorld) {
super (thePosition, mass);
- tank = new Body(trackColor, bodyColor, theScale, turretColor);
+ tank = new Body(trackColor, bodyColor, theScale, turretColor, theWorld);
//orientation = new Vector3f();
aim = new Vector3f();
gunLocation = new Point3f();