de.rico.engine.resource
Class MeshManager

java.lang.Object
  extended by de.rico.engine.resource.MeshManager

public class MeshManager
extends java.lang.Object

This class can be used as a container that manages the different meshes used in the game. It implements the singleton pattern.

Author:
Frank Bruns

Method Summary
 void add(java.lang.String name, AbstractMesh mesh)
          Adds a mesh to the mesh manager.
 void clear()
          Clears the meshes from the texture manager
 AbstractMesh get(java.lang.String name)
          Returns the mesh that is referenced by the specified name.
static MeshManager getInstance()
          Returns the singleton instance of the mesh manager.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MeshManager getInstance()
Returns the singleton instance of the mesh manager.

Returns:
singleton instance of the mesh manage

add

public void add(java.lang.String name,
                AbstractMesh mesh)
Adds a mesh to the mesh manager. The mesh can later be referenced by the specified name.
Note: To avoid problems, the name for the mesh must be unique!

Parameters:
mesh - mesh to add to the mesh manager

get

public AbstractMesh get(java.lang.String name)
Returns the mesh that is referenced by the specified name.

Parameters:
name - reference name for the mesh to be retrieved
Returns:
mesh that is referenced by the specified name

clear

public void clear()
Clears the meshes from the texture manager