diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java index f858d0e00e..739701d9fc 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java @@ -246,6 +246,13 @@ public void setSpatial(Spatial spatial) { setPhysicsRotation(getSpatialRotation()); } + /** + * @return returns the spatial the control is added to, or null if the control is not attached to a spatial yet. + */ + public Spatial getSpatial(){ + return this.spatial; + } + /** * Enable or disable this control. *

diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java index e34b5b3b6e..2ee7fbe622 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java @@ -129,6 +129,13 @@ public void setSpatial(Spatial spatial) { setPhysicsLocation(getSpatialTranslation()); } + /** + * @return returns the spatial the control is added to, or null if the control is not attached to a spatial yet. + */ + public Spatial getSpatial(){ + return this.spatial; + } + public void setEnabled(boolean enabled) { this.enabled = enabled; if (space != null) { diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java index 7ff51670d2..ca3fc72543 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java @@ -206,6 +206,13 @@ public void setSpatial(Spatial spatial) { setPhysicsRotation(getSpatialRotation()); } + /** + * @return returns the spatial the control is added to, or null if the control is not attached to a spatial yet. + */ + public Spatial getSpatial(){ + return this.spatial; + } + /** * Enable or disable this control. *

diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java index 4094ab4dbc..cee3401e1a 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java @@ -207,6 +207,13 @@ public void setSpatial(Spatial spatial) { setPhysicsRotation(getSpatialRotation()); } + /** + * @return returns the spatial the control is added to, or null if the control is not attached to a spatial yet. + */ + public Spatial getSpatial(){ + return this.spatial; + } + /** * Set the collision shape based on the controlled spatial and its * descendents.