From fc967a54d875b57599c87e8f6fef520f13b5cb9a Mon Sep 17 00:00:00 2001 From: Phillip Date: Mon, 14 Mar 2011 17:06:12 +0000 Subject: added code to allow for gun emitter. --- src/tesseract/objects/tank/Body.java | 5 ++++- src/tesseract/objects/tank/Tank.java | 18 +++++++++++------- 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(); -- cgit v1.2.3