aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-extras/src/main
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2018-01-27 11:05:12 +0100
committerJulien Gouesse <[email protected]>2018-01-27 11:05:12 +0100
commit965609875a87c494a17298ea56e98f9f55c8cc40 (patch)
tree47d5fae322fe9e2899c064d7308c028f5db04be6 /ardor3d-extras/src/main
parentd22ba73c8a7d160a792cf41b7f51399b5fa52107 (diff)
parent240660efaeb9117a50f2e9cca0a7153e500490b3 (diff)
Merges Renanse's commit 240660efaeb9117a50f2e9cca0a7153e500490b3
Diffstat (limited to 'ardor3d-extras/src/main')
-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);
}
}