3 import com.jme3.animation.AnimChannel;
4 import com.jme3.animation.AnimControl;
5 import com.jme3.asset.AssetManager;
6 import com.jme3.math.Vector3f;
7 import com.jme3.scene.Node;
23 public AnimControl control;
24 public AnimChannel channel;
27 double degreeDir = as.dir;
31 this.fAdr = ((
id >> 16) & 0xffff) +
"." + (
id & 0xffff);
32 this.numNear = as.numNear;
33 this.numVis = as.numVisible;
34 this.dir =
new Vector3f((
float) Math.sin(degreeDir*Math.PI/180),0f,(float)Math.cos(degreeDir*Math.PI/180));
35 this.user = (Node) am.loadModel(
"Models/Oto.j3o");
37 user.lookAt(user.getLocalTranslation().add(dir),
new Vector3f(0,1,0));
38 user.setLocalTranslation((
float) x,9.5f,(
float) y);
39 user.setLocalScale(2f);
40 rootNode.attachChild(user);
41 control = user.getControl(AnimControl.class);
42 channel = control.createChannel();
43 channel.setAnim(
"Walk");
45 public void remove(Node rootNode) {
46 rootNode.detachChild(user);
49 double degreeDir = as.dir;
52 this.numNear = as.numNear;
53 this.numVis = as.numVisible;
54 this.dir =
new Vector3f((
float) Math.sin(degreeDir*Math.PI/180),0f,(float)Math.cos(degreeDir*Math.PI/180));
58 user.lookAt(
new Vector3f((
float)this.x,9.5f,(
float)this.y),
new Vector3f(0,1,0));
59 user.setLocalTranslation(
new Vector3f((
float) this.x,9.5f,(
float) this.y));