ArrayIndexOutOfBoundsException at GenericVertexController.updateMesh

Started by raft, January 31, 2010, 04:47:48 AM

Previous topic - Next topic

raft

any idea why this happens ?

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8
at com.threed.jpct.GenericVertexController.updateMesh(Unknown Source)
at com.threed.jpct.Mesh.applyVertexController(Unknown Source)
..

EgonOlsen


raft

found it i guess. it happens when an empty Object3D is created with new constructor:

Object3D object = new Object3D(new float[0], new float[0], new int[0], TextureManager.TEXTURE_NOTFOUND);
object.build();

object.getMesh().setVertexController(..);
object.getMesh().applyVertexController();


an empty object created with old constructor throws same exception with different index (1)

Object3D object = new Object3D(0);


hope this helps,
r a f t

EgonOlsen

I'll look into it. But what's the point of using an IVertexController on an empty object anyway?

raft

Quote from: EgonOlsen on February 01, 2010, 07:56:36 AM
But what's the point of using an IVertexController on an empty object anyway?
no point, the collada exporter just exported so..

EgonOlsen

Try this jar: http://www.jpct.net/download/beta/jpct.jar. The problem was, that the controller implementation didn't require that there is a bounding box but it assumed that at least the space for it is reserved, which isn't true to "empty" objects like these. I hope this is fixed now. This release also fixes the rotate?()-methods.

raft

empty objects created with new constructor still throws same exception ;)
new Object3D(new float[0], new float[0], new int[0], TextureManager.TEXTURE_NOTFOUND);

EgonOlsen

Argh...my test case didn't call build(), which obviously makes a difference. I'll fix this tomorrow.

EgonOlsen


raft