aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-extras
diff options
context:
space:
mode:
authorJoshua Slack <[email protected]>2017-05-31 11:13:52 -0500
committerJoshua Slack <[email protected]>2017-05-31 11:13:52 -0500
commit67d620baf5eaf5b0ce66800e468719a9ef79ef25 (patch)
treec6fe49acf47c6995571cfcdd15590418e5845960 /ardor3d-extras
parent240660efaeb9117a50f2e9cca0a7153e500490b3 (diff)
Added code to ensure margin and border use considers possibility of null. Added copying of userData in SpatialState
Diffstat (limited to 'ardor3d-extras')
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/interact/InteractManager.java2
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java5
2 files changed, 6 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 e55c63a..f855cb3 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
@@ -130,7 +130,7 @@ public class InteractManager {
}, new TriggerAction() {
public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
if (_spatialTarget != null) {
- _state.getTransform().set(_spatialTarget.getTransform());
+ _state.copyState(_spatialTarget);
}
_inputConsumed.set(false);
offerInputToWidgets(source, inputStates);
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 b9aaae4..2364e25 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
@@ -38,6 +38,11 @@ public class SpatialState {
_userData = userData;
}
+ public void copyState(final Spatial source) {
+ _transform.set(source.getTransform());
+ _userData = source.getUserData();
+ }
+
public void applyState(final Spatial target) {
target.setTransform(_transform);
target.setUserData(_userData);