Assimp  v4.1. (December 2018)
jassimp.AiMaterial Class Reference

Data structure for a material. More...

Classes

class  Property
 Data structure for a single material property. More...
 
enum  PropertyKey
 Enumerates all supported material properties. More...
 
enum  PropertyType
 A very primitive RTTI system for the contents of material properties. More...
 

Public Member Functions

float getBlendFactor (AiTextureType type, int index)
 Returns the blend factor of the texture. More...
 
AiBlendMode getBlendMode ()
 Returns the blend mode. More...
 
float getBumpScaling ()
 Returns the bump scaling factor. More...
 
String getGlobalBackgroundImage ()
 Returns the global background image. More...
 
String getName ()
 Returns the name of the material. More...
 
int getNumTextures (AiTextureType type)
 Returns the number of textures of the given type. More...
 
float getOpacity ()
 Returns the opacity. More...
 
List< PropertygetProperties ()
 Returns all properties of the material. More...
 
Property getProperty (String key)
 Returns a single property based on its key. More...
 
Property getProperty (String key, int semantic, int index)
 Returns a single property based on its key. More...
 
float getReflectivity ()
 Returns the reflectivity. More...
 
float getRefractIndex ()
 Returns the refract index. More...
 
AiShadingMode getShadingMode ()
 Returns the shading mode. More...
 
float getShininess ()
 Returns the shininess. More...
 
float getShininessStrength ()
 Returns the shininess strength. More...
 
String getTextureFile (AiTextureType type, int index)
 Returns the texture file. More...
 
AiTextureInfo getTextureInfo (AiTextureType type, int index)
 Returns all information related to a single texture. More...
 
AiTextureMapMode getTextureMapModeU (AiTextureType type, int index)
 Returns the texture mapping mode for the u axis. More...
 
AiTextureMapMode getTextureMapModeV (AiTextureType type, int index)
 Returns the texture mapping mode for the v axis. More...
 
AiTextureMapMode getTextureMapModeW (AiTextureType type, int index)
 Returns the texture mapping mode for the w axis. More...
 
AiTextureOp getTextureOp (AiTextureType type, int index)
 Returns the texture operation. More...
 
int getTextureUVIndex (AiTextureType type, int index)
 Returns the index of the UV coordinate set used by the texture. More...
 
int getTwoSided ()
 Returns the two-sided flag. More...
 
int getWireframe ()
 Returns the wireframe flag. More...
 
boolean hasProperties (Set< PropertyKey > keys)
 Checks whether the given set of properties is available. More...
 
void setDefault (PropertyKey key, Object defaultValue)
 Sets a default value. More...
 

Detailed Description

Data structure for a material.

Depending on the imported scene and scene format, individual properties might be present or not. A list of all imported properties can be retrieved via getProperties().

This class offers getXXX() for all supported properties. These methods are fail-save, i.e., will return a default value when the corresponding property is not set. To change the built in default values, use the setDefaultXXX() methods.

If your application expects a certain set of properties to be available, the hasProperties(Set) method can be used to check whether all these properties are actually set. If this check fails, you can still use this material via the getXXX() methods without special error handling code as the implementation guarantees to return default values for missing properties. This check will not work on texture related properties (i.e., properties starting with TEX_).

Member Function Documentation

◆ getBlendFactor()

float jassimp.AiMaterial.getBlendFactor ( AiTextureType  type,
int  index 
)
inline

Returns the blend factor of the texture.

If missing, defaults to 1.0

Parameters
typethe texture type
indexthe index in the texture stack
Returns
the blend factor

◆ getBlendMode()

AiBlendMode jassimp.AiMaterial.getBlendMode ( )
inline

Returns the blend mode.

If missing, defaults to AiBlendMode#DEFAULT

Returns
the blend mode

◆ getBumpScaling()

float jassimp.AiMaterial.getBumpScaling ( )
inline

Returns the bump scaling factor.

If missing, defaults to 1.0

Returns
the bump scaling factor

◆ getGlobalBackgroundImage()

String jassimp.AiMaterial.getGlobalBackgroundImage ( )
inline

Returns the global background image.

If missing, defaults to empty string

Returns
the global background image

◆ getName()

String jassimp.AiMaterial.getName ( )
inline

Returns the name of the material.

If missing, defaults to empty string

Returns
the name

◆ getNumTextures()

int jassimp.AiMaterial.getNumTextures ( AiTextureType  type)
inline

Returns the number of textures of the given type.

Parameters
typethe type
Returns
the number of textures

◆ getOpacity()

float jassimp.AiMaterial.getOpacity ( )
inline

Returns the opacity.

If missing, defaults to 1.0

Returns
the opacity

◆ getProperties()

List<Property> jassimp.AiMaterial.getProperties ( )
inline

Returns all properties of the material.

Returns
the list of properties

◆ getProperty() [1/2]

Property jassimp.AiMaterial.getProperty ( String  key)
inline

Returns a single property based on its key.

Parameters
keythe key
Returns
the property or null if the property is not set

◆ getProperty() [2/2]

Property jassimp.AiMaterial.getProperty ( String  key,
int  semantic,
int  index 
)
inline

Returns a single property based on its key.

Parameters
keythe key
semanticthe semantic type (texture type)
indexthe index
Returns
the property or null if the property is not set

◆ getReflectivity()

float jassimp.AiMaterial.getReflectivity ( )
inline

Returns the reflectivity.

If missing, defaults to 0.0

Returns
the reflectivity

◆ getRefractIndex()

float jassimp.AiMaterial.getRefractIndex ( )
inline

Returns the refract index.

If missing, defaults to 0.0

Returns
the refract index

◆ getShadingMode()

AiShadingMode jassimp.AiMaterial.getShadingMode ( )
inline

Returns the shading mode.

If missing, defaults to AiShadingMode#FLAT

Returns
the shading mode

◆ getShininess()

float jassimp.AiMaterial.getShininess ( )
inline

Returns the shininess.

If missing, defaults to 1.0

Returns
the shininess

◆ getShininessStrength()

float jassimp.AiMaterial.getShininessStrength ( )
inline

Returns the shininess strength.

If missing, defaults to 0.0

Returns
the shininess strength

◆ getTextureFile()

String jassimp.AiMaterial.getTextureFile ( AiTextureType  type,
int  index 
)
inline

Returns the texture file.

If missing, defaults to empty string

Parameters
typethe texture type
indexthe index in the texture stack
Returns
the file
Exceptions
IndexOutOfBoundsExceptionif index is invalid

◆ getTextureInfo()

AiTextureInfo jassimp.AiMaterial.getTextureInfo ( AiTextureType  type,
int  index 
)
inline

Returns all information related to a single texture.

Parameters
typethe texture type
indexthe index in the texture stack
Returns
the texture information

◆ getTextureMapModeU()

AiTextureMapMode jassimp.AiMaterial.getTextureMapModeU ( AiTextureType  type,
int  index 
)
inline

Returns the texture mapping mode for the u axis.

If missing, defaults to AiTextureMapMode#CLAMP

Parameters
typethe texture type
indexthe index in the texture stack
Returns
the texture mapping mode

◆ getTextureMapModeV()

AiTextureMapMode jassimp.AiMaterial.getTextureMapModeV ( AiTextureType  type,
int  index 
)
inline

Returns the texture mapping mode for the v axis.

If missing, defaults to AiTextureMapMode#CLAMP

Parameters
typethe texture type
indexthe index in the texture stack
Returns
the texture mapping mode

◆ getTextureMapModeW()

AiTextureMapMode jassimp.AiMaterial.getTextureMapModeW ( AiTextureType  type,
int  index 
)
inline

Returns the texture mapping mode for the w axis.

If missing, defaults to AiTextureMapMode#CLAMP

Parameters
typethe texture type
indexthe index in the texture stack
Returns
the texture mapping mode

◆ getTextureOp()

AiTextureOp jassimp.AiMaterial.getTextureOp ( AiTextureType  type,
int  index 
)
inline

Returns the texture operation.

If missing, defaults to AiTextureOp#ADD

Parameters
typethe texture type
indexthe index in the texture stack
Returns
the texture operation

◆ getTextureUVIndex()

int jassimp.AiMaterial.getTextureUVIndex ( AiTextureType  type,
int  index 
)
inline

Returns the index of the UV coordinate set used by the texture.

If missing, defaults to 0

Parameters
typethe texture type
indexthe index in the texture stack
Returns
the UV index
Exceptions
IndexOutOfBoundsExceptionif index is invalid

◆ getTwoSided()

int jassimp.AiMaterial.getTwoSided ( )
inline

Returns the two-sided flag.

If missing, defaults to 0

Returns
the two-sided flag

◆ getWireframe()

int jassimp.AiMaterial.getWireframe ( )
inline

Returns the wireframe flag.

If missing, defaults to 0

Returns
the wireframe flag

◆ hasProperties()

boolean jassimp.AiMaterial.hasProperties ( Set< PropertyKey keys)
inline

Checks whether the given set of properties is available.

Parameters
keysthe keys to check
Returns
true if all properties are available, false otherwise

◆ setDefault()

void jassimp.AiMaterial.setDefault ( PropertyKey  key,
Object  defaultValue 
)
inline

Sets a default value.

The passed in Object must match the type of the key as returned by the corresponding getXXX() method.

Parameters
keythe key
defaultValuethe new default, may not be null
Exceptions
IllegalArgumentExceptionif defaultValue is null or has a wrong type

The documentation for this class was generated from the following file: