From 8a5da0eb0e1ae03796928bfd18f99f32626c25e8 Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Sat, 23 Sep 2017 14:36:01 -0700 Subject: [PATCH] Geometry: set worldTransform to identity if ignoreTranform is true --- .../src/main/java/com/jme3/scene/Geometry.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/scene/Geometry.java b/jme3-core/src/main/java/com/jme3/scene/Geometry.java index 9bd7ace97..6ba209bc3 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Geometry.java +++ b/jme3-core/src/main/java/com/jme3/scene/Geometry.java @@ -137,6 +137,20 @@ public class Geometry extends Spatial { return super.checkCulling(cam); } + /** + * Update the world transform of this Geometry and clear the + * TRANSFORM refresh flag. + */ + @Override + void checkDoTransformUpdate() { + if (ignoreTransform) { + worldTransform.loadIdentity(); + refreshFlags &= ~RF_TRANSFORM; + } else { + super.checkDoTransformUpdate(); + } + } + /** * @return If ignoreTransform mode is set. * @@ -151,6 +165,7 @@ public class Geometry extends Spatial { */ public void setIgnoreTransform(boolean ignoreTransform) { this.ignoreTransform = ignoreTransform; + setTransformRefresh(); } /** @@ -398,9 +413,6 @@ public class Geometry extends Spatial { // Compute the cached world matrix cachedWorldMat.loadIdentity(); - if (ignoreTransform) { - return; - } cachedWorldMat.setRotationQuaternion(worldTransform.getRotation()); cachedWorldMat.setTranslation(worldTransform.getTranslation());