Quad resize (no biggie)

Hi.

Creating new Quad without dimensions and resizing immediately afterwards produces exception.


Quad q = new Quad("cone-quad");
q.resize(10, 10);



Stacktrace:


java.lang.NullPointerException
   at com.jme.scene.shape.Quad.resize(Unknown Source)
   at com.funcom.tcg.client.render.PlayerCreatureNode.attachConeQuad(PlayerCreatureNode.java:29)
   at com.funcom.tcg.client.render.PlayerCreatureNode.<init>(PlayerCreatureNode.java:24)
   at com.funcom.tcg.client.TcgGame.initGame(TcgGame.java:443)
   at com.jme.app.FixedLogicrateGame.start(Unknown Source)
   at com.funcom.tcg.client.TcgJme.start(TcgJme.java:60)
   at com.funcom.tcg.client.TcgJme.main(TcgJme.java:74)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Apr 23, 2008 9:15:25 AM com.funcom.tcg.client.TcgGame cleanup
INFO: Cleaning up resources.
Exception in thread "main" java.lang.NullPointerException
   at com.jme.renderer.lwjgl.LWJGLRenderer.cleanup(Unknown Source)
   at com.funcom.tcg.client.TcgGame.cleanup(TcgGame.java:611)
   at com.jme.app.FixedLogicrateGame.start(Unknown Source)
   at com.funcom.tcg.client.TcgJme.start(TcgJme.java:60)
   at com.funcom.tcg.client.TcgJme.main(TcgJme.java:74)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)



No biggie because setting any size at construction helps.
Not sure if this is bug so I don't want to post anything into tracker, if devs decide it is, feel free to do it.

I think all these SaveAble objects only have an empty constructor for saving loading as XML and for Java Reflections, to initialize an Object, without knowing its Class type.



PS.: if the original quad would have a size of Zero, it would be still Zero by multipliing it with 10 :smiley:

.:emp...hellg:. said:

I think all these SaveAble objects only have an empty constructor for saving loading as XML and for Java Reflections, to initialize an Object, without knowing its Class type.

PS.: if the original quad would have a size of Zero, it would be still Zero by multipliing it with 10 :D

:? new Quad("cone-quad") does not look like an empty constructor to me.
Also a NullPointerException as in the stacktrace deus_ex_machina posted has nothing to do with multiplication by zero.
I don't get your point.
The constructor in question should just be changed to read

this(name, 1, 1);


instead of the probably auto-generated

super(name);


it is now.

fixed, thanks

hmm, I take it back an argue the converse  8)