From 525ae2426f46d2b5380b0153f3f2bba836f02ab8 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 21 Feb 2011 01:33:58 +0000 Subject: Comment cleanup --- src/tesseract/objects/Ellipsoid.java | 19 +++++++------------ src/tesseract/objects/PlanarPolygon.java | 27 +++++++-------------------- 2 files changed, 14 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/tesseract/objects/Ellipsoid.java b/src/tesseract/objects/Ellipsoid.java index 3a617c0..52948e9 100644 --- a/src/tesseract/objects/Ellipsoid.java +++ b/src/tesseract/objects/Ellipsoid.java @@ -37,11 +37,7 @@ public class Ellipsoid extends PhysicalObject { */ private static final int DEFAULT_DIVISIONS = 50; - /** - * The radius of the base sphere - */ - private float my_radius; - + /** * Create a new Ellipsoid. * @@ -59,8 +55,6 @@ public class Ellipsoid extends PhysicalObject { final Appearance appearance, final float b, final float c) { super(position, mass); - my_radius = radius; - setShape(createShape(radius, primflags, appearance, divisions, b, c)); final float rSq = radius * radius; @@ -86,8 +80,6 @@ public class Ellipsoid extends PhysicalObject { final float radius) { super(position, mass); - my_radius = radius; - final float rSq = radius * radius; final float a = 1.0f; final float b = 1.0f; @@ -114,8 +106,6 @@ public class Ellipsoid extends PhysicalObject { public Ellipsoid(final Vector3f position, final float radius) { super(position, DEFAULT_MASS); - my_radius = radius; - final float rSq = radius * radius; final float a = 1.0f; final float b = 1.0f; @@ -135,7 +125,11 @@ public class Ellipsoid extends PhysicalObject { /** * This creates a default Ellipsoid for the 2 argument constructor. - * @param radius the siz of the ellipsoid + * @param radius the size of the ellipsoid + * @param a float in the ellipsoid formula. + * @param b float in the ellipsoid formula. + * @param c float in the ellipsoid formula. + * @return TransformGroup with the shape. */ private TransformGroup createDefaultEllipsoid(final float radius, final float a, final float b, final float c) { @@ -160,6 +154,7 @@ public class Ellipsoid extends PhysicalObject { * @param divisions an int for the number of divisons * @param b a float for the y axis transform * @param c a float for the z axis transfrom + * @return TransformGroup with the shape. */ private TransformGroup createShape(final float radius, final int primflags, final Appearance appearance, final int divisions, final float b, diff --git a/src/tesseract/objects/PlanarPolygon.java b/src/tesseract/objects/PlanarPolygon.java index 30eac77..53bcf04 100644 --- a/src/tesseract/objects/PlanarPolygon.java +++ b/src/tesseract/objects/PlanarPolygon.java @@ -8,7 +8,6 @@ package tesseract.objects; import javax.media.j3d.Appearance; import javax.media.j3d.Geometry; -import javax.media.j3d.Group; import javax.media.j3d.ImageComponent2D; import javax.media.j3d.Material; import javax.media.j3d.Node; @@ -16,27 +15,20 @@ import javax.media.j3d.PolygonAttributes; import javax.media.j3d.Shape3D; import javax.media.j3d.Texture; import javax.media.j3d.Texture2D; -import javax.media.j3d.Transform3D; import javax.media.j3d.TriangleFanArray; -import javax.vecmath.Matrix3f; -import javax.vecmath.Matrix4f; import javax.vecmath.Point3f; import javax.vecmath.TexCoord2f; import javax.vecmath.Vector3f; import com.sun.j3d.utils.geometry.GeometryInfo; import com.sun.j3d.utils.geometry.NormalGenerator; -import com.sun.j3d.utils.geometry.Sphere; import com.sun.j3d.utils.image.TextureLoader; /** - * This class creates an ellipsoid using the formula - * (x/a)^2 + (y/b)^2 + (z/c)^2 = 1 using a matrix3f transformation - * on a basic Sphere. This class sets 'a' to a constant 1.0 and allows - * 'b' and 'c' to alter the ellipsoid's shape along with the radius field - * Sphere. Since this is a sphere, the normals are already calculated. + * This class creates an planar polygon using Mathew Aldens design + * of a circle, but this adds lava texture and lower divisions * - * @author Steve Bradshaw + * @author Steve Bradshaw & Mathew Alden * @version 8 Feb 2011 */ public class PlanarPolygon extends PhysicalObject { @@ -45,11 +37,6 @@ public class PlanarPolygon extends PhysicalObject { * Default mass. */ private static final float DEFAULT_MASS = Float.POSITIVE_INFINITY; - //private static final float DEFAULT_MASS = 6; - - public Vector3f normal; - // Right-hand side of the plane equation: Ax + By + Cz = D - public float intercept; /** * Number of divisions in the sphere. @@ -107,11 +94,11 @@ public class PlanarPolygon extends PhysicalObject { /** * This method creates a planar polygon shape with lava texture. * - * @param radius a float for the size of the base polygon - * @param divisions an int for the number of divisons - * @param appearance an Appearance object + * @param radius a float for the size of the base polygon. + * @param divisions an int for the number of divisons. + * @param appearance an Appearance object. + * @return Node a polygon. */ - private Node createShape(final float radius, final int divisions) { TriangleFanArray geometry = new TriangleFanArray(divisions, TriangleFanArray.COORDINATES | TriangleFanArray.TEXTURE_COORDINATE_2, new int[] {divisions}); -- cgit v1.2.3