diff options
author | Steve <steveb9@u.washington.edu> | 2011-02-12 08:09:38 +0000 |
---|---|---|
committer | Steve <steveb9@u.washington.edu> | 2011-02-12 08:09:38 +0000 |
commit | d1df88907d55240e79ee8597f6032a4c0de6b957 (patch) | |
tree | be36bc4395e2c6b407ae5da43bd4080d5b41e9d0 /src/tesseract/objects/Particle.java | |
parent | e258cf11dc077ee2addb748636481c3ad8a27c72 (diff) |
Added a gravity submenu (doesn't turn off yet)
Added empty ChainLinkMenuItem class
set the planar Poly to pos infinte mass for testing
Particles fall through but others don't, if particles are big enough they collide though
Diffstat (limited to 'src/tesseract/objects/Particle.java')
-rw-r--r-- | src/tesseract/objects/Particle.java | 8 |
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; } } |