summaryrefslogtreecommitdiff
path: root/src/tesseract/objects
diff options
context:
space:
mode:
Diffstat (limited to 'src/tesseract/objects')
-rw-r--r--src/tesseract/objects/Ellipsoid.java3
-rw-r--r--src/tesseract/objects/Particle.java8
-rw-r--r--src/tesseract/objects/PlanarPolygon.java4
3 files changed, 10 insertions, 5 deletions
diff --git a/src/tesseract/objects/Ellipsoid.java b/src/tesseract/objects/Ellipsoid.java
index da6dd79..617bdb8 100644
--- a/src/tesseract/objects/Ellipsoid.java
+++ b/src/tesseract/objects/Ellipsoid.java
@@ -29,7 +29,8 @@ public class Ellipsoid extends PhysicalObject {
/**
* Default mass.
*/
- private static final float DEFAULT_MASS = 1;
+ //private static final float DEFAULT_MASS = Float.POSITIVE_INFINITY;
+ private static final float DEFAULT_MASS = 10;
/**
* Number of divisions in the sphere.
diff --git a/src/tesseract/objects/Particle.java b/src/tesseract/objects/Particle.java
index a5b6029..6dcc864 100644
--- a/src/tesseract/objects/Particle.java
+++ b/src/tesseract/objects/Particle.java
@@ -5,6 +5,7 @@ import java.awt.Color;
import javax.media.j3d.Appearance;
import javax.media.j3d.ColoringAttributes;
import javax.media.j3d.Node;
+import javax.media.j3d.TransformGroup;
import javax.vecmath.Color3f;
import javax.vecmath.Vector3f;
@@ -61,7 +62,7 @@ public class Particle extends PhysicalObject {
* @param theColor The particle color or null for random.
* @return A sphere to visually represent the particle.
*/
- private Node createShape(final Color3f theColor) {
+ private TransformGroup createShape(final Color3f theColor) {
Color3f color = theColor;
ColoringAttributes cAttr;
@@ -74,7 +75,10 @@ public class Particle extends PhysicalObject {
cAttr = new ColoringAttributes(color, ColoringAttributes.FASTEST);
Appearance appearance = new Appearance();
appearance.setColoringAttributes(cAttr);
- return new Sphere(RADIUS, Sphere.ENABLE_GEOMETRY_PICKING | Sphere.GEOMETRY_NOT_SHARED,
+ Sphere sphere = new Sphere(RADIUS, Sphere.ENABLE_GEOMETRY_PICKING | Sphere.GEOMETRY_NOT_SHARED,
DIVISIONS, appearance);
+ TransformGroup tg = new TransformGroup();
+ tg.addChild(sphere);
+ return tg;
}
}
diff --git a/src/tesseract/objects/PlanarPolygon.java b/src/tesseract/objects/PlanarPolygon.java
index 94fb011..5782fa7 100644
--- a/src/tesseract/objects/PlanarPolygon.java
+++ b/src/tesseract/objects/PlanarPolygon.java
@@ -40,8 +40,8 @@ public class PlanarPolygon extends PhysicalObject {
/**
* Default mass.
*/
- //private static final float DEFAULT_MASS = Float.POSITIVE_INFINITY;
- private static final float DEFAULT_MASS = 1;
+ private static final float DEFAULT_MASS = Float.POSITIVE_INFINITY;
+ //private static final float DEFAULT_MASS = 6;
/**
* Number of divisions in the sphere.