package com.jme3.scene.plugins.blender.meshes; import com.jme3.math.Vector3f; import com.jme3.scene.Geometry; import com.jme3.scene.VertexBuffer; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Class that holds information about the mesh. * * @author Marcin Roguski (Kaelthas) */ public class MeshContext { /** The mesh stored here as a list of geometries. */ private List mesh; /** Vertex list that is referenced by all the geometries. */ private List vertexList; /** The vertex reference map. */ private Map> vertexReferenceMap; /** The UV-coordinates for each of the geometries. */ private Map uvCoordinates = new HashMap(); /** * This method returns the referenced mesh. * * @return the referenced mesh */ public List getMesh() { return mesh; } /** * This method sets the referenced mesh. * * @param mesh * the referenced mesh */ public void setMesh(List mesh) { this.mesh = mesh; } /** * This method returns the vertex list. * * @return the vertex list */ public List getVertexList() { return vertexList; } /** * This method sets the vertex list. * * @param vertexList * the vertex list */ public void setVertexList(List vertexList) { this.vertexList = vertexList; } /** * This method returns the vertex reference map. * * @return the vertex reference map */ public Map> getVertexReferenceMap() { return vertexReferenceMap; } /** * This method sets the vertex reference map. * * @param vertexReferenceMap * the vertex reference map */ public void setVertexReferenceMap( Map> vertexReferenceMap) { this.vertexReferenceMap = vertexReferenceMap; } /** * This method adds the mesh's UV-coordinates. * * @param geometry * the mesh that has the UV-coordinates * @param vertexBuffer * the mesh's UV-coordinates */ public void addUVCoordinates(Geometry geometry, VertexBuffer vertexBuffer) { uvCoordinates.put(geometry, vertexBuffer); } /** * This method returns the mesh's UV-coordinates. * * @param geometry * the mesh * @return the mesh's UV-coordinates */ public VertexBuffer getUVCoordinates(Geometry geometry) { return uvCoordinates.get(geometry); } }