/** * Remove a forced material parameter previously added. * * @param override The override to remove. * @see #addForcedMatParam(com.jme3.material.MatParamOverride) */ public void removeForcedMatParam(MatParamOverride override) { forcedOverrides.remove(override); }
/** * Removes a {@link RawInputListener} so that it no longer * receives raw input events. * * @param listener The listener to cease receiving raw input events. * * @see InputManager#addRawInputListener(com.jme3.input.RawInputListener) */ public void removeRawInputListener(RawInputListener listener) { rawListeners.remove(listener); }
/** * removes a track from this animation * @param track the track to remove */ public void removeTrack(Track track) { tracks.remove(track); if (track instanceof ClonableTrack) { ((ClonableTrack) track).cleanUp(); } }
/** * Remove a local material parameter override if it exists. * * @param override The override to remove. * @see MatParamOverride */ public void removeMatParamOverride(MatParamOverride override) { if (localOverrides.remove(override)) { setMatParamOverrideRefresh(); } }
/** * Removes a {@link SceneProcessor} from this ViewPort. * <p> * The processor will no longer receive events occurring to this ViewPort. * * @param processor The processor to remove * * @see SceneProcessor */ public void removeProcessor(SceneProcessor processor){ if (processor == null) { throw new IllegalArgumentException( "Processor cannot be null." ); } processors.remove(processor); processor.cleanup(); }
/** * Detaches a scene from rendering. * * @param scene The scene to detach * * @see #attachScene(com.jme3.scene.Spatial) */ public void detachScene(Spatial scene){ if (scene == null) { throw new IllegalArgumentException( "Scene cannot be null." ); } sceneList.remove(scene); if (scene instanceof Geometry) { scene.forceRefresh(true, false, true); } }
/** * removes this filters from the filters list * @param filter */ public void removeFilter(Filter filter) { if (filter == null) { throw new IllegalArgumentException("Filter cannot be null."); } filters.remove(filter); filter.cleanup(renderer); updateLastFilterIndex(); }
/** * More efficient than e.g detaching and attaching as no updates are needed. * * @param index1 The index of the first child to swap * @param index2 The index of the second child to swap */ public void swapChildren(int index1, int index2) { Spatial c2 = children.get(index2); Spatial c1 = children.remove(index1); children.add(index1, c2); children.remove(index2); children.add(index2, c1); }
/** * Unsets the {@link VertexBuffer} set on this mesh * with the given type. Does nothing if the vertex buffer type is not set * initially. * * @param type The buffer type to remove */ public void clearBuffer(VertexBuffer.Type type){ VertexBuffer vb = buffers.remove(type.ordinal()); if (vb != null){ buffersList.remove(vb); updateCounts(); } }
/** * Detaches the state from the AppStateManager. * * @param state The state to detach * @return True if the state was detached successfully, false * if the state was not attached in the first place. */ public boolean detach(AppState state){ synchronized (states){ if (states.contains(state)){ state.stateDetached(this); states.remove(state); terminating.add(state); return true; } else if(initializing.contains(state)){ state.stateDetached(this); initializing.remove(state); return true; }else{ return false; } } }
@Override public Node clone(boolean cloneMaterials) { InstancedNode clone = (InstancedNode)super.clone(cloneMaterials); if (instancesMap.size() > 0) { // Remove all instanced geometries from the clone for (int i = 0; i < clone.children.size(); i++) { if (clone.children.get(i) instanceof InstancedGeometry) { clone.children.remove(i); } else if (clone.children.get(i) instanceof Geometry) { Geometry geom = (Geometry) clone.children.get(i); if (geom.isGrouped()) { throw new AssertionError(); } } } } // remove original control from the clone clone.controls.remove(this.control); // put clone's control in clone.control = new InstancedNodeControl(clone); clone.controls.add(clone.control); clone.lookUp = new InstanceTypeKey(); clone.igByGeom = new HashMap<Geometry, InstancedGeometry>(); clone.instancesMap = new HashMap<InstanceTypeKey, InstancedGeometry>(); clone.instance(); return clone; }
/** * 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; }
@Override public Node clone(boolean cloneMaterials) { BatchNode clone = (BatchNode) super.clone(cloneMaterials); if (batches.size() > 0) { for (Batch b : batches) { for (int i = 0; i < clone.children.size(); i++) { if (clone.children.get(i).getName().equals(b.geometry.getName())) { clone.children.remove(i); break; } } } clone.needsFullRebatch = true; clone.batches = new SafeArrayList<Batch>(Batch.class); clone.batchesByGeom = new HashMap<Geometry, Batch>(); clone.batch(); } return clone; }
/** * * <code>detachChildAt</code> removes a child at a given index. That child * is returned for saving purposes. * * @param index * the index of the child to be removed. * @return the child at the supplied index. */ public Spatial detachChildAt(int index) { Spatial child = children.remove(index); if ( child != null ) { child.setParent( null ); logger.log(Level.FINE, "{0}: Child removed.", this.toString()); // since a child with a bound was detached; // our own bound will probably change. setBoundRefresh(); // our world transform no longer influences the child. // XXX: Not necessary? Since child will have transform updated // when attached anyway. child.setTransformRefresh(); // lights are also inherited from parent child.setLightListRefresh(); child.setMatParamOverrideRefresh(); invalidateUpdateList(); } return child; }
mesh.getBufferList().remove(vertexBuffer); mesh.getBuffers().remove(bufferType.ordinal());
clone.controls.remove(this.control);
Object obj = controls.get(i); if (obj instanceof ParticleEmitter) { controls.remove(i);
/** * Remove a forced material parameter previously added. * * @param override The override to remove. * @see #addForcedMatParam(com.jme3.material.MatParamOverride) */ public void removeForcedMatParam(MatParamOverride override) { forcedOverrides.remove(override); }
public void removeUpdateListener( GuiUpdateListener l ) { if( updateListeners == null ) { return; } updateListeners.remove(l); }