/** * Callback from {@link com.jme3.util.clone.Cloner} to convert this * shallow-cloned control into a deep-cloned one, using the specified cloner * and original to resolve copied fields. * * @param cloner the cloner that's cloning this control (not null) * @param original the control from which this control was shallow-cloned * (unused) */ @Override public void cloneFields( Cloner cloner, Object original ) { this.spatial = cloner.clone(spatial); createSpatialData(this.spatial); }
/** * Callback from {@link com.jme3.util.clone.Cloner} to convert this * shallow-cloned control into a deep-cloned one, using the specified cloner * and original to resolve copied fields. * * @param cloner the cloner that's cloning this control (not null) * @param original the control from which this control was shallow-cloned * (unused) */ @Override public void cloneFields( Cloner cloner, Object original ) { this.spatial = cloner.clone(spatial); createSpatialData(this.spatial); }
/** * 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()); }
@Override public void cloneFields( Cloner cloner, Object original ) { this.spatial = cloner.clone(spatial); createSpatialData(this.spatial); }
/** * Callback from {@link com.jme3.util.clone.Cloner} to convert this * shallow-cloned control into a deep-cloned one, using the specified cloner * and original to resolve copied fields. * * @param cloner the cloner that's cloning this control (not null) * @param original the control from which this control was shallow-cloned * (unused) */ @Override public void cloneFields( Cloner cloner, Object original ) { this.spatial = cloner.clone(spatial); createSpatialData(this.spatial); }
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()); }