/** * Called when the Spatial is about to be rendered, to notify * controls attached to this Spatial using the Control.render() method. * * @param rm The RenderManager rendering the Spatial. * @param vp The ViewPort to which the Spatial is being rendered to. * * @see Spatial#addControl(com.jme3.scene.control.Control) * @see Spatial#getControl(java.lang.Class) */ public void runControlRender(RenderManager rm, ViewPort vp) { if (controls.isEmpty()) { return; } for (Control c : controls.getArray()) { c.render(rm, vp); } }
/** * 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(); } }
private void runControlUpdate(float tpf) { if (controls.isEmpty()) { return; } for (Control c : controls.getArray()) { c.update(tpf); } }
Control newControl = controls.get(i).cloneForSpatial(clone); newControl.setSpatial(clone); clone.controls.add(newControl);
Control newControl = controls.get(i).cloneForSpatial(clone); newControl.setSpatial(clone); clone.controls.add(newControl);
/** * 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(); } }
private void runControlUpdate(float tpf) { if (controls.isEmpty()) { return; } for (Control c : controls.getArray()) { c.update(tpf); } }
@Override protected void controlRender(RenderManager rm, ViewPort vp) { for (BatchedGeometry batchedGeometry : children) { for (int i = 0; i < batchedGeometry.getNumControls(); i++) { batchedGeometry.getControl(i).render(rm, vp); } } }
/** * 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; }
private void runControlUpdate(float tpf) { if (controls.isEmpty()) { return; } for (Control c : controls.getArray()) { c.update(tpf); } }
/** * Called when the Spatial is about to be rendered, to notify * controls attached to this Spatial using the Control.render() method. * * @param rm The RenderManager rendering the Spatial. * @param vp The ViewPort to which the Spatial is being rendered to. * * @see Spatial#addControl(com.jme3.scene.control.Control) * @see Spatial#getControl(java.lang.Class) */ public void runControlRender(RenderManager rm, ViewPort vp) { if (controls.isEmpty()) { return; } for (Control c : controls.getArray()) { c.render(rm, vp); } }
/** * 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); }
@Override protected void controlUpdate(float tpf) { for (BatchedGeometry batchedGeometry : children) { for (int i = 0; i < batchedGeometry.getNumControls(); i++) { batchedGeometry.getControl(i).update(tpf); } } }
/** * Called when the Spatial is about to be rendered, to notify * controls attached to this Spatial using the Control.render() method. * * @param rm The RenderManager rendering the Spatial. * @param vp The ViewPort to which the Spatial is being rendered to. * * @see Spatial#addControl(com.jme3.scene.control.Control) * @see Spatial#getControl(java.lang.Class) */ public void runControlRender(RenderManager rm, ViewPort vp) { if (controls.isEmpty()) { return; } for (Control c : controls.getArray()) { c.render(rm, vp); } }
/** * 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); } } }
/** * 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 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(); } }
/** * 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; }