Explorar el Código

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

rem..om hace 13 años
padre
commit
47b23b40dd

+ 2 - 2
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveManager.java

@@ -119,10 +119,10 @@ public class MoveManager {
             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 = spatial.getParent().getWorldRotation().inverse().normalizeLocal().multLocal(newPos);
-        newPos.divideLocal(spatial.getWorldScale());
+       
         lastLoc = newPos;
         spatial.setLocalTranslation(newPos);
 

+ 6 - 2
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/SelectTool.java

@@ -472,8 +472,12 @@ public class SelectTool extends SceneEditTool {
                         }
 
                         private void doSelect() {
-                            SceneViewerTopComponent.findInstance().setActivatedNodes(new org.openide.nodes.Node[]{rootNode.getChild(selec)});                            
-                            SceneExplorerTopComponent.findInstance().setSelectedNode(rootNode.getChild(selec));
+                            //in case of  linked assets the selected nod ein the viewer is not necessarily in the explorer.
+                            JmeSpatial n = rootNode.getChild(selec);
+                            if(n!= null){
+                                SceneViewerTopComponent.findInstance().setActivatedNodes(new org.openide.nodes.Node[]{n});                            
+                                SceneExplorerTopComponent.findInstance().setSelectedNode(n);
+                            }
                         }
                     });
                 }