private static String calcMeshMaterial(final Mesh mesh) { final StringBuilder material = new StringBuilder(); // First, check if we are lit or not final LightState ls = mesh.getWorldRenderState(StateType.Light); final boolean lit = (ls != null && ls.isEnabled() && ls.count() > 0); material.append(lit ? "lit/" : "unlit/"); // Now check if we are textured final TextureState ts = mesh.getWorldRenderState(StateType.Texture); final boolean textured = (ts != null && ts.isEnabled() && ts.getNumberOfSetTextures() > 0); material.append(textured ? "textured/" : "untextured/"); // Check if we are using vertex colors final boolean vertColor = mesh.getMeshData().containsKey(MeshData.KEY_ColorCoords); material.append(vertColor ? "vertex_color" : "basic"); material.append(lit ? "_phong" : ""); // Finally, check if we are using fog final boolean foggy = mesh.hasProperty(FogParams.DefaultPropertyKey); material.append(foggy ? "_fog" : ""); material.append(".yaml"); System.out.println(material + " - " + mesh.getName()); return material.toString(); } }
private static void copyLightState(final LightState source, final LightState destination) { destination.setEnabled(source.isEnabled()); destination.setNeedsRefresh(true); for (int i = 0, maxL = source.getLightList().size(); i < maxL; i++) { final Light pkLight = source.get(i); if (pkLight != null) { destination.attach(pkLight); } } }
for (int iIndex = states.length - 1; iIndex >= 0; iIndex--) { final LightState pkLState = (LightState) states[iIndex]; if (!pkLState.isEnabled()) { if (mode == LightCombineMode.CombineClosestEnabled) { break; for (int iIndex = 0, max = states.length; iIndex < max; iIndex++) { final LightState pkLState = (LightState) states[iIndex]; if (!pkLState.isEnabled()) { continue;
for (int iIndex = states.length - 1; iIndex >= 0; iIndex--) { final LightState pkLState = (LightState) states[iIndex]; if (!pkLState.isEnabled()) { if (mode == LightCombineMode.CombineClosestEnabled) { break; for (int iIndex = 0, max = states.length; iIndex < max; iIndex++) { final LightState pkLState = (LightState) states[iIndex]; if (!pkLState.isEnabled()) { continue;
private static void copyLightState(final LightState source, final LightState destination) { destination.setTwoSidedLighting(source.getTwoSidedLighting()); destination.setLocalViewer(source.getLocalViewer()); destination.setSeparateSpecular(source.getSeparateSpecular()); destination.setEnabled(source.isEnabled()); destination.setGlobalAmbient(source.getGlobalAmbient()); destination.setLightMask(source.getLightMask()); destination.setNeedsRefresh(true); for (int i = 0, maxL = source.getLightList().size(); i < maxL; i++) { final Light pkLight = source.get(i); if (pkLight != null) { destination.attach(pkLight); } } }
context.setCurrentState(StateType.Light, state); if (state.isEnabled() && LightState.LIGHTS_ENABLED) { setLightEnabled(true, record); setTwoSided(state.getTwoSidedLighting(), record);
context.setCurrentState(StateType.Light, state); if (state.isEnabled() && LightState.LIGHTS_ENABLED) { setLightEnabled(true, record); setTwoSided(state.getTwoSidedLighting(), record);