summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip <pacardon@u.washington.edu>2011-03-16 05:16:01 +0000
committerPhillip <pacardon@u.washington.edu>2011-03-16 05:16:01 +0000
commitda7f3615f6a63a9ef6422a80de048c58d77e19a6 (patch)
tree2d6227c5c5bc2fa85d0d9f14fdd52d7d32c4a67b
parentdc261a5f076230f30db871cbaa3e246f0c1b7068 (diff)
added ability to scale size of Modifyable article
-rw-r--r--src/tesseract/objects/ModifyableParticle.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tesseract/objects/ModifyableParticle.java b/src/tesseract/objects/ModifyableParticle.java
index 68139a4..35b0006 100644
--- a/src/tesseract/objects/ModifyableParticle.java
+++ b/src/tesseract/objects/ModifyableParticle.java
@@ -50,6 +50,7 @@ public class ModifyableParticle extends PhysicalObject {
private Color3f myColor;
private boolean kidsSpawned;
+ private float myScale;
/**
* Create a new Particle.
@@ -58,8 +59,9 @@ public class ModifyableParticle extends PhysicalObject {
* @param color Initial color. Null for random.
*/
public ModifyableParticle(final Vector3f position, final float mass, final Color3f color, final TransformGroup top,
- final TransformGroup bottom) {
+ final TransformGroup bottom, final float theScale) {
super(position, mass);
+ myScale = theScale;
myTop = (TransformGroup) top.cloneTree();
myBottom = getBottom(myTop);
myMass = mass;
@@ -102,7 +104,7 @@ public class ModifyableParticle extends PhysicalObject {
DIVISIONS, appearance);
*/
- Sphere sphere = new Sphere(RADIUS, Sphere.ENABLE_GEOMETRY_PICKING,
+ Sphere sphere = new Sphere(RADIUS * myScale * 8, Sphere.ENABLE_GEOMETRY_PICKING,
DIVISIONS);
Shape3D shape = sphere.getShape();
sphere.removeAllChildren();
@@ -117,8 +119,8 @@ public class ModifyableParticle extends PhysicalObject {
}
public void setAcceleration(Vector3f accelerator) {
- accelerator.y -= 0.0118 * 2;
- accelerator.scale(15f);
+ //accelerator.y -= 0.0118 * 2;
+ accelerator.scale(1f / myScale);
this.velocity = accelerator;
}