From 56202867485f63b7983801ac529053472f9d739d Mon Sep 17 00:00:00 2001 From: quazi-irfan Date: Mon, 18 Mar 2019 00:36:33 -0500 Subject: [PATCH 1/3] Add getSpatial to GhostControl, RigidBodyControl, AbstractPhysicsControl and CharacterControl. Fix issue 1008 --- .../com/jme3/bullet/control/AbstractPhysicsControl.java | 7 +++++++ .../java/com/jme3/bullet/control/CharacterControl.java | 7 +++++++ .../common/java/com/jme3/bullet/control/GhostControl.java | 7 +++++++ .../java/com/jme3/bullet/control/RigidBodyControl.java | 7 +++++++ 4 files changed, 28 insertions(+) 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..59bc5c19ae 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 spatial attached to the control. + */ + 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..dcacced079 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 spatial attached to the control. + */ + 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..e871369ff5 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 spatial attached to the control. + */ + 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..f900317bff 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 spatial attached to the control. + */ + public Spatial getSpatial(){ + return this.spatial; + } + /** * Set the collision shape based on the controlled spatial and its * descendents. From 4e1e91472d3708ebc7a21e26cae9847229f8033a Mon Sep 17 00:00:00 2001 From: quazi-irfan Date: Mon, 18 Mar 2019 01:10:05 -0500 Subject: [PATCH 2/3] Fix doc: control is attached to spatial. Not the other way around. --- .../java/com/jme3/bullet/control/AbstractPhysicsControl.java | 2 +- .../common/java/com/jme3/bullet/control/CharacterControl.java | 2 +- .../src/common/java/com/jme3/bullet/control/GhostControl.java | 2 +- .../common/java/com/jme3/bullet/control/RigidBodyControl.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 59bc5c19ae..70a3c9595a 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 @@ -247,7 +247,7 @@ public void setSpatial(Spatial spatial) { } /** - * @return returns spatial attached to the control. + * @return returns the spatial the control is attached to.. */ public Spatial getSpatial(){ return this.spatial; 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 dcacced079..4771e53cd7 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 @@ -130,7 +130,7 @@ public void setSpatial(Spatial spatial) { } /** - * @return returns spatial attached to the control. + * @return returns the spatial the control is attached to.. */ public Spatial getSpatial(){ return this.spatial; 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 e871369ff5..6372a6624b 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 @@ -207,7 +207,7 @@ public void setSpatial(Spatial spatial) { } /** - * @return returns spatial attached to the control. + * @return returns the spatial the control is attached to.. */ public Spatial getSpatial(){ return this.spatial; 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 f900317bff..341e807997 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 @@ -208,7 +208,7 @@ public void setSpatial(Spatial spatial) { } /** - * @return returns spatial attached to the control. + * @return returns the spatial the control is attached to.. */ public Spatial getSpatial(){ return this.spatial; From cd3246cbc733e481ae7316b25523a10521b656f5 Mon Sep 17 00:00:00 2001 From: quazi-irfan Date: Mon, 18 Mar 2019 01:34:34 -0500 Subject: [PATCH 3/3] Update doc: Clarify what getSpatial returns --- .../java/com/jme3/bullet/control/AbstractPhysicsControl.java | 2 +- .../common/java/com/jme3/bullet/control/CharacterControl.java | 2 +- .../src/common/java/com/jme3/bullet/control/GhostControl.java | 2 +- .../common/java/com/jme3/bullet/control/RigidBodyControl.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 70a3c9595a..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 @@ -247,7 +247,7 @@ public void setSpatial(Spatial spatial) { } /** - * @return returns the spatial the control is attached to.. + * @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; 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 4771e53cd7..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 @@ -130,7 +130,7 @@ public void setSpatial(Spatial spatial) { } /** - * @return returns the spatial the control is attached to.. + * @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; 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 6372a6624b..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 @@ -207,7 +207,7 @@ public void setSpatial(Spatial spatial) { } /** - * @return returns the spatial the control is attached to.. + * @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; 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 341e807997..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 @@ -208,7 +208,7 @@ public void setSpatial(Spatial spatial) { } /** - * @return returns the spatial the control is attached to.. + * @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;