SDK:
- remove some queueing to make tool selection update faster git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9352 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
eaf415cd80
commit
714484047b
@ -104,7 +104,7 @@ public class SceneComposerToolController extends SceneToolController {
|
|||||||
onTopToolsNode.updateGeometricState();
|
onTopToolsNode.updateGeometricState();
|
||||||
}
|
}
|
||||||
if (editTool != null) {
|
if (editTool != null) {
|
||||||
editTool.updateToolsTransformation();
|
editTool.doUpdateToolsTransformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -154,13 +154,7 @@ public class SceneComposerToolController extends SceneToolController {
|
|||||||
|
|
||||||
public void selectedSpatialTransformed() {
|
public void selectedSpatialTransformed() {
|
||||||
if (editTool != null) {
|
if (editTool != null) {
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Object>() {
|
editTool.updateToolsTransformation();
|
||||||
|
|
||||||
public Object call() throws Exception {
|
|
||||||
editTool.updateToolsTransformation();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,25 +123,31 @@ public abstract class SceneEditTool {
|
|||||||
/**
|
/**
|
||||||
* Called when the selected spatial has been modified
|
* Called when the selected spatial has been modified
|
||||||
* outside of the tool.
|
* outside of the tool.
|
||||||
|
* TODO: why? just move the tool where the object is each frame?
|
||||||
*/
|
*/
|
||||||
public void updateToolsTransformation() {
|
public void updateToolsTransformation() {
|
||||||
|
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Object>() {
|
SceneApplication.getApplication().enqueue(new Callable<Object>() {
|
||||||
|
|
||||||
public Object call() throws Exception {
|
public Object call() throws Exception {
|
||||||
if (toolController.getSelectedSpatial() != null) {
|
doUpdateToolsTransformation();
|
||||||
axisMarker.setLocalTranslation(toolController.getSelectedSpatial().getWorldTranslation());
|
|
||||||
axisMarker.setLocalRotation(toolController.getSelectedSpatial().getWorldRotation());
|
|
||||||
setAxisMarkerScale(toolController.getSelectedSpatial());
|
|
||||||
} else {
|
|
||||||
axisMarker.setLocalTranslation(Vector3f.ZERO);
|
|
||||||
axisMarker.setLocalRotation(Quaternion.IDENTITY);
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void doUpdateToolsTransformation() {
|
||||||
|
if (toolController.getSelectedSpatial() != null) {
|
||||||
|
axisMarker.setLocalTranslation(toolController.getSelectedSpatial().getWorldTranslation());
|
||||||
|
axisMarker.setLocalRotation(toolController.getSelectedSpatial().getWorldRotation());
|
||||||
|
setAxisMarkerScale(toolController.getSelectedSpatial());
|
||||||
|
} else {
|
||||||
|
axisMarker.setLocalTranslation(Vector3f.ZERO);
|
||||||
|
axisMarker.setLocalRotation(Quaternion.IDENTITY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adjust the scale of the marker so it is relative to the size of the
|
* Adjust the scale of the marker so it is relative to the size of the
|
||||||
* selected spatial. It will have a minimum scale of 2.
|
* selected spatial. It will have a minimum scale of 2.
|
||||||
|
@ -145,7 +145,7 @@ public class MoveTool extends SceneEditTool {
|
|||||||
if (character != null) {
|
if (character != null) {
|
||||||
character.setPhysicsLocation(toolController.getSelectedSpatial().getWorldTranslation());
|
character.setPhysicsLocation(toolController.getSelectedSpatial().getWorldTranslation());
|
||||||
}
|
}
|
||||||
updateToolsTransformation();
|
doUpdateToolsTransformation();
|
||||||
|
|
||||||
wasDragging = true;
|
wasDragging = true;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ public class ScaleTool extends SceneEditTool {
|
|||||||
Vector3f scale = toolController.getSelectedSpatial().getLocalScale().add(diff, diff, diff);
|
Vector3f scale = toolController.getSelectedSpatial().getLocalScale().add(diff, diff, diff);
|
||||||
lastScale = scale;
|
lastScale = scale;
|
||||||
toolController.getSelectedSpatial().setLocalScale(scale);
|
toolController.getSelectedSpatial().setLocalScale(scale);
|
||||||
updateToolsTransformation();
|
doUpdateToolsTransformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
wasDragging = true;
|
wasDragging = true;
|
||||||
|
@ -44,7 +44,7 @@ public class SelectTool extends SceneEditTool {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
updateToolsTransformation();
|
doUpdateToolsTransformation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user