/** * Alter which spatial is controlled. Invoked when the control is added to * or removed from a spatial. Should be invoked only by a subclass or from * Spatial. Do not invoke directly from user code. * * @param spatial the spatial to control (or null) */ public void setSpatial(Spatial spatial) { if (this.spatial != null && this.spatial != spatial) { removeSpatialData(this.spatial); } else if (this.spatial == spatial) { return; } this.spatial = spatial; if (spatial == null) { return; } createSpatialData(this.spatial); setPhysicsLocation(getSpatialTranslation()); setPhysicsRotation(getSpatialRotation()); }
/** * Alter which spatial is controlled. Invoked when the control is added to * or removed from a spatial. Should be invoked only by a subclass or from * Spatial. Do not invoke directly from user code. * * @param spatial the spatial to control (or null) */ public void setSpatial(Spatial spatial) { if (this.spatial != null && this.spatial != spatial) { removeSpatialData(this.spatial); } else if (this.spatial == spatial) { return; } this.spatial = spatial; if (spatial == null) { return; } createSpatialData(this.spatial); setPhysicsLocation(getSpatialTranslation()); setPhysicsRotation(getSpatialRotation()); }
public void setSpatial(Spatial spatial) { if (this.spatial != null && this.spatial != spatial) { removeSpatialData(this.spatial); } else if (this.spatial == spatial) { return; } this.spatial = spatial; if (spatial == null) { return; } createSpatialData(this.spatial); setPhysicsLocation(getSpatialTranslation()); setPhysicsRotation(getSpatialRotation()); }
/** * Alter which spatial is controlled. Invoked when the control is added to * or removed from a spatial. Should be invoked only by a subclass or from * Spatial. Do not invoke directly from user code. * * @param spatial the spatial to control (or null) */ public void setSpatial(Spatial spatial) { if (this.spatial != null && this.spatial != spatial) { removeSpatialData(this.spatial); } else if (this.spatial == spatial) { return; } this.spatial = spatial; if (spatial == null) { return; } createSpatialData(this.spatial); setPhysicsLocation(getSpatialTranslation()); setPhysicsRotation(getSpatialRotation()); }