|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.scene.plugins.blender.AbstractBlenderHelper
com.jme3.scene.plugins.blender.materials.MaterialHelper
public class MaterialHelper
Nested Class Summary | |
---|---|
static class |
MaterialHelper.DiffuseShader
The type of the material's diffuse shader. |
static class |
MaterialHelper.SpecularShader
The type of the material's specular shader. |
Field Summary | |
---|---|
static java.lang.Integer |
ALPHA_MASK_CIRCLE
|
static java.lang.Integer |
ALPHA_MASK_CONE
|
static java.lang.Integer |
ALPHA_MASK_HYPERBOLE
|
static java.lang.Integer |
ALPHA_MASK_NONE
|
protected java.util.Map<java.lang.Integer,com.jme3.scene.plugins.blender.materials.IAlphaMask> |
alphaMasks
|
protected static float |
DEFAULT_SHININESS
|
static java.lang.String |
TEXTURE_TYPE_ALPHA
|
static java.lang.String |
TEXTURE_TYPE_COLOR
|
static java.lang.String |
TEXTURE_TYPE_DIFFUSE
|
static java.lang.String |
TEXTURE_TYPE_GLOW
|
static java.lang.String |
TEXTURE_TYPE_NORMAL
|
static java.lang.String |
TEXTURE_TYPE_SPECULAR
|
Fields inherited from class com.jme3.scene.plugins.blender.AbstractBlenderHelper |
---|
blenderVersion, fixUpAxis, upAxisRotationQuaternion |
Constructor Summary | |
---|---|
MaterialHelper(java.lang.String blenderVersion,
boolean fixUpAxis)
This constructor parses the given blender version and stores the result. |
Method Summary | |
---|---|
MaterialContext[] |
getMaterials(Structure structureWithMaterials,
BlenderContext blenderContext)
This method returns the table of materials connected to the specified structure. |
Material |
getNonTexturedMaterial(Material material,
int imageType)
This method returns a material similar to the one given but without textures. |
Material |
getParticlesMaterial(Material material,
java.lang.Integer alphaMaskIndex,
BlenderContext blenderContext)
This method converts the given material into particles-usable material. |
boolean |
hasTexture(Material material)
This method indicates if the material has any kind of texture. |
boolean |
hasTexture(Material material,
java.lang.String textureType)
This method indicates if the material has a texture of a specified type. |
void |
hsvToRgb(float h,
float s,
float v,
float[] rgb)
This method converts rgb values to hsv values. |
void |
rgbToHsv(float r,
float g,
float b,
float[] hsv)
This method converts rgb values to hsv values. |
boolean |
shouldBeLoaded(Structure structure,
BlenderContext blenderContext)
This method analyzes the given structure and the data contained within blender context and decides if the feature should be loaded. |
MaterialContext |
toMaterialContext(Structure structure,
BlenderContext blenderContext)
This method converts the material structure to jme Material. |
Methods inherited from class com.jme3.scene.plugins.blender.AbstractBlenderHelper |
---|
applyProperties, clearState, isBlank, loadProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final float DEFAULT_SHININESS
public static final java.lang.String TEXTURE_TYPE_COLOR
public static final java.lang.String TEXTURE_TYPE_DIFFUSE
public static final java.lang.String TEXTURE_TYPE_NORMAL
public static final java.lang.String TEXTURE_TYPE_SPECULAR
public static final java.lang.String TEXTURE_TYPE_GLOW
public static final java.lang.String TEXTURE_TYPE_ALPHA
public static final java.lang.Integer ALPHA_MASK_NONE
public static final java.lang.Integer ALPHA_MASK_CIRCLE
public static final java.lang.Integer ALPHA_MASK_CONE
public static final java.lang.Integer ALPHA_MASK_HYPERBOLE
protected final java.util.Map<java.lang.Integer,com.jme3.scene.plugins.blender.materials.IAlphaMask> alphaMasks
Constructor Detail |
---|
public MaterialHelper(java.lang.String blenderVersion, boolean fixUpAxis)
blenderVersion
- the version read from the blend filefixUpAxis
- a variable that indicates if the Y asxis is the UP axis or notMethod Detail |
---|
public MaterialContext toMaterialContext(Structure structure, BlenderContext blenderContext) throws BlenderFileException
structure
- structure with material datablenderContext
- the blender context
BlenderFileException
- an exception is throw when problems with blend file occurpublic Material getNonTexturedMaterial(Material material, int imageType)
material
- a material to be cloned without texturesimageType
- type of image defined by blender; the constants are defined in TextureHelper
public Material getParticlesMaterial(Material material, java.lang.Integer alphaMaskIndex, BlenderContext blenderContext)
material
- the source materialblenderContext
- the blender context
public boolean hasTexture(Material material)
material
- the material
public boolean hasTexture(Material material, java.lang.String textureType)
material
- the materialtextureType
- the type of the texture
public MaterialContext[] getMaterials(Structure structureWithMaterials, BlenderContext blenderContext) throws BlenderFileException
structureWithMaterials
- the structure containing the mesh datablenderContext
- the blender context
BlenderFileException
- this exception is thrown when the blend file structure is somehow invalid or corruptedpublic void rgbToHsv(float r, float g, float b, float[] hsv)
r
- red value of the colorg
- green value of the colorb
- blue value of the colorhsv
- hsv values of a color (this table contains the result of the transformation)public void hsvToRgb(float h, float s, float v, float[] rgb)
h
- hues
- saturationv
- valuergb
- rgb result vector (should have 3 elements)public boolean shouldBeLoaded(Structure structure, BlenderContext blenderContext)
AbstractBlenderHelper
shouldBeLoaded
in class AbstractBlenderHelper
structure
- structure to be analyzedblenderContext
- the blender context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |