B4J Physic Challenge

Frederic, I see that your JBOX2D examples utilize your Accelerated Surface lib for the drawing method.
It is Android exclusive?
 
that screenshot in Ilan's link looked familiar... it's a port of APE/JPE.

not that it is bad or anything :)
 
I've tried on B4J (with Canvas obviously) and a timer, and the first time World.drawDebugData is called, program crash (tried to delete
Code: Copy
Color as Int
parameter on DD_DrawSegment and DD_DrawSegment but no luck)

Code: Copy
Program started.
java.lang.RuntimeException: java.lang.NoClassDefFoundError: anywheresoftware/b4a/keywords/constants/Colors
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)
    at anywheresoftware.b4a.BA$3.run(BA.java:178)
    at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
    at com.sun.javafx.application.PlatformImpl$$Lambda$48/1413246693.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
    at com.sun.javafx.application.PlatformImpl$$Lambda$46/1030870354.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$145(WinApplication.java:101)
    at com.sun.glass.ui.win.WinApplication$$Lambda$36/1232367853.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: anywheresoftware/b4a/keywords/constants/Colors
    at org.jbox2d.callbacks.DebugDrawB4A.RGB(DebugDrawB4A.java:33)
    at org.jbox2d.callbacks.DebugDrawB4A.drawSolidPolygon(DebugDrawB4A.java:45)
    at org.jbox2d.dynamics.World.drawShape(World.java:1548)
    at org.jbox2d.dynamics.World.drawDebugData(World.java:734)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:606)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:227)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    ... 12 more
Caused by: java.lang.ClassNotFoundException: anywheresoftware.b4a.keywords.constants.Colors
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 28 more
An error occurred:
(Line: 35) World.Step(1/60, 8, 3)
java.lang.NullPointerException
 
@Informatix doesn't work with B4J, but who knows, if we ask nicely enough, he'll be able to fix it. :)
The source code is available in the first post of JBox2D so feel free to do any changes that you need. It seems that the only issue is with DrawDebug, which is used mainly for tests, not in a real app. Like the paint function in the VB code posted above, it has to be adapted; it cannot be generic.
 
post #19
you can use VB 2010 Express for it.

I've just compiled it in Visual Studio


I tried to open it with 2010, 2012, 2013 (all Express)... "APE Engine (not available)".

About VS... I had the tool to develop for Windows Mobile using Visual Studio... after I installed the VS Community 2013, this tool was automatically deleted: do you have an express version for Windows Mobile?



[P.S. I would have to publish this in "Chit chat" perhaps, but since that post is here...]

[probably I need Windows 8.1 - I have Windows 7]
 
Last edited:
Back
Top