SharedMesh doubles vertex count

do I something wrong? seems like the SharedMesh is drawn twice.



import com.jme.app.SimpleGame;
import com.jme.math.Vector2f;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.shape.Sphere;
import com.jme.scene.SharedMesh;
import com.jme.bounding.BoundingBox;
import com.jme.renderer.Renderer;

public class SharedMeshTest extends SimpleGame {       
        private TerrainContinuous tc;
 
   public static void main(String[] args) {
       SharedMeshTest app = new SharedMeshTest();
       app.setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG);
       app.start();
   }
 
   protected void simpleInitGame() {
              cam.setFrustumPerspective(45.f, 1.333f, 1.f, 4096.f);               
              cam.update();  
                 
              // 1 Mesh, 32256 Triangles
              Sphere s = new Sphere("Sphere", 128, 128, 32.f);        
              s.setLocalTranslation(new Vector3f(0.f, 0.f, -64.f));
              s.setModelBound(new BoundingBox());
              s.updateModelBound();             
              //rootNode.attachChild(s);  
             
              // 2 Mesh, 64512 Triangles
              SharedMesh sm = new SharedMesh("SharedMesh", s);
              sm.setLocalTranslation(new Vector3f(0.f, 0.f, -64.f));
              rootNode.attachChild(sm);  
             
              rootNode.updateWorldBound();
     }               
       

}

I don't think that's wise, sir.  :wink:



super.draw®;

r.draw(this);



SharedMesh.java


   /**
    * draw renders the target mesh, at the translation, rotation and scale of
    * this shared mesh.
    *
    * @see com.jme.scene.Spatial#draw(com.jme.renderer.Renderer)
    */
   public void draw(Renderer r) {
      
      if (!r.isProcessingQueue()) {
         if (r.checkAndAdd(this))
            return;
      }
      
      applyStates();
      
      target.setLocalTranslation(worldTranslation);
      target.setLocalRotation(worldRotation);
      target.setLocalScale(worldScale);
      target.setDefaultColor(getDefaultColor());
      super.draw(r);
      r.draw(this);
   }

It's a recent change from NCsoft, weird. Mojo/Renanse??

looks like a bad merge somewhere.



super.draw® isn't needed as applystates are called.



fixed in cvs.

CVS records have it going in with your batch stuff.

Nicely spotted Cosmo!