Class Material
java.lang.Object
com.marginallyclever.ro3.node.Node
com.marginallyclever.ro3.node.nodes.Material
Material
contains properties for rendering a surface. The first use case is to apply a texture to a
Mesh
.
This class provides several functionalities:
- It can set and get the texture.
- It can set and get the diffuse color.
- It can set and get the specular color.
- It can set and get the emission color.
- It can set and get the shininess.
- It can set and get the lit status.
- It can serialize and deserialize itself to and from JSON format.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
fromJSON
(org.json.JSONObject from) Deserialize this node and its children from a JSON object and its children.void
getComponents
(List<JPanel> list) Build a Swing Component that represents this Node.int
boolean
isLit()
void
setDiffuseColor
(Color color) void
setEmissionColor
(Color color) void
setLit
(boolean isLit) void
setShininess
(int arg0) void
setSpecularColor
(Color color) void
setTexture
(TextureWithMetadata selectedItem) org.json.JSONObject
toJSON()
Serialize this node and its children to a JSON object and its children.Methods inherited from class com.marginallyclever.ro3.node.Node
addAttachListener, addChild, addChild, addDetachListener, addReadyListener, addRenameListener, findByPath, findChild, findChild, findFirstChild, findFirstSibling, findNodeByID, findParent, findParent, getAbsolutePath, getChildren, getName, getParent, getRootNode, getUniqueID, hasParent, isNameUsedBySibling, removeAttachListener, removeChild, removeDetachListener, removeReadyListener, removeRenameListener, setName, update, witnessProtection
-
Constructor Details
-
Material
public Material() -
Material
-
-
Method Details
-
getComponents
Description copied from class:Node
Build a Swing Component that represents this Node.- Overrides:
getComponents
in classNode
- Parameters:
list
- the list to add components to.
-
setTexture
-
getTexture
-
toJSON
public org.json.JSONObject toJSON()Description copied from class:Node
Serialize this node and its children to a JSON object and its children. Classes that override this method should call super.toJSON() first, then add to the object returned. -
fromJSON
public void fromJSON(org.json.JSONObject from) Description copied from class:Node
Deserialize this node and its children from a JSON object and its children. Classes that override this method should call super.fromJSON(). When they do it will trigger the creation of child nodes. The child nodes will then call their own fromJSON() methods. -
getDiffuseColor
-
setDiffuseColor
-
getSpecularColor
-
setSpecularColor
-
getEmissionColor
-
setEmissionColor
-
setShininess
public void setShininess(int arg0) -
getShininess
public int getShininess() -
isLit
public boolean isLit() -
setLit
public void setLit(boolean isLit)
-