Add getSpatial to GhostControl, RigidBodyControl, AbstractPhysicsCont… (#1041)
* Add getSpatial to GhostControl, RigidBodyControl, AbstractPhysicsControl and CharacterControl. Fix issue 1008 * Fix doc: control is attached to spatial. Not the other way around. * Update doc: Clarify what getSpatial returns
This commit is contained in:
parent
2124e3e86b
commit
76049c76f3
@ -246,6 +246,13 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
|
|||||||
setPhysicsRotation(getSpatialRotation());
|
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.
|
* Enable or disable this control.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -129,6 +129,13 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
|
|||||||
setPhysicsLocation(getSpatialTranslation());
|
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) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
if (space != null) {
|
if (space != null) {
|
||||||
|
@ -206,6 +206,13 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
|
|||||||
setPhysicsRotation(getSpatialRotation());
|
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.
|
* Enable or disable this control.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -207,6 +207,13 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
|
|||||||
setPhysicsRotation(getSpatialRotation());
|
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
|
* Set the collision shape based on the controlled spatial and its
|
||||||
* descendents.
|
* descendents.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user