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

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

public class MeshContext
extends java.lang.Object

Class that holds information about the mesh.


Constructor Summary
MeshContext()
           
 
Method Summary
 void addUVCoordinates(Geometry geometry, VertexBuffer vertexBuffer)
          This method adds the mesh's UV-coordinates.
 VertexBuffer getBindNormalBuffer()
           
 VertexBuffer getBindPoseBuffer()
           
 int getMaterialIndex(Geometry geometry)
          Returns material index for the geometry.
 VertexBuffer getUVCoordinates(Geometry geometry)
          This method returns the mesh's UV-coordinates.
 int getVertexCount(int materialIndex)
           
 java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> getVertexReferenceMap(int materialIndex)
          This method returns the vertex reference map.
 void putGeometry(java.lang.Integer materialIndex, Geometry geometry)
          Adds a geometry for the specified material index.
 void setBindNormalBuffer(VertexBuffer bindNormalBuffer)
          This method sets the bind buffer for vertices.
 void setBindPoseBuffer(VertexBuffer bindPoseBuffer)
          This method sets the bind buffer for normals.
 void setVertexReferenceMap(java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>>> vertexReferenceMap)
          This method sets the vertex reference map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeshContext

public MeshContext()
Method Detail

putGeometry

public void putGeometry(java.lang.Integer materialIndex,
                        Geometry geometry)
Adds a geometry for the specified material index.

Parameters:
materialIndex - the material index
geometry - the geometry

getVertexCount

public int getVertexCount(int materialIndex)
Parameters:
materialIndex - the material index
Returns:
vertices amount that is used by mesh with the specified material

getMaterialIndex

public int getMaterialIndex(Geometry geometry)
Returns material index for the geometry.

Parameters:
geometry - the geometry
Returns:
material index
Throws:
java.lang.IllegalStateException - this exception is thrown when no material is found for the specified geometry

getVertexReferenceMap

public java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> getVertexReferenceMap(int materialIndex)
This method returns the vertex reference map.

Returns:
the vertex reference map

setVertexReferenceMap

public void setVertexReferenceMap(java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>>> vertexReferenceMap)
This method sets the vertex reference map.

Parameters:
vertexReferenceMap - the vertex reference map

addUVCoordinates

public void addUVCoordinates(Geometry geometry,
                             VertexBuffer vertexBuffer)
This method adds the mesh's UV-coordinates.

Parameters:
geometry - the mesh that has the UV-coordinates
vertexBuffer - the mesh's UV-coordinates

getUVCoordinates

public VertexBuffer getUVCoordinates(Geometry geometry)
This method returns the mesh's UV-coordinates.

Parameters:
geometry - the mesh
Returns:
the mesh's UV-coordinates

setBindNormalBuffer

public void setBindNormalBuffer(VertexBuffer bindNormalBuffer)
This method sets the bind buffer for vertices.

Parameters:
bindNormalBuffer - the bind buffer for vertices

getBindNormalBuffer

public VertexBuffer getBindNormalBuffer()
Returns:
the bind buffer for vertices

setBindPoseBuffer

public void setBindPoseBuffer(VertexBuffer bindPoseBuffer)
This method sets the bind buffer for normals.

Parameters:
bindNormalBuffer - the bind buffer for normals

getBindPoseBuffer

public VertexBuffer getBindPoseBuffer()
Returns:
the bind buffer for normals