/** * Removes the first control that is an instance of the given class. * * @see Spatial#addControl(com.jme3.scene.control.Control) */ public void removeControl(Class<? extends Control> controlType) { boolean before = requiresUpdates(); for (int i = 0; i < controls.size(); i++) { if (controlType.isAssignableFrom(controls.get(i).getClass())) { Control control = controls.remove(i); control.setSpatial(null); break; // added to match the javadoc -pspeed } } boolean after = requiresUpdates(); // If the requirement to be updated has changed // then we need to let the parent node know so it // can rebuild its update list. if( parent != null && before != after ) { parent.invalidateUpdateList(); } }
/** * Add a control to the list of controls. * @param control The control to add. * * @see Spatial#removeControl(java.lang.Class) */ public void addControl(Control control) { boolean before = requiresUpdates(); controls.add(control); control.setSpatial(this); boolean after = requiresUpdates(); // If the requirement to be updated has changed // then we need to let the parent node know so it // can rebuild its update list. if( parent != null && before != after ) { parent.invalidateUpdateList(); } }
/** * Removes the given control from this spatial's controls. * * @param control The control to remove * @return True if the control was successfully removed. False if the * control is not assigned to this spatial. * * @see Spatial#addControl(com.jme3.scene.control.Control) */ public boolean removeControl(Control control) { boolean before = requiresUpdates(); boolean result = controls.remove(control); if (result) { control.setSpatial(null); } boolean after = requiresUpdates(); // If the requirement to be updated has changed // then we need to let the parent node know so it // can rebuild its update list. if( parent != null && before != after ) { parent.invalidateUpdateList(); } return result; }
/** * Add a control to the list of controls. * @param control The control to add. * * @see Spatial#removeControl(java.lang.Class) */ public void addControl(Control control) { controls.add(control); control.setSpatial(this); }
/** * Removes the given control from this spatial's controls. * * @param control The control to remove * @return True if the control was successfuly removed. False if * the control is not assigned to this spatial. * * @see Spatial#addControl(com.jme3.scene.control.Control) */ public boolean removeControl(Control control) { boolean result = controls.remove(control); if (result) { control.setSpatial(null); } return result; }
/** * Removes the first control that is an instance of the given class. * * @see Spatial#addControl(com.jme3.scene.control.Control) */ public void removeControl(Class<? extends Control> controlType) { for (int i = 0; i < controls.size(); i++) { if (controlType.isAssignableFrom(controls.get(i).getClass())) { Control control = controls.remove(i); control.setSpatial(null); } } }
/** * Removes the first control that is an instance of the given class. * * @see Spatial#addControl(com.jme3.scene.control.Control) */ public void removeControl(Class<? extends Control> controlType) { boolean before = requiresUpdates(); for (int i = 0; i < controls.size(); i++) { if (controlType.isAssignableFrom(controls.get(i).getClass())) { Control control = controls.remove(i); control.setSpatial(null); break; // added to match the javadoc -pspeed } } boolean after = requiresUpdates(); // If the requirement to be updated has changed // then we need to let the parent node know so it // can rebuild its update list. if( parent != null && before != after ) { parent.invalidateUpdateList(); } }
/** * Add a control to the list of controls. * @param control The control to add. * * @see Spatial#removeControl(java.lang.Class) */ public void addControl(Control control) { boolean before = requiresUpdates(); controls.add(control); control.setSpatial(this); boolean after = requiresUpdates(); // If the requirement to be updated has changed // then we need to let the parent node know so it // can rebuild its update list. if( parent != null && before != after ) { parent.invalidateUpdateList(); } }
/** * Removes the given control from this spatial's controls. * * @param control The control to remove * @return True if the control was successfully removed. False if the * control is not assigned to this spatial. * * @see Spatial#addControl(com.jme3.scene.control.Control) */ public boolean removeControl(Control control) { boolean before = requiresUpdates(); boolean result = controls.remove(control); if (result) { control.setSpatial(null); } boolean after = requiresUpdates(); // If the requirement to be updated has changed // then we need to let the parent node know so it // can rebuild its update list. if( parent != null && before != after ) { parent.invalidateUpdateList(); } return result; }
for (int i = 0; i < controls.size(); i++) { Control newControl = controls.get(i).cloneForSpatial(clone); newControl.setSpatial(clone); clone.controls.add(newControl);
for (int i = 0; i < controls.size(); i++) { Control newControl = controls.get(i).cloneForSpatial(clone); newControl.setSpatial(clone); clone.controls.add(newControl);