BoundingBox with 3D models?

How would I setup a bounding model for a 3D model so i can add a chase camera too it? Im trying to mix together two tutorials here so im sure I'm doing something very noob. It gives an error that m_character.getWorldBound() is null later… any ideas?



private void setupCharacter(String model) {

Node r1 = new Node();

       try {

        URL modelToLoad = TestMaxJmeWrite.class.getClassLoader().getResource(model);

        MaxToJme C1 = new MaxToJme();

        ByteArrayOutputStream BO = new ByteArrayOutputStream();

        C1.convert(new BufferedInputStream(modelToLoad.openStream()), BO);

        r1 = (Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));

        r1.setLocalScale(1.0f);

        r1.getController(0).setSpeed(20);

        Quaternion temp = new Quaternion();

        temp.fromAngleAxis(FastMath.PI / 2, new Vector3f(-1, 0, 0));

        r1.setLocalRotation(temp);

        r1.setLocalTranslation(new Vector3f(10,10,0));

        r1.setModelBound(new BoundingBox());

           r1.updateModelBound();

       } catch (Exception e) { System.out.println(e.toString()); }

       

       m_character = new Node("char node");

       rootNode.attachChild(m_character);

       m_character.attachChild(r1);

       m_character.updateWorldBound(); // We do this to allow the camera setup access to the world bound in our setup code.

   }

Figured it out… need to update the geometry…









m_character.updateGeometricState(0, true);