aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/interact/InteractManager.java6
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java13
2 files changed, 18 insertions, 1 deletions
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/InteractManager.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/InteractManager.java
index b40bebd..9c144e9 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/InteractManager.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/InteractManager.java
@@ -207,7 +207,13 @@ public class InteractManager {
}
public void setActiveWidget(final AbstractInteractWidget widget) {
+ if (_activeWidget != null) {
+ _activeWidget.lostControl(this);
+ }
_activeWidget = widget;
+ if (_activeWidget != null) {
+ _activeWidget.receivedControl(this);
+ }
}
public AbstractInteractWidget getActiveWidget() {
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java
index 4bed764..7ede192 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java
@@ -3,7 +3,7 @@
*
* This file is part of Ardor3D.
*
- * Ardor3D is free software: you can redistribute it and/or modify it
+ * Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/
@@ -16,20 +16,31 @@ import com.ardor3d.scenegraph.Spatial;
public class SpatialState {
protected Transform _transform = new Transform();
+ protected Object _userData = null;
public SpatialState() {}
/** copy constructor */
public SpatialState(final SpatialState toCopy) {
_transform.set(toCopy._transform);
+ _userData = toCopy._userData;
}
public Transform getTransform() {
return _transform;
}
+ public Object getUserData() {
+ return _userData;
+ }
+
+ public void setUserData(final Object userData) {
+ _userData = userData;
+ }
+
public void applyState(final Spatial target) {
target.setTransform(_transform);
+ target.setUserData(_userData);
}
}