import net.sf.jirr.*;
public class ApplicationManager
{
static protected ApplicationManager instance = null;
static public ApplicationManager getInstance()
{
if (instance == null)
instance = new ApplicationManager();
return instance;
}
protected ApplicationManager()
{
}
public void startApplicationManager()
{
vector3df position = new vector3df(0, 0, 0);
// load a mesh
IAnimatedMesh mesh = EngineManager.getInstance().getSceneManager().getMesh("faerie.md2");
// add it to the scene
IAnimatedMeshSceneNode node = EngineManager.getInstance().getSceneManager().addAnimatedMeshSceneNode(mesh);
node.setPosition(position);
node.setScale(new vector3df(1, 1, 1));
node.setRotation(new vector3df(0, 90, 0));
// reset the normals to get the correct lighting effect
node.setMaterialFlag(E_MATERIAL_FLAG.EMF_NORMALIZE_NORMALS, true);
if (node != null)
{
// set the animation sequence
node.setMD2Animation (EMD2_ANIMATION_TYPE.EMAT_STAND);
// add the texture to the model
node.setMaterialTexture(0L, EngineManager.getInstance().getVideoDriver().getTexture("faerie2.bmp"));
}
new CirclingLight().startupCirclingLight(position, new vector3df(0, 0, 25), new vector3df(90, 0, 0), new SColorf(1.0f, 0.0f, 0.0f, 1.0f));
new CirclingLight().startupCirclingLight(position, new vector3df(25, 0, 0), new vector3df(0, 0, 90), new SColorf(0.0f, 1.0f, 0.0f, 1.0f));
new CirclingLight().startupCirclingLight(position, new vector3df(25, 0, 0), new vector3df(0, 90, 0), new SColorf(0.0f, 0.0f, 1.0f, 1.0f));
}
public void shutdown()
{
}
}
|