Migration guide for jME 1.0 to 2.0 - GeomBatch

Hi all,

I'm a newbie to jME that touched 1.0 briefly, but then decided to jump in feet-first to 2.0.  I've worked my way through most of the tutorials without too much trouble, but now I'm trying to look at StrategicHandler and the Mahjongg project.  I've been able to work through most of the compiler errors (the move to enums is the source of most of them, but it lets me appreciate the improvements being done to the engine), but the GeomBatch ones have me a bit worried.  I've got 2.0 in Eclipse, but I'm looking at 1.0 through the CVS web browser, so it's hard to get the big picture.  As far as I can tell, Geometry used to have multiple batches of triangles, but now has only one, so code that used to iterate through each batch and do something to it, should just do that something to the Geometry itself?  For instance:


    public void updateData( TriMesh mesh ) {
        int totalVerticesLength = 0;
        int totalIndicesLength = 0;

        // Walk batches and count indices and vertices
        for ( int batchIndex = 0; batchIndex < mesh.getBatchCount(); batchIndex++ ) {
            TriangleBatch batch = mesh.getBatch( batchIndex );
            totalVerticesLength += ( batch.getVertexCount() * 3 );
            totalIndicesLength += ( batch.getTriangleCount() * 3 );
        }



should now be:

    public void updateData( TriMesh mesh ) {
        int totalVerticesLength = 0;
        int totalIndicesLength = 0;

            totalVerticesLength = mesh.getVertexCount() * 3;
            totalIndicesLength = mesh.getTriangleCount() * 3;



Am I close or am I way out in left field?

Thanks,
  Mike

exactly like that. Multiple batches were removed in 2.0. now theres only one and you got it right in your code as far as i can tell.  :wink:

I have posted a jME 2.0 version jar and src for the strategic handler in the relevant thread in the user code forum.

I plan to write a JME 2.0 port of MonkeyMahjonng soon()  :mrgreen:



(
) soon: When used by Landei in respect to himself, this word refers to the distant future close to retirement. When used by Landei requesting something from third parties, it refers to yesterday.

Cool, Landei. Planning any further changes / enhancements to it?

Mindgamer - thanks for the link.  I completely missed that part of the thread about a 2.0 version already existing!

@Mindgamer: I haven't done anything with jME for some months, so I'll need some time to catch up first.

OK, MonkeyMahjongg is now on jME2.



But no further improvements so far…