/*
* See COPYING in top-level directory.
*/
package com.monkygames.wo.test;
// === jme imports === //
import com.jme3.app.SimpleApplication;
import com.jme3.scene.shape.Box;
import com.jme3.scene.Node;
import com.jme3.math.Vector3f;
import com.jme3.input.*;
import com.jme3.light.*;
// === wo imports === //
import com.monkygames.wo.avatar.*;
import com.monkygames.wo.io.*;
/**
* Displays a Wo!
* @version 1.0
*/
public class ShowWo extends SimpleApplication{
// ============= Constructors ============== //
// ============= Public Methods ============== //
// ============= Protected Methods ============== //
// ============= Private Methods ============== //
// ============= Implemented Methods ============== //
// ============= Extended Methods ============== //
/**
@Override
**/
public void simpleInitApp(){
Node node = new Node("My Root node");
//Box b = new Box("MyBox",new Vector3f(0,0,0),new Vector3f(1,1,1));
//rootNode.attachChild(b);
AvatarXMLParser parser = new AvatarXMLParser();
Avatar avatar = parser.getAvatarFromFile("art/mii/defaultBoy.xml");
System.out.println(avatar);
Avatar3DLoader loader = new Avatar3DLoader();
Model model = loader.loadModel(avatar);
// remove default light to see the colors
//rootNode.setLightCombineMode(Spatial.LightCombineMode.Off);
/*
// Create a point light
PointLight l = new PointLight();
// Give it a location
l.setLocation(new Vector3f(0, 10, 5));
// Make it a red light
//l.setDiffuse(ColorRGBA.red.clone());
// Enable it
l.setEnabled(true);
// Create a LightState to put my light in
LightState ls = display.getRenderer().createLightState();
// Attach the light
ls.attach(l);
node.setRenderState(ls);
*/
node.attachChild(model.root);
rootNode.attachChild(node);
//lightState.detachAll();
}
// ============= Internal Classes ============== //
// ============= Static Methods ============== //
public static void main(String [] args){
ShowWo show = new ShowWo();
//show.setConfigShowMode(ConfigShowMode.AlwaysShow);
show.start();
}
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 noexpandtab
*/