/** * Check if a state is attached or not. * * @param state The state to check * @return True if the state is currently attached to this AppStateManager. * * @see AppStateManager#attach(com.jme3.app.state.AppState) */ public boolean hasState(AppState state){ synchronized (states){ return states.contains(state) || initializing.contains(state); } }
/** * sets the filter to enabled or disabled * @param filter * @param enabled */ protected void setFilterState(Filter filter, boolean enabled) { if (filters.contains(filter)) { filter.enabled = enabled; updateLastFilterIndex(); } }
/** * Attach a state to the AppStateManager, the same state cannot be attached * twice. * * @param state The state to attach * @return True if the state was successfully attached, false if the state * was already attached. */ public boolean attach(AppState state){ synchronized (states){ if (!states.contains(state) && !initializing.contains(state)){ state.stateAttached(this); initializing.add(state); return true; }else{ return false; } } }
/** * determines if the provided Spatial is contained in the children list of * this node. * * @param spat * the child object to look for. * @return true if the object is contained, false otherwise. */ public boolean hasChild(Spatial spat) { if (children.contains(spat)) return true; for (Spatial child : children.getArray()) { if (child instanceof Node && ((Node) child).hasChild(spat)) return true; } return false; }
@Override protected void prepareTerrain() { if (!addedTerrains.isEmpty()) { for (TerrainQuad t : addedTerrains) { if (!terrains.contains(t)) { terrains.add(t); } } addedTerrains.clear(); } if (!removedTerrains.isEmpty()) { terrains.removeAll(removedTerrains); removedTerrains.clear(); } for (TerrainQuad terrain : terrains.getArray()) { // cache the terrain's world transforms so they can be accessed on the separate thread safely terrain.cacheTerrainTransforms(); } }
/** * 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 void visit(Geometry geom) { MatParam p = geom.getMaterial().getMaterialDef().getMaterialParam("MorphWeights"); if (p == null) { return; } Mesh mesh = geom.getMesh(); if (mesh != null && mesh.hasMorphTargets()) { targets.add(geom); // If the mesh is in a subgraph of a node with a SkinningControl it might have hardware skinning activated through mat param override even if it's not skinned. // this code makes sure that if the mesh has no hardware skinning buffers hardware skinning won't be activated. // this is important, because if HW skinning is activated the shader will declare 2 additional useless attributes, // and we desperately need all the attributes we can find for Morph animation. if (mesh.getBuffer(VertexBuffer.Type.HWBoneIndex) == null && !geom.getLocalMatParamOverrides().contains(nullNumberOfBones)) { geom.addMatParamOverride(nullNumberOfBones); } } } }
/** * Check if a state is attached or not. * * @param state The state to check * @return True if the state is currently attached to this AppStateManager. * * @see AppStateManager#attach(com.jme3.app.state.AppState) */ public boolean hasState(AppState state){ synchronized (states){ return states.contains(state) || initializing.contains(state); } }
/** * Check if a state is attached or not. * * @param state The state to check * @return True if the state is currently attached to this AppStateManager. * * @see AppStateManager#attach(com.jme3.app.state.AppState) */ public boolean hasState(AppState state){ synchronized (states){ return states.contains(state) || initializing.contains(state); } }
/** * sets the filter to enabled or disabled * @param filter * @param enabled */ protected void setFilterState(Filter filter, boolean enabled) { if (filters.contains(filter)) { filter.enabled = enabled; updateLastFilterIndex(); } }
/** * Attach a state to the AppStateManager, the same state cannot be attached * twice. * * @param state The state to attach * @return True if the state was successfully attached, false if the state * was already attached. */ public boolean attach(AppState state){ synchronized (states){ if (!states.contains(state) && !initializing.contains(state)){ state.stateAttached(this); initializing.add(state); return true; }else{ return false; } } }
/** * Attach a state to the AppStateManager, the same state cannot be attached * twice. * * @param state The state to attach * @return True if the state was successfully attached, false if the state * was already attached. */ public boolean attach(AppState state){ synchronized (states){ if (!states.contains(state) && !initializing.contains(state)){ state.stateAttached(this); initializing.add(state); return true; }else{ return false; } } }
/** * determines if the provided Spatial is contained in the children list of * this node. * * @param spat * the child object to look for. * @return true if the object is contained, false otherwise. */ public boolean hasChild(Spatial spat) { if (children.contains(spat)) return true; for (Spatial child : children.getArray()) { if (child instanceof Node && ((Node) child).hasChild(spat)) return true; } return false; }
/** * determines if the provided Spatial is contained in the children list of * this node. * * @param spat * the child object to look for. * @return true if the object is contained, false otherwise. */ public boolean hasChild(Spatial spat) { if (children.contains(spat)) return true; for (Spatial child : children.getArray()) { if (child instanceof Node && ((Node) child).hasChild(spat)) return true; } return false; }
/** * determines if the provided TriggerActionData is contained in the children * map of this TriggerGenericData. * * @param trigger the child object to look for. * @return true if the object is contained, false otherwise. */ public boolean hasChild(TriggerData trigger) { if (children.contains(trigger)) { return true; } for (TriggerData child : children.getArray()) { if (child instanceof TriggerGenericData && ((TriggerGenericData) child).hasChild(trigger)) { return true; } } return false; }
/** * 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; } } }
/** * 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; } } }