com.jme3.scene.plugins.blender.meshes
Class MeshHelper

java.lang.Object
  extended by com.jme3.scene.plugins.blender.AbstractBlenderHelper
      extended by com.jme3.scene.plugins.blender.meshes.MeshHelper

public class MeshHelper
extends AbstractBlenderHelper

A class that is used in mesh calculations.


Field Summary
 
Fields inherited from class com.jme3.scene.plugins.blender.AbstractBlenderHelper
blenderVersion, fixUpAxis, upAxisRotationQuaternion
 
Constructor Summary
MeshHelper(java.lang.String blenderVersion, boolean fixUpAxis)
          This constructor parses the given blender version and stores the result.
 
Method Summary
 java.util.List<byte[]> getVerticesColors(Structure meshStructure, BlenderContext blenderContext)
          This method returns the vertices colors.
 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.
 java.util.List<Geometry> toMesh(Structure structure, BlenderContext blenderContext)
          This method reads converts the given structure into mesh.
 
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
 

Constructor Detail

MeshHelper

public MeshHelper(java.lang.String blenderVersion,
                  boolean fixUpAxis)
This constructor parses the given blender version and stores the result. Some functionalities may differ in different blender versions.

Parameters:
blenderVersion - the version read from the blend file
fixUpAxis - a variable that indicates if the Y asxis is the UP axis or not
Method Detail

toMesh

public java.util.List<Geometry> toMesh(Structure structure,
                                       BlenderContext blenderContext)
                                throws BlenderFileException
This method reads converts the given structure into mesh. The given structure needs to be filled with the appropriate data.

Parameters:
structure - the structure we read the mesh from
Returns:
the mesh feature
Throws:
BlenderFileException

getVerticesColors

public java.util.List<byte[]> getVerticesColors(Structure meshStructure,
                                                BlenderContext blenderContext)
                                         throws BlenderFileException
This method returns the vertices colors. Each vertex is stored in byte[4] array.

Parameters:
meshStructure - the structure containing the mesh data
blenderContext - the blender context
Returns:
a list of vertices colors, each color belongs to a single vertex
Throws:
BlenderFileException - this exception is thrown when the blend file structure is somehow invalid or corrupted

shouldBeLoaded

public boolean shouldBeLoaded(Structure structure,
                              BlenderContext blenderContext)
Description copied from class: AbstractBlenderHelper
This method analyzes the given structure and the data contained within blender context and decides if the feature should be loaded.

Specified by:
shouldBeLoaded in class AbstractBlenderHelper
Parameters:
structure - structure to be analyzed
blenderContext - the blender context
Returns:
true if the feature should be loaded and false otherwise