Hey guys,
me again xD
I believe, I think much too complicated. I want to fire simply only one arrow of the focal point of the camera to a certain point. For example, a NPC or something. Here is a little picture, in which I sketched the project:
[java]public class Arrow extends Geometry {
public Vector3f dest;
public Vector3f speed = new Vector3f(.00002f,.00002f,.00002f);
public int ttl = 200000; //Time to life
public Arrow() {
super(“Arrow”, Toolset.arrow);
this.setMaterial(Toolset.material[Toolset.BLUE]);
init();
}
public void move() {
this.setLocalTranslation(this.getLocalTranslation().addLocal(this.dest.mult(this.speed.add(this.getLocalScale()))));
this.ttl -= 1;
if(this.ttl == 0) {
init();
}
}
private void init() {
this.dest = new Vector3f(Toolset.OUT);
this.setLocalTranslation(Toolset.OUT);
this.ttl = 40;
}
}[/java]
My problem is the following:
- The rate of the arrow depends on the FPS number. If the FPS is high, you hardly see the arrow, is the FPS low, the arrow is too slow.
- Which class is suitable for an arrow, Geometry, PhysicsNode, PhysicsCharacterNode, Spatial, Particle?
I hope you can help me!
Thanks!
final