Browse Source

fixing codacy issue

rickard 3 years ago
parent
commit
4987c58ed8

+ 2 - 3
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerToolController.java

@@ -398,7 +398,7 @@ public class SceneComposerToolController extends SceneToolController {
      */
     public void updateSelectedTranslation(Vector3f translation, Vector3f constraints) {
         if (isSnapToScene()) {
-            translation = snapToScene(translation);
+            translation.set(snapToScene(translation));
         }
         if (isSnapToGrid()) {
             translation.set(
@@ -451,8 +451,7 @@ public class SceneComposerToolController extends SceneToolController {
     private Vector3f snapToScene(final Vector3f position) {
         final Ray ray = new Ray(position, Vector3f.UNIT_Y.negate());
         final CollisionResults collisionResults = new CollisionResults();
-        final Node root = getRootNode().getLookup()
-                .lookup(Node.class);
+        final Node root = getRootNode().getLookup().lookup(Node.class);
         root.collideWith(ray, collisionResults);
         for (CollisionResult r : collisionResults) {
             if (r.getGeometry() != selected) {