fix SceneEditTool :

- axis pick is now available
experimental
Maselbas 10 years ago
parent 684c923632
commit b27f86a3ae
  1. 5
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneEditTool.java

@ -336,7 +336,7 @@ public abstract class SceneEditTool {
CollisionResults results = new CollisionResults(); CollisionResults results = new CollisionResults();
Ray ray = new Ray(); Ray ray = new Ray();
Vector3f pos = cam.getWorldCoordinates(mouseLoc, 0).clone(); Vector3f pos = cam.getWorldCoordinates(mouseLoc, 0).clone();
Vector3f dir = cam.getWorldCoordinates(mouseLoc, 0.1f).clone(); Vector3f dir = cam.getWorldCoordinates(mouseLoc, 0.125f).clone();
dir.subtractLocal(pos).normalizeLocal(); dir.subtractLocal(pos).normalizeLocal();
ray.setOrigin(pos); ray.setOrigin(pos);
ray.setDirection(dir); ray.setDirection(dir);
@ -360,7 +360,7 @@ public abstract class SceneEditTool {
*/ */
protected void highlightAxisMarker(Camera camera, Vector2f screenCoord, AxisMarkerPickType axisMarkerPickType, boolean colorAll) { protected void highlightAxisMarker(Camera camera, Vector2f screenCoord, AxisMarkerPickType axisMarkerPickType, boolean colorAll) {
setDefaultAxisMarkerColors(); setDefaultAxisMarkerColors();
Vector3f picked = pickAxisMarker(camera, screenCoord, axisPickType); Vector3f picked = pickAxisMarker(camera, screenCoord, axisMarkerPickType);
if (picked == null) { if (picked == null) {
return; return;
} }
@ -453,6 +453,7 @@ public abstract class SceneEditTool {
// axis.attachChild(quadYZ); // axis.attachChild(quadYZ);
axis.setModelBound(new BoundingBox()); axis.setModelBound(new BoundingBox());
axis.updateModelBound();
return axis; return axis;
} }

Loading…
Cancel
Save