diff options
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); } } |