diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2011-02-16 08:12:56 +0000 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2011-02-16 08:12:56 +0000 |
commit | 350a482b32512191596daad55104beec98af9981 (patch) | |
tree | 34967e2dd86b18a78a3ea0f8316a502a1e8637d3 /src/alden/Sphere.java | |
parent | 5e9f617bdfea01d0bd5e66daf7a5e55f8f94dbf0 (diff) |
Added alden's code, moved his objects into the object class and made them extend physical object. Fixed a node selection problem in TesseractUI.
Diffstat (limited to 'src/alden/Sphere.java')
-rw-r--r-- | src/alden/Sphere.java | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/alden/Sphere.java b/src/alden/Sphere.java deleted file mode 100644 index ddbaff4..0000000 --- a/src/alden/Sphere.java +++ /dev/null @@ -1,35 +0,0 @@ -package alden;
-
-import javax.media.j3d.*;
-import javax.vecmath.*;
-
-@SuppressWarnings("restriction")
-public class Sphere extends CollidableObject {
- protected float radius;
-
- public Sphere(float radius, Vector3f position) {
- this(1, radius, position);
- }
-
- public Sphere(float mass, float radius, Vector3f position) {
- super(mass);
- setShape(createShape(radius, 22));
- this.radius = radius;
- this.position.set(position);
- if (inverseMass != 0) {
- inverseInertiaTensor.m00 = 2f / 5 / inverseMass * radius * radius;
- inverseInertiaTensor.m11 = inverseInertiaTensor.m00;
- inverseInertiaTensor.m22 = inverseInertiaTensor.m00;
- inverseInertiaTensor.invert();
- }
- updateTransformGroup();
- }
-
- protected Node createShape(float radius, int divisions) {
- Appearance appearance = new Appearance();
- Material material = new Material();
- material.setDiffuseColor(0.7f, 0.7f, 1);
- appearance.setMaterial(material);
- return new com.sun.j3d.utils.geometry.Sphere(radius, com.sun.j3d.utils.geometry.Sphere.GENERATE_NORMALS, divisions, appearance);
- }
-}
|