SDK : Scene composer MoveManager now accounts for parent node scale when moving a spatial in the scene composer. This is to avoid the spatial to "jump" when starting moving.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10732 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent e8d38b75f9
commit 20123c74ea
  1. 3
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveManager.java

@ -122,9 +122,10 @@ public class MoveManager {
//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.getParent().getWorldScale());
lastLoc = newPos;
spatial.setLocalTranslation(newPos);
spatial.setLocalTranslation(newPos);
RigidBodyControl control = spatial.getControl(RigidBodyControl.class);
if (control != null) {

Loading…
Cancel
Save