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.Object
describes 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 void
delete()
SWIGTYPE_p_float
getAmbient()
Ambient color as RGBAstatic long
getCPtr(Model3D.Material obj)
SWIGTYPE_p_float
getEmissive()
Emissive color as RGBAjava.lang.String
getName()
material name, not necesarily uniqueSWIGTYPE_p_float
getRgb()
Red, Green, Blue and alpha color (simple) or diffues color(advanced)float
getShininess()
The shininess \in [0,128]boolean
getSimplergb()
true if this material is a simple materialSWIGTYPE_p_float
getSpecular()
Specular color as RGBshort
getTexId()
index to a texture which is stored in Model3D, -1 if not usedint
getTextureID()
Get id of the texture for this material.float
getTransparency()
Transparency in [0, 1]boolean
hasTexture()
Check if material has texture.void
setAmbient(SWIGTYPE_p_float value)
Ambient color as RGBAvoid
setEmissive(SWIGTYPE_p_float value)
Emissive color as RGBAvoid
setName(java.lang.String value)
material name, not necesarily uniquevoid
setRgb(SWIGTYPE_p_float value)
Red, Green, Blue and alpha color (simple) or diffues color(advanced)void
setShininess(float value)
The shininess \in [0,128]void
setSimplergb(boolean value)
true if this material is a simple materialvoid
setSpecular(SWIGTYPE_p_float value)
Specular color as RGBvoid
setTexId(short value)
index to a texture which is stored in Model3D, -1 if not usedvoid
setTransparency(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]
-
-