SDK : MoveTool fixed imports and formatted the file
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9599 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
458ce63d15
commit
25efcd4f7b
@ -21,7 +21,6 @@ import com.jme3.scene.Geometry;
|
||||
import com.jme3.scene.Node;
|
||||
import com.jme3.scene.Spatial;
|
||||
import com.jme3.scene.shape.Quad;
|
||||
import com.jme3.util.TempVars;
|
||||
import org.openide.loaders.DataObject;
|
||||
|
||||
/**
|
||||
@ -45,7 +44,6 @@ public class MoveTool extends SceneEditTool {
|
||||
private final Quaternion XY = new Quaternion().fromAngleAxis(0, new Vector3f(1, 0, 0));
|
||||
private final Quaternion YZ = new Quaternion().fromAngleAxis(-FastMath.PI / 2, new Vector3f(0, 1, 0));
|
||||
private final Quaternion XZ = new Quaternion().fromAngleAxis(FastMath.PI / 2, new Vector3f(1, 0, 0));
|
||||
|
||||
//temp vars
|
||||
private Quaternion rot = new Quaternion();
|
||||
private Vector3f newPos = new Vector3f();
|
||||
@ -69,10 +67,6 @@ public class MoveTool extends SceneEditTool {
|
||||
displayPlanes();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPrimary(Vector2f screenCoord, boolean pressed, JmeNode rootNode, DataObject dataObject) {
|
||||
if (!pressed) {
|
||||
@ -88,15 +82,13 @@ public class MoveTool extends SceneEditTool {
|
||||
|
||||
@Override
|
||||
public void actionSecondary(Vector2f screenCoord, boolean pressed, JmeNode rootNode, DataObject dataObject) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMoved(Vector2f screenCoord, JmeNode rootNode, DataObject currentDataObject, JmeSpatial selectedSpatial) {
|
||||
if (pickedPlane == null) {
|
||||
highlightAxisMarker(camera, screenCoord, axisPickType);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
pickedPlane = null;
|
||||
offset = null;
|
||||
}
|
||||
@ -115,21 +107,24 @@ public class MoveTool extends SceneEditTool {
|
||||
return;
|
||||
}
|
||||
|
||||
if (toolController.getSelectedSpatial() == null)
|
||||
if (toolController.getSelectedSpatial() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pickedPlane == null) {
|
||||
pickedPlane = pickAxisMarker(camera, screenCoord, axisPickType);
|
||||
if (pickedPlane == null)
|
||||
if (pickedPlane == null) {
|
||||
return;
|
||||
}
|
||||
startLoc = toolController.getSelectedSpatial().getLocalTranslation().clone();
|
||||
rot = rot.set(toolController.getSelectedSpatial().getWorldRotation());
|
||||
if (pickedPlane.equals(new Vector3f(1,1,0)))
|
||||
if (pickedPlane.equals(new Vector3f(1, 1, 0))) {
|
||||
plane.setLocalRotation(rot.multLocal(XY));
|
||||
else if (pickedPlane.equals(new Vector3f(1,0,1)))
|
||||
} else if (pickedPlane.equals(new Vector3f(1, 0, 1))) {
|
||||
plane.setLocalRotation(rot.multLocal(XZ));
|
||||
else if (pickedPlane.equals(new Vector3f(0,1,1)))
|
||||
} else if (pickedPlane.equals(new Vector3f(0, 1, 1))) {
|
||||
plane.setLocalRotation(rot.multLocal(YZ));
|
||||
}
|
||||
plane.setLocalTranslation(startLoc);
|
||||
}
|
||||
|
||||
@ -183,7 +178,6 @@ public class MoveTool extends SceneEditTool {
|
||||
|
||||
@Override
|
||||
public void draggedSecondary(Vector2f screenCoord, boolean pressed, JmeNode rootNode, DataObject currentDataObject) {
|
||||
|
||||
}
|
||||
|
||||
private class MoveUndo extends AbstractUndoableSceneEdit {
|
||||
|
Loading…
x
Reference in New Issue
Block a user