diff options
author | Joshua Slack <[email protected]> | 2017-06-02 19:02:23 -0500 |
---|---|---|
committer | Joshua Slack <[email protected]> | 2017-06-02 19:02:23 -0500 |
commit | cbc61566689660d39f469efe4c429f8adf5b239e (patch) | |
tree | 7f4811bc04e605f25643d645337f553960b35ba0 /ardor3d-extras | |
parent | 67d620baf5eaf5b0ce66800e468719a9ef79ef25 (diff) |
Updates to allow overriding SpatialState in InteractManager.
Updates to allow easier overriding of input flow in UIHud.
Added new example tying together UI and Interact
Diffstat (limited to 'ardor3d-extras')
-rw-r--r-- | ardor3d-extras/src/main/java/com/ardor3d/extension/interact/InteractManager.java | 8 | ||||
-rw-r--r-- | ardor3d-extras/src/main/java/com/ardor3d/extension/interact/data/SpatialState.java | 12 |
2 files changed, 7 insertions, 13 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 f855cb3..447a226 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 @@ -61,7 +61,7 @@ public class InteractManager { /** * Spatial state tracking. */ - protected SpatialState _state = new SpatialState(); + protected final SpatialState _state; /** * List of filters to modify state prior to applying to a Spatial target. @@ -69,6 +69,12 @@ public class InteractManager { protected List<UpdateFilter> _filters = Lists.newArrayList(); public InteractManager() { + _state = new SpatialState(); + setupLogicalLayer(); + } + + public InteractManager(final SpatialState stateTracking) { + _state = stateTracking; setupLogicalLayer(); } 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 2364e25..e3918d1 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 @@ -16,36 +16,24 @@ 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 copyState(final Spatial source) { _transform.set(source.getTransform()); - _userData = source.getUserData(); } public void applyState(final Spatial target) { target.setTransform(_transform); - target.setUserData(_userData); } } |