package a3test.autocontrol;

import jp.sourceforge.acerola3d.a3.*;

public class A3Auto {
    public static void main(String args[]) throws Exception {
        A3Window w = new A3Window(300,300);

        Action3D a3 = Action3D.load("x-res:///vesma9.a3");
        a3.setEnableBehavior(true);
        a3.setAutoDirectionControl(true);
        a3.setAutoActionControl(true);
        a3.setHaltAction("default");
        a3.setWalkAction("walk");
        a3.setRunAction("run");
        a3.setMinWalkSpeed(0.01);
        a3.setMinRunSpeed(1.1);
        //a3.setUpperVector(new Vector3d(0.0,-1.0,0.0));
        //a3.setUpperVector(new Vector3d(1.0,0.0,0.0));
        w.add(a3);
        w.setCameraLocImmediately(0.0,0.0,5.0);
        double theta=0.0;
        while (true) {
            try{Thread.sleep(100);}catch(Exception e){;}
            a3.setLoc(Math.cos(theta),Math.sin(theta),Math.sin(theta));
            //a3.setLoc(Math.cos(theta),0.0,Math.sin(theta));
            theta = theta + 0.1;
        }
    }
}
