Odd Bounding Box Bug

Not really sure where to post about bugs, so its going here.

If you use setLocalRotation(0.0f, 0.0f, 0.0f) on a node, all the nodes bounding volumes get messed up. 

The reason this showed up for me is because I am loading model positioning from a database.

Bounding without setting local rotation:

Bounding setting local rotation (0, 0, 0):

Sample code showing the issue:

import com.jme.app.AbstractGame;
import com.jme.app.SimpleGame;
import com.jme.bounding.BoundingSphere;
import com.jme.math.FastMath;
import com.jme.math.Quaternion;
import com.jme.math.Vector3f;
import com.jme.scene.Node;
import com.jme.util.export.binary.BinaryImporter;
import com.jmex.model.converters.FormatConverter;
import com.jmex.model.converters.ObjToJme;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;

public class TestModelBounding extends SimpleGame
  private static final Logger logger = Logger
  public static void main(String[] args)
    TestModelBounding app = new TestModelBounding();
    // Turn the logger off so we can see the XML later on
  protected void simpleInitGame()
    showBounds = true;
    // Point to a URL of my model
    URL model=TestModelBounding.class.getClassLoader().getResource("jmetest/data/model/maggie.obj");
    // Create something to convert .obj format to .jme
    FormatConverter converter=new ObjToJme();
    // Point the converter to where it will find the .mtl file from
    // This byte array will hold my .jme file
    ByteArrayOutputStream BO=new ByteArrayOutputStream();
      // Use the format converter to convert .obj to .jme
      converter.convert(model.openStream(), BO);
      Node maggie=(Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
      // shrink this baby down some
      maggie.setModelBound(new BoundingSphere());


      /*      The code that causes the issue  */

      Quaternion temp=new Quaternion();
      temp.fromAngleAxis(FastMath.PI,new Vector3f(0, 0, 0));
      /*      End of the code block           */
      // Put her on the scene graph
    catch (IOException e)
    {   // Just in case anything happens
      logger.logp(Level.SEVERE, this.getClass().toString(),
        "simpleInitGame()", "Exception", e);

Dardzull said:

If you use setLocalRotation(0.0f, 0.0f, 0.0f)

err, you can't do that - if you mean to setLocalRotation(0.0f, 0.0f, 0.0f, 0.0f)... you should not do that. It is not a valid rotation. Call setLocalRotation(0.0f, 0.0f, 0.0f, 1.0f) instead.

also: new Vector3f(0, 0, 0) is not a valid axis

look at the bright side: you got 20 more fps

HamsterofDeath said:

look at the bright side: you got 20 more fps

haha  :D thats a good tradeoff i assume