SOLVED: https://www.b4x.com/android/forum/threads/reflection-and-template-argument.106102/#post-664183
Hi!
This is a Reflection question, so please read-on even if you're not familiar with LibGDX.
With regards to LibGDX, I'm trying to access (with reflection) the "derivativeAt" method of the CatmullRomSpline class, but I'm unfortunately getting a NoSuchMethod exception.
https://libgdx.badlogicgames.com/ci/nightlies/docs/api/com/badlogic/gdx/math/CatmullRomSpline.html
LibGDX CatmullRomSpline Source code:
https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/math/CatmullRomSpline.java
For reference, I tried to access "valueAt", which I'm sure it works:
Can anyone please help or point me in the right direction? Many thanks in advance!
Hi!
This is a Reflection question, so please read-on even if you're not familiar with LibGDX.
With regards to LibGDX, I'm trying to access (with reflection) the "derivativeAt" method of the CatmullRomSpline class, but I'm unfortunately getting a NoSuchMethod exception.
https://libgdx.badlogicgames.com/ci/nightlies/docs/api/com/badlogic/gdx/math/CatmullRomSpline.html
LibGDX CatmullRomSpline Source code:
https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/math/CatmullRomSpline.java
For reference, I tried to access "valueAt", which I'm sure it works:
B4X:
Dim out As lgMathVector2
'This works!!
preview_spline.ValueAt(out, 0.5)
'This doesn't work!!
Dim r As Reflector
r.Target = preview_spline
r.RunMethod4("valueAt", Array(out, 0.5), Array As String("com.badlogic.gdx.math.Vector2", "java.lang.float"))
'java.lang.NoSuchMethodException: valueAt [interface com.badlogic.gdx.math.Vector, float]
' at java.lang.Class.getMethod(Class.java:1981)
' at java.lang.Class.getDeclaredMethod(Class.java:1960)
' at anywheresoftware.b4a.agraham.reflection.Reflection.runmethod(Reflection.java:214)
' at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod4(Reflection.java:857)
' at com.ninjadynamics.mangamotion.mangapage._drawpathpreview(mangapage.java:447)
' at com.ninjadynamics.mangamotion.mangapage._drawmotionpaths(mangapage.java:360)
' at com.ninjadynamics.mangamotion.main._lgs1_render(main.java:954)
' at java.lang.reflect.Method.invoke(Native Method)
' at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
' at anywheresoftware.b4a.libgdx.lgScreenManager$lgScreen.render(SourceFile:125)
' at anywheresoftware.b4a.libgdx.lgScreenManager.Render(SourceFile:75)
' at anywheresoftware.b4a.libgdx.LibGDX$b.render(SourceFile:156)
' at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(SourceFile:449)
' at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1553)
' at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1253)
'** Activity (main) Pause, UserClosed = true **
'waiting for pause synchronization took too long; assuming deadlock and killing
Can anyone please help or point me in the right direction? Many thanks in advance!
Last edited: