* Fixed bug with Spatial.localToWorld() and Spatial.worldToLocal() not using checkDoTransformUpdate()

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7263 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent 23867c866d
commit 190767e7be
  1. 5
      engine/src/core/com/jme3/scene/Spatial.java

@ -656,6 +656,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable {
* @return the result (store)
*/
public Vector3f localToWorld(final Vector3f in, Vector3f store) {
checkDoTransformUpdate();
return worldTransform.transformVector(in, store);
}
@ -670,6 +671,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable {
* @return the result (store)
*/
public Vector3f worldToLocal(final Vector3f in, final Vector3f store) {
checkDoTransformUpdate();
return worldTransform.transformInverseVector(in, store);
}
@ -1085,6 +1087,9 @@ public abstract class Spatial implements Savable, Cloneable, Collidable {
clone.localLights.setOwner(clone);
clone.worldLights.setOwner(clone);
// No need to force cloned to update.
// This node already has the refresh flags
// set below so it will have to update anyway.
clone.worldTransform = worldTransform.clone();
clone.localTransform = localTransform.clone();

Loading…
Cancel
Save