Fix issue #255 - scenecomposer : forcedCamera

- Now you can't use scenecomposer tool while overiding the camera control
 - Fixed a tool modificaton not undo/redo able.
experimental
Maselbas 10 years ago
parent f9be42ee62
commit 684c923632
  1. 20
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/ComposerCameraController.java

@ -79,26 +79,24 @@ public class ComposerCameraController extends AbstractCameraController {
@Override @Override
public void checkClick(int button, boolean pressed) { public void checkClick(int button, boolean pressed) {
if (button == 0) { if (!forceCameraControls || !pressed) { // dont call toolController while forceCam but on button release (for UndoRedo)
if (isEditButtonEnabled() && !forceCameraControls) { if (button == 0) {
toolController.doEditToolActivatedPrimary(new Vector2f(mouseX, mouseY), pressed, cam); toolController.doEditToolActivatedPrimary(new Vector2f(mouseX, mouseY), pressed, cam);
} }
} if (button == 1) {
if (button == 1) {
if (isEditButtonEnabled() && !forceCameraControls) {
toolController.doEditToolActivatedSecondary(new Vector2f(mouseX, mouseY), pressed, cam); toolController.doEditToolActivatedSecondary(new Vector2f(mouseX, mouseY), pressed, cam);
} }
} }
} }
@Override @Override
protected void checkDragged(int button, boolean pressed) { protected void checkDragged(int button, boolean pressed) {
if (button == 0) { if (!forceCameraControls || !pressed) {
toolController.doEditToolDraggedPrimary(new Vector2f(mouseX, mouseY), pressed, cam); if (button == 0) {
} else if (button == 1) { toolController.doEditToolDraggedPrimary(new Vector2f(mouseX, mouseY), pressed, cam);
toolController.doEditToolDraggedSecondary(new Vector2f(mouseX, mouseY), pressed, cam); } else if (button == 1) {
toolController.doEditToolDraggedSecondary(new Vector2f(mouseX, mouseY), pressed, cam);
}
} }
} }

Loading…
Cancel
Save