Exception at Curve since rev. 7089

Hey guys,



since the revision above i get the following exception in the curve class while settings up the index buffer:



[java]SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,6,main]

java.lang.IllegalArgumentException: components must be between 1 and 4

at com.jme3.scene.VertexBuffer.setupData(VertexBuffer.java:397)

at com.jme3.scene.Mesh.setBuffer(Mesh.java:571)

at com.jme3.scene.Mesh.setBuffer(Mesh.java:605)

at com.jme3.scene.shape.Curve.createLinearMesh(Curve.java:247)

at com.jme3.scene.shape.Curve.<init>(Curve.java:80)

at crococosmo.view.evoviewer.layout.edges.EvolutionEdge.updateCurve(EvolutionEdge.java:136)

at crococosmo.view.evoviewer.layout.edges.FDirectedEdgeLayout.showEdges(FDirectedEdgeLayout.java:230)

at crococosmo.view.evoviewer.layout.edges.EvoEdgeProcessor.process(EvoEdgeProcessor.java:175)

at crococosmo.view.evoviewer.layout.edges.EvoEdgeProcessor$SelfHierAttrGraphObserver.flush(EvoEdgeProcessor.java:538)

at crococosmo.graph.AttrGraphObserverList.flush(AttrGraphObserverList.java:110)

at crococosmo.graph.DefaultHierAttrGraphDecorator.flushObservers(DefaultHierAttrGraphDecorator.java:67)

at crococosmo.view.evoviewer.layout.edges.EvoEdgeProcessor.selectEdges(EvoEdgeProcessor.java:381)

at crococosmo.view.evoviewer.layout.edges.EvoEdgeProcessor.nodeClicked(EvoEdgeProcessor.java:469)

at crococosmo.view.evoviewer.jme.pick.PickableObjectManager.fireOnClickEvent(PickableObjectManager.java:199)

at crococosmo.view.evoviewer.jme.pick.PickableObjectManager.onMouseButtonEvent(PickableObjectManager.java:143)

at com.jme3.input.InputManager.processQueue(InputManager.java:573)

at com.jme3.input.InputManager.update(InputManager.java:639)

at com.jme3.app.Application.update(Application.java:469)

at framework.jme3.CityApplication.update(CityApplication.java:443)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:144)

at com.jme3.system.lwjgl.LwjglCanvas.runLoop(LwjglCanvas.java:199)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:218)

at java.lang.Thread.run(Thread.java:662)[/java]



At line 125 in the Curve.java the following changes were made:

previous:

[java]this.setBuffer(VertexBuffer.Type.Index, 3, indices);[/java]

current:

[java]this.setBuffer(VertexBuffer.Type.Index, (spline.getControlPoints().size() - 1) * nbSubSegments * 2, indices);[/java]



Now i always get the “not between 1 and 4”-Exception. My splines can have any number of control points.

Any ideas what to do?



Regards

Moe

http://code.google.com/p/jmonkeyengine/source/detail?spec=svn7555&r=7462

you’re 373 revisions late, it’s been fixed :wink:

Well ok,

but if i update to rev. 7462 the line still looks like that:

[java]this.setBuffer(VertexBuffer.Type.Index, (spline.getControlPoints().size() - 1) * 2, indices);[/java]



Edit:

I just did a complete checkout but the problem still exists.

oh yeah you’re right there is still the error in createLinearMesh(), and the buffer was allocated to 3 instead of 2



Sorry about that, thanks for the report it’s fixed in last revision