Package org.robwork.sdurw_geometry
Class Model3D.Material
- java.lang.Object
-
- org.robwork.sdurw_geometry.Model3D.Material
-
- Enclosing class:
- Model3D
public static class Model3D.Material extends java.lang.Objectdescribes material properties. A material can be either simple or "advanced"
and in both cases it can be textured.
A simple material is described by a 4-tuple of RGBA values. The advanced material
defines multiple properties: diffuse, ambient, emissive, specular, shininess and
transparency
-
-
Constructor Summary
Constructors Constructor Description Material()default constructorMaterial(long cPtr, boolean cMemoryOwn)Material(java.lang.String nam, float r, float g, float b)constructor for simple materialMaterial(java.lang.String nam, float r, float g, float b, float a)constructor for simple material
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()SWIGTYPE_p_floatgetAmbient()Ambient color as RGBAstatic longgetCPtr(Model3D.Material obj)SWIGTYPE_p_floatgetEmissive()Emissive color as RGBAjava.lang.StringgetName()material name, not necesarily uniqueSWIGTYPE_p_floatgetRgb()Red, Green, Blue and alpha color (simple) or diffues color(advanced)floatgetShininess()The shininess \in [0,128]booleangetSimplergb()true if this material is a simple materialSWIGTYPE_p_floatgetSpecular()Specular color as RGBshortgetTexId()index to a texture which is stored in Model3D, -1 if not usedintgetTextureID()Get id of the texture for this material.floatgetTransparency()Transparency in [0, 1]booleanhasTexture()Check if material has texture.voidsetAmbient(SWIGTYPE_p_float value)Ambient color as RGBAvoidsetEmissive(SWIGTYPE_p_float value)Emissive color as RGBAvoidsetName(java.lang.String value)material name, not necesarily uniquevoidsetRgb(SWIGTYPE_p_float value)Red, Green, Blue and alpha color (simple) or diffues color(advanced)voidsetShininess(float value)The shininess \in [0,128]voidsetSimplergb(boolean value)true if this material is a simple materialvoidsetSpecular(SWIGTYPE_p_float value)Specular color as RGBvoidsetTexId(short value)index to a texture which is stored in Model3D, -1 if not usedvoidsetTransparency(float value)Transparency in [0, 1]
-
-
-
Constructor Detail
-
Material
public Material(long cPtr, boolean cMemoryOwn)
-
Material
public Material()
default constructor
-
Material
public Material(java.lang.String nam, float r, float g, float b, float a)constructor for simple material
-
Material
public Material(java.lang.String nam, float r, float g, float b)constructor for simple material
-
-
Method Detail
-
getCPtr
public static long getCPtr(Model3D.Material obj)
-
delete
public void delete()
-
hasTexture
public boolean hasTexture()
Check if material has texture.- Returns:
- true if material has texture.
-
getTextureID
public int getTextureID()
Get id of the texture for this material.- Returns:
- the texture id.
-
setName
public void setName(java.lang.String value)
material name, not necesarily unique
-
getName
public java.lang.String getName()
material name, not necesarily unique
-
setSimplergb
public void setSimplergb(boolean value)
true if this material is a simple material
-
getSimplergb
public boolean getSimplergb()
true if this material is a simple material
-
setTexId
public void setTexId(short value)
index to a texture which is stored in Model3D, -1 if not used
-
getTexId
public short getTexId()
index to a texture which is stored in Model3D, -1 if not used
-
setRgb
public void setRgb(SWIGTYPE_p_float value)
Red, Green, Blue and alpha color (simple) or diffues color(advanced)
-
getRgb
public SWIGTYPE_p_float getRgb()
Red, Green, Blue and alpha color (simple) or diffues color(advanced)
-
setAmbient
public void setAmbient(SWIGTYPE_p_float value)
Ambient color as RGBA
-
getAmbient
public SWIGTYPE_p_float getAmbient()
Ambient color as RGBA
-
setEmissive
public void setEmissive(SWIGTYPE_p_float value)
Emissive color as RGBA
-
getEmissive
public SWIGTYPE_p_float getEmissive()
Emissive color as RGBA
-
setSpecular
public void setSpecular(SWIGTYPE_p_float value)
Specular color as RGB
-
getSpecular
public SWIGTYPE_p_float getSpecular()
Specular color as RGB
-
setShininess
public void setShininess(float value)
The shininess \in [0,128]
-
getShininess
public float getShininess()
The shininess \in [0,128]
-
setTransparency
public void setTransparency(float value)
Transparency in [0, 1]
-
getTransparency
public float getTransparency()
Transparency in [0, 1]
-
-