Merge pull request #345 from Georgeto/patch_negscalebb

Fixed wrong BoundingBox transformation, when using negative scaling values
experimental
Kirill Vainer 9 years ago
commit 4e6b4d885c
  1. 2
      jme3-core/src/main/java/com/jme3/bounding/BoundingBox.java

@ -314,7 +314,7 @@ public class BoundingBox extends BoundingVolume {
transMatrix.absoluteLocal();
Vector3f scale = trans.getScale();
vars.vect1.set(xExtent * scale.x, yExtent * scale.y, zExtent * scale.z);
vars.vect1.set(xExtent * FastMath.abs(scale.x), yExtent * FastMath.abs(scale.y), zExtent * FastMath.abs(scale.z));
transMatrix.mult(vars.vect1, vars.vect2);
// Assign the biggest rotations after scales.
box.xExtent = FastMath.abs(vars.vect2.getX());

Loading…
Cancel
Save