Package com.jme3.material

Examples of com.jme3.material.Material.clone()


            Material m = (Material)mat.getBaseAsset();
            if(m != null){
              //prepare rim light shader for selection highlighting
              m.setColor("RimLighting", ColorRGBA.BlackNoAlpha);//new ColorRGBA(1f, 0f, 0f, 12f));//this was for a test had to set the value to 12 for a really good noticable look
              //this must be a clone for hardware skinning
              ((Geometry)n).setMaterial(m.clone());
            } else
              log.severe("Material "+mat.getLocation()+" not found is missing for "+a.getLocation());
          }else
            log.severe("Material is missing for "+a.getLocation());
         
View Full Code Here


                if (mode != Mode.Triangles && mode != Mode.TriangleFan && mode != Mode.TriangleStrip) {
                    geometry.setMaterial(this.getBlackUnshadedMaterial(blenderContext));
                } else {
                    Material defaultMaterial = blenderContext.getDefaultMaterial();
                    if(geometry.getMesh().getBuffer(Type.Color) != null) {
                        defaultMaterial = defaultMaterial.clone();
                        defaultMaterial.setBoolean("VertexColor", true);
                    }
                    geometry.setMaterial(defaultMaterial);
                }
                if (uvCoordsBuffer != null) {
View Full Code Here

                        break
                    }
                }
            }
            if (!found) {
                VertexInfo vertexInfo = new VertexInfo(position.clone(), normal.clone(), texCoord.clone());
                vertexInfo.indices.add(i);
                vertexMap.add(vertexInfo);
            }
        }
       
View Full Code Here

      Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", ColorRGBA.Red);
        walker.setMaterial(mat);
//        269.5173, -284.07605, 87.175156 to 476.54184, -171.21466, 454.62576
        //Entity e = placeObject(new Vector3f(-9969.057f, 15.097652f, 8429.296f), new Vector3f(-9979.581f, 28.097652f, 8420.083f));
        Entity e = placeObject(new Vector3f(-9890.341f, 14.610833f, 8302.891f), p.clone());
        if(e != null){
          e.attachChild(walker);
          rootNode.attachChild(e);
          this.walker = e;
        }
View Full Code Here

              Vector3f location = res.getContactPoint();
              if(location != null){
                Path p = new Path();
                PositioningComponent pos = (PositioningComponent) sin.getEntityManager().getComponent(handler.getSelectedObjectId(), PositioningComponent.class);
                if(pos != null){
                  if(sin.getNavManager().buildNavigationPath(p, pos.position, location.clone())) {
                    log.fine("new loc:" + location
                        + " sent:"+ ServerValues.getServerCoordX(location.x)
                        + ","+ ServerValues.getServerCoordY(location.z)
                        + ","+ ServerValues.getServerCoordZ(location.y));
                    sin.getClientFacade().sendMoveToAction(handler.getSelectedObjectId(), pos.position.x, pos.position.y, pos.position.z, location.x, location.y,
View Full Code Here

                        break
                    }
                }
            }
            if (!found) {
                VertexInfo vertexInfo = new VertexInfo(position.clone(), normal.clone(), texCoord.clone());
                vertexInfo.indices.add(i);
                vertexMap.add(vertexInfo);
            }
        }
       
View Full Code Here

   */
  protected Node createVisuals() {
    if (vis == null) { 
      Spatial s = Singleton.get().getAssetManager().getJmeAssetMan().loadModel("items/bottle/HealthFlask.j3o");
      if(s instanceof Node ){
        vis = (Node) s.clone(false);
        vis.setName(name);
//        vis.setLocalTranslation(0f, 1f, 0f);
      }
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.