[Committed] Arrow Getters in AxisRods

Considering that one of the jobs of axis rods in a 3D application would be manipulating spaces by using them, the ability to get the individual arrows would seem like an obvious, unobtrusive addition :slight_smile:



Index: src/com/jme/scene/shape/AxisRods.java
===================================================================
--- src/com/jme/scene/shape/AxisRods.java   (revision 4779)
+++ src/com/jme/scene/shape/AxisRods.java   (working copy)
@@ -45,7 +45,7 @@
 import com.jme.util.export.OutputCapsule;
 
 /**
- * Three coloured arrows, one pointing along each axis.
+ * Three colored arrows, one pointing along each axis.
  *
  * @author Joshua Slack
  * @version $Revision$, $Date$
@@ -169,4 +169,16 @@
         capsule.write(rightHanded, "rightHanded", true);
     }
 
+   public Arrow getxAxis() {
+      return xAxis;
+   }
+
+   public Arrow getyAxis() {
+      return yAxis;
+   }
+
+   public Arrow getzAxis() {
+      return zAxis;
+   }
+
 }

Hmm, never really seen AxisRods lol, and they are exactly what I need. Any idea of how to render them always in top right corner of the screen (this means probably in ortho)?

Do you want them to be rotatable, kind of like they way you can see your orientation in Maya?  If so, then ortho isn't what you want‚Ķ  You'd instead be looking to convert 2D screen coordinate into a Vector3f position with something like



Absolute Mouse am = new AbsoluteMouse("The Mouse", DisplaySystem.getDisplaySystem().getWidth(), DisplaySystem.getDisplaySystem().getHeight());
am.setLocalTranslation(new Vector3f(DisplaySystem.getDisplaySystem().getWidth() / 2, DisplaySystem.getDisplaySystem().getHeight() / 2, 0));
am.registerWithInputHandler(input);
Vector2f screenPos = new Vector2f();
// Get the position that the mouse is pointing to
screenPos.set(am.getHotSpotPosition().x, am.getHotSpotPosition().y);
Vector3f worldCoords = DisplaySystem.getDisplaySystem().getWorldCoordinates(screenPos, 0);

Actually I want them to be rotatable yes. :slight_smile:

And kinda like Maya has axis rods in lower left corner, but I think this still should be in ortho, since its drawn on top of everything else…