From 67d620baf5eaf5b0ce66800e468719a9ef79ef25 Mon Sep 17 00:00:00 2001 From: Joshua Slack Date: Wed, 31 May 2017 11:13:52 -0500 Subject: Added code to ensure margin and border use considers possibility of null. Added copying of userData in SpatialState --- .../main/java/com/ardor3d/extension/interact/InteractManager.java | 2 +- .../main/java/com/ardor3d/extension/interact/data/SpatialState.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'ardor3d-extras/src/main/java/com') 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); -- cgit v1.2.3