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(); } }
protected Mesh clone(final Mesh original) { Mesh copy = null; try { copy = original.getClass().newInstance(); } catch (final InstantiationException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } catch (final IllegalAccessException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } copy.setName(original.getName() + "_copy"); copy.getSceneHints().set(original.getSceneHints()); copy.setTransform(original.getTransform()); copy.setDefaultColor(original.getDefaultColor()); for (final StateType type : StateType.values()) { final RenderState state = original.getLocalRenderState(type); if (state != null) { copy.setRenderState(state); } } return copy; }
protected Mesh clone(final Mesh original) { Mesh copy = null; try { copy = original.getClass().newInstance(); } catch (final InstantiationException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } catch (final IllegalAccessException e) { logger.log(Level.SEVERE, "Could not access final constructor of class " + original.getClass().getCanonicalName(), e); throw new RuntimeException(e); } copy.setName(original.getName() + "_copy"); copy.getSceneHints().set(original.getSceneHints()); copy.setTransform(original.getTransform()); copy.setDefaultColor(original.getDefaultColor()); for (final StateType type : StateType.values()) { final RenderState state = original.getLocalRenderState(type); if (state != null) { copy.setRenderState(state); } } return copy; }
String meshName = mesh.getName();
final Mesh child = buildMeshPolygons(colladaGeometry, p); if (child != null) { if (child.getName() == null) { child.setName(meshNode.getName() + "_polygons"); final Mesh child = buildMeshPolylist(colladaGeometry, p); if (child != null) { if (child.getName() == null) { child.setName(meshNode.getName() + "_polylist"); final Mesh child = buildMeshTriangles(colladaGeometry, t); if (child != null) { if (child.getName() == null) { child.setName(meshNode.getName() + "_triangles");
if (spat instanceof Mesh && ((Mesh) spat).getMeshData().getVertexCount() > 0) { final Mesh sourceMesh = (Mesh) spat; final SkinnedMesh skMesh = new SkinnedMesh(sourceMesh.getName()); skMesh.setCurrentPose(skPose);
if (Constants.strictVertexAttributes) { throw new Ardor3dException("Required mesh data key '" + attribute.getMeshDataKey() + "' not found in mesh: " + mesh.getName());