SDK SceneComposer : small modifications on the PickManager, now the camera rotation isn't cloned so it's no more necessary to update the rotation before the updataPick()

experimental
Maselbas 10 years ago
parent f6b7c3819a
commit 92ab8b8060
  1. 12
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/PickManager.java

@ -33,9 +33,9 @@ public class PickManager {
private Spatial spatial;
private SceneComposerToolController.TransformationType transformationType;
protected static final Quaternion PLANE_XY = new Quaternion().fromAngleAxis(0, new Vector3f(1, 0, 0));
protected static final Quaternion PLANE_YZ = new Quaternion().fromAngleAxis(-FastMath.PI / 2, new Vector3f(0, 1, 0));//YAW090
protected static final Quaternion PLANE_XZ = new Quaternion().fromAngleAxis(FastMath.PI / 2, new Vector3f(1, 0, 0)); //PITCH090
public static final Quaternion PLANE_XY = new Quaternion().fromAngleAxis(0, new Vector3f(1, 0, 0));
public static final Quaternion PLANE_YZ = new Quaternion().fromAngleAxis(-FastMath.PI / 2, new Vector3f(0, 1, 0));//YAW090
public static final Quaternion PLANE_XZ = new Quaternion().fromAngleAxis(FastMath.PI / 2, new Vector3f(1, 0, 0)); //PITCH090
public PickManager() {
@ -75,7 +75,7 @@ public class PickManager {
origineRotation = new Quaternion(Quaternion.IDENTITY);
} else if (transformationType == SceneComposerToolController.TransformationType.camera) {
rot.set(camera.getRotation());
origineRotation = camera.getRotation().clone();
origineRotation = camera.getRotation();
}
plane.setLocalRotation(rot);
}
@ -87,10 +87,6 @@ public class PickManager {
* @return true if the the new picked location is set, else return false.
*/
public boolean updatePick(Camera camera, Vector2f screenCoord) {
if(transformationType == SceneComposerToolController.TransformationType.camera){
origineRotation = camera.getRotation();
plane.setLocalRotation(camera.getRotation());
}
finalPickLoc = SceneEditTool.pickWorldLocation(camera, screenCoord, plane, null);
return finalPickLoc != null;
}

Loading…
Cancel
Save