SDK :
- Select Tool Fxed NPE when selecting a child node of a lonked asset in the viewer. - Move tool fixed bad application of scale when moving. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9647 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
16851eb1d8
commit
9179c9e401
@ -119,10 +119,10 @@ public class MoveManager {
|
|||||||
newPos.set(Math.round(newPos.x), Math.round(newPos.y), Math.round(newPos.z));
|
newPos.set(Math.round(newPos.x), Math.round(newPos.y), Math.round(newPos.z));
|
||||||
}
|
}
|
||||||
|
|
||||||
//computing the inverse world transform to get the new localtranslation
|
//computing the inverse world transform to get the new localtranslation
|
||||||
newPos.subtractLocal(spatial.getParent().getWorldTranslation());
|
newPos.subtractLocal(spatial.getParent().getWorldTranslation());
|
||||||
newPos = spatial.getParent().getWorldRotation().inverse().normalizeLocal().multLocal(newPos);
|
newPos = spatial.getParent().getWorldRotation().inverse().normalizeLocal().multLocal(newPos);
|
||||||
newPos.divideLocal(spatial.getWorldScale());
|
|
||||||
lastLoc = newPos;
|
lastLoc = newPos;
|
||||||
spatial.setLocalTranslation(newPos);
|
spatial.setLocalTranslation(newPos);
|
||||||
|
|
||||||
|
@ -472,8 +472,12 @@ public class SelectTool extends SceneEditTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void doSelect() {
|
private void doSelect() {
|
||||||
SceneViewerTopComponent.findInstance().setActivatedNodes(new org.openide.nodes.Node[]{rootNode.getChild(selec)});
|
//in case of linked assets the selected nod ein the viewer is not necessarily in the explorer.
|
||||||
SceneExplorerTopComponent.findInstance().setSelectedNode(rootNode.getChild(selec));
|
JmeSpatial n = rootNode.getChild(selec);
|
||||||
|
if(n!= null){
|
||||||
|
SceneViewerTopComponent.findInstance().setActivatedNodes(new org.openide.nodes.Node[]{n});
|
||||||
|
SceneExplorerTopComponent.findInstance().setSelectedNode(n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user