summaryrefslogtreecommitdiff
path: root/src/tesseract/objects/Particle.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/tesseract/objects/Particle.java')
-rw-r--r--src/tesseract/objects/Particle.java8
1 files changed, 6 insertions, 2 deletions
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;
}
}