Anchored Arrows

Hi there,

I am trying to link two Geometry instances by means of an arrow. Ideally, the arrow geometry itself (shaft, foot, head) would update automatically as soon as either of the linked Geometries has updated its transform (locally or due to dependencies up the scene graph).

Does anyone have an idea how I could implement this elegantly in JME?

Thanks a bunch!

I’m impressed by your fast response. Thanks, Normen!

I have studied already quite a bit of the code base and of course, I have already stumbled across the debug arrow. What I would like to have, though, is an arrow that links to Spatials and if either of them updates its transforms, it also, automatically, updates its geometry. Any ideas?

/sigh… Here, untested, off the top of my head:

[java]public class ArrowUpdateControl implements Control{
Spatial spatial1, spatial2;

public ArrowUpdateControl(Spatial spatial1, Spatial spatial2){

public void update(float tpf){
    //we know our spatial is an Arrow
    Arrow arrow = (Arrow)spatial;


Arrow arrow = new Arrow(Vector3f.ZERO);
arrow.addControl(new ArrowUpdateControl(spatial1, spatial2);


Great! I hadn’t seen / understood the meaning of Control(s) yet. I am confident I will make it through now.

Thanks and thanks again!