java.lang.IndexOutOfBoundsException merging geometries

Hi to everyone,

I don’t know if I’m doing something wrong, btw if I try to merge tre lines into a single geometries I get the following:

0: java.nio.Buffer.checkIndex(Buffer.java:514)

1: java.nio.DirectFloatBufferU.put(DirectFloatBufferU.java:283)

2: jme3tools.optimize.GeometryBatchFactory.doTransformVerts(GeometryBatchFactory.java:46)

3: jme3tools.optimize.GeometryBatchFactory.mergeGeometries(GeometryBatchFactory.java:191)

I was trying to merge this lines:

a) Line1 goes from [0 0 0] to [1 0 0]

b) Line2 goes from [1 0 0] to [1 1 0]

c) Line3 goes from [1 1 0] to [0 1 0]

Just to be more explicit this is the resulting shape:


(1,0) (1,1)
_________
| |
| |
| |
(0,0) (0,1)

I know that I can put everything into a Node, but I’m trying to obtain a single geometry Object.

How can I do? I’m not limited using only GeometryBatchFactory, the only constrain is that I must obtain a single Geometry object.

I’m using jmonkey-3-alpha3

Bye and thanks in advance

Alfredo

Update: merging all the geometries at once works like a charm, but I got the exception merging first line1 and line2 and then merging the result with line3. Why?

Bye

Alfredo

Nobody have an idea about this strange behaviour and how to fix it?

Could you provide a test case showing the issue? This should be really easy to fix.

Hi :slight_smile:

It seems to be a bug related to alpha3. I’ve switched to alpha4 and the problem was gone.

Thanks anyway, specially for the fantastic job you are doing with JMonkey :slight_smile:



Alfredo