summaryrefslogtreecommitdiff
path: root/src/tesseract/World.java
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2011-02-15 07:47:48 +0000
committerJesse Morgan <jesse@jesterpm.net>2011-02-15 07:47:48 +0000
commit82f9b5c81896cbd62c84df89df839c497a3e2ebc (patch)
tree1be29a729827174d23c16fafc8722e3dbd8f2283 /src/tesseract/World.java
parent86c52a6002e696ebe9ef4628306431d2f22d3eb1 (diff)
Win! Got some very basic grabbing and moving implemented. Found the Node object's amazing get/setUserData method. I had a brillant hunch such a method may exist. The mouse movements need to be scaled to the vworld coordinates though.
Diffstat (limited to 'src/tesseract/World.java')
-rw-r--r--src/tesseract/World.java35
1 files changed, 2 insertions, 33 deletions
diff --git a/src/tesseract/World.java b/src/tesseract/World.java
index 9b43b87..e898a27 100644
--- a/src/tesseract/World.java
+++ b/src/tesseract/World.java
@@ -37,12 +37,7 @@ public class World {
* Root element of the world.
*/
private BranchGroup myScene;
-
- /**
- * Pickable Objects.
- */
- private BranchGroup myPickableObjects;
-
+
/**
* Bounding box of the world.
*/
@@ -97,11 +92,6 @@ public class World {
myScene.addChild(createVirtualWorldBoundsShape());
- myPickableObjects = new BranchGroup();
- myPickableObjects.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
- myPickableObjects.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
- //myScene.addChild(myPickableObjects);
-
addLights();
addHalfspaces();
@@ -238,33 +228,12 @@ public class World {
}
/**
- * Setup mouse behaviors in the world.
- *
- * @param canvas The canvas to tie the events to.
- */
- public void setupMouseBehaviors(final Canvas3D canvas) {
- //BranchGroup pickables = new BranchGroup();
- myPickableObjects.addChild(new PickTranslateBehavior(myPickableObjects, canvas, myVirtualWorldBounds, PickTool.GEOMETRY));
- myPickableObjects.addChild(new PickZoomBehavior(myPickableObjects, canvas, myVirtualWorldBounds, PickTool.GEOMETRY));
- myScene.addChild(myPickableObjects);
-
- /*myPickableObjects.addChild(
- new PickTranslateBehavior(myPickableObjects, canvas,
- myVirtualWorldBounds, PickTool.GEOMETRY));
-
- myPickableObjects.addChild(
- new PickZoomBehavior(myPickableObjects, canvas,
- myVirtualWorldBounds, PickTool.GEOMETRY));
- */
- }
-
- /**
* Add a new object to the world.
*
* @param obj The object to add
*/
public void addObject(final PhysicalObject obj) {
- myPickableObjects.addChild(obj.getGroup());
+ myScene.addChild(obj.getGroup());
myObjects.add(obj);
}