package custom;
//import static com.jme3.shader.VarType.Texture2D;
import com.jme3.shader.VarType.Vector4;
import com.jme3.texture.Texture2D;
import java.io.Serializable;
/**
*
* @author nn
*/
public class MaterisalParams implements Serializable {
public Vector4 diffuse;
public boolean useMaterialColors;
public float parallaxHeight;
public Vector4 ambient;
public boolean backfaceShadows;
public Texture2D diffuseMap;
public Vector4 specular;
public float shininess;
//name Shininess type Float
// Specular specular;
// Shininess shininess;
}
Compile with errors.
i get material parameters.
Collection<MatParam> listMap = material.getParams();
for(MatParam param : listMap){
System.out.println(" name " + param.getName() + " type " + param.getVarType());
}
And add to custom class:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package custom;
//import static com.jme3.shader.VarType.Texture2D;
import com.jme3.shader.VarType.Vector4;
import com.jme3.texture.Texture2D;
import java.io.Serializable;
/**
*
* @author nn
*/
public class MaterisalParams implements Serializable {
public Vector4 diffuse;
public boolean useMaterialColors;
public float parallaxHeight;
public Vector4 ambient;
public boolean backfaceShadows;
public Texture2D diffuseMap;
public Vector4 specular;
public float shininess;
//name Shininess type Float
// Specular specular;
// Shininess shininess;
}
When i run application compiler not search type: Vectro4.
import com.jme3.shader.VarType.Vector4;
(cannot find symbol Vector4)
And Texture2D have 2 class:
import com.jme3.texture.Texture2D;
//import static com.jme3.shader.VarType.Texture2D;
I dont understand. Why do you need to save the state of a material? A material is a representation of a state. It displays the state, it is not a state itself.
Node node = (Node) assetManager.loadModel(modelPath);
Geometry myGeo = (Geometry)node.getChild("base.obj1");
Material material = myGeo.getMaterial();
//
MaterisalParams matParams = new MaterisalParams();
matParams.material = material
public class MaterisalParams implements Serializable{
String army = "rO0ABXNyABZjdXN0b20uTWF0ZXJpc2FsUGFyYW1zyvxKH9Pl8pICAAhaAA9iYWNrZmFjZVNoYWRvd3NGAA5wYXJhbGxheEhlaWdodEYACXNoaW5pbmVzc1oAEXVzZU1hdGVyaWFsQ29sb3JzTAAHYW1iaWVudHQAGExjb20vam1lMy9tYXRoL1ZlY3RvcjRmO0wAB2RpZmZ1c2VxAH4AAUwACmRpZmZ1c2VNYXB0ABxMY29tL2ptZTMvdGV4dHVyZS9UZXh0dXJlMkQ7TAAIc3BlY3VsYXJxAH4AAXhwAAAAAAAAAAAAAHBwcHA=";
public Material material;
}
String army = "rO0ABXNyABZjdXN0b20uTWF0ZXJpc2FsUGFyYW1zyvxKH9Pl8pICAAhaAA9iYWNrZmFjZVNoYWRvd3NGAA5wYXJhbGxheEhlaWdodEYACXNoaW5pbmVzc1oAEXVzZU1hdGVyaWFsQ29sb3JzTAAHYW1iaWVudHQAGExjb20vam1lMy9tYXRoL1ZlY3RvcjRmO0wAB2RpZmZ1c2VxAH4AAUwACmRpZmZ1c2VNYXB0ABxMY29tL2ptZTMvdGV4dHVyZS9UZXh0dXJlMkQ7TAAIc3BlY3VsYXJxAH4AAXhwAAAAAAAAAAAAAHBwcHA=";