Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JmeTests should specify native bullet, not jBullet #119

Closed
stephengold opened this issue Mar 16, 2017 · 18 comments
Closed

JmeTests should specify native bullet, not jBullet #119

stephengold opened this issue Mar 16, 2017 · 18 comments

Comments

@stephengold
Copy link
Member

In the 3.1.0-stable-FINAL version of the SDK, new JmeTests projects are created with the jbullet library in the library properties. However, the physics tests don't work with jbullet any more. To run physics tests, it's necessary to add the bullet and bullet-native libraries and remove the jbullet library.

In lieu of fixing jbullet, perhaps the SDK should specify native bullet for these projects.

Recent discussion at the Forum:

https://hub.jmonkeyengine.org/t/none-of-the-physics-demos-will-run/38197
https://hub.jmonkeyengine.org/t/jmonkeyengine-3-1-0-how-do-i-download-the-massive-sdk/38183/12

@normen
Copy link
Member

normen commented Mar 17, 2017

I don't think the issue is that they don't work with jbullet anymore, they should definitely work with it. The issue is the missing jbullet.jar which is not on maven (its our adapted version).

@stephengold
Copy link
Member Author

But the JmeTests project uses Ant, not Maven, and there's a jbullet library installed with the SDK. So I don't think that's the issue. Here's the output:

ant -f "S:\Git\jME 3.1\JmeTests" -Dnb.internal.action.name=run run
init:
deps-jar:
Created dir: S:\Git\jME 3.1\JmeTests\build
Updating property file: S:\Git\jME 3.1\JmeTests\build\built-jar.properties
Created dir: S:\Git\jME 3.1\JmeTests\build\classes
Created dir: S:\Git\jME 3.1\JmeTests\build\empty
Created dir: S:\Git\jME 3.1\JmeTests\build\generated-sources\ap-source-output
Compiling 258 source files to S:\Git\jME 3.1\JmeTests\build\classes
warning: [options] bootstrap class path not set in conjunction with -source 1.7
S:\Git\jME 3.1\JmeTests\src\jme3test\bullet\PhysicsHoverControl.java:187: error: cannot access MotionState
getMotionState().applyTransform(spatial);
class file for com.bulletphysics.linearmath.MotionState not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
1 warning
S:\Git\jME 3.1\JmeTests\nbproject\build-impl.xml:521: The following error occurred while executing this line:
S:\Git\jME 3.1\JmeTests\nbproject\build-impl.xml:219: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 5 seconds)

@normen
Copy link
Member

normen commented Mar 18, 2017

Yes it is the issue. It cannot find a class from com.bulletphysics, which is in jbullet.jar. Try adding the jars from here: https://github.com/jMonkeyEngine/jmonkeyengine/tree/3.0/engine/lib/jbullet

It doesn't matter if the project uses ANT, maven or gradle, if the jar isn't there it doesn't work. Maven in this context doesn't mean "maven the build system", it means "maven the centralized java library repository", which is where the SDK build pulls its engine jar files from afaik.

@stephengold
Copy link
Member Author

Compiling 258 source files to S:\Git\jME 3.1\JmeTests\build\classes
error: error reading C:\Users\Stephen\Downloads\asm-all-3.1.jar; error in opening zip file
error: error reading C:\Users\Stephen\Downloads\jbullet.jar; error in opening zip file
error: error reading C:\Users\Stephen\Downloads\stack-alloc.jar; error in opening zip file
error: error reading C:\Users\Stephen\Downloads\vecmath.jar; error in opening zip file
warning: [options] bootstrap class path not set in conjunction with -source 1.7
4 errors
1 warning
S:\Git\jME 3.1\JmeTests\nbproject\build-impl.xml:521: The following error occurred while executing this line:
S:\Git\jME 3.1\JmeTests\nbproject\build-impl.xml:219: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)

@stephengold
Copy link
Member Author

When I downloaded the four JARs using the "download" button for each one (instead of "Save link as..." in my browser) I got valid JARs of the correct size, but the build still failed, this time not finding package com.jme3.bullet. Adding the "jme3-bullet" library cleared that up. In fact, with "jme3-bullet" library included, JmeTests seems to build and run just fine, even without the downloaded JARs. So I think the problem is that JmeTests project is missing the "jme3-bullet" library.

@stephengold
Copy link
Member Author

Correction: it builds fine, and the test chooser comes up, but when I try to run a test from the chooser I get:

Mar 18, 2017 11:08:08 AM jme3test.TestChooser$2 run
SEVERE: main() method had exception: jme3test.animation.TestMotionPath
java.lang.reflect.InvocationTargetException
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:498)
at jme3test.TestChooser$2.run(TestChooser.java:270)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.UnsatisfiedLinkError: The required native library 'bulletjme' was not found in the classpath via 'native/windows/x86_64/bulletjme.dll'. Error message: no bulletjme in java.library.path
at com.jme3.system.NativeLibraryLoader.loadNativeLibrary(NativeLibraryLoader.java:596)
at com.jme3.system.JmeDesktopSystem.initialize(JmeDesktopSystem.java:348)
at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:271)
at com.jme3.system.JmeSystem.newContext(JmeSystem.java:162)
at com.jme3.app.LegacyApplication.start(LegacyApplication.java:461)
at com.jme3.app.LegacyApplication.start(LegacyApplication.java:424)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java:125)
... 6 more

@stephengold
Copy link
Member Author

I took jme3-bullet out. With the 4 JARs + jme3-jbullet, I'm able to run tests.

@stephengold
Copy link
Member Author

In fact, I don't need all 4 JARs. Just adding jbullet.jar seems to be sufficient.

@stephengold
Copy link
Member Author

Creating a JmeTests project is, I imagine, one of the first things a new user is likely to do after installing the SDK. Having it fail out of the box (for two unrelated reasons!) gives a bad impression.

I believe the removal of jbullet.jar from the jme3-jbullet library was intentional and is unlikely to be reversed anytime soon. So, given that this breaks JmeTests, is it unreasonable to expect the SDK to either (a) use native bullet for JmeTests or (b) supply a jbullet.jar for building JmeTests?

@normen
Copy link
Member

normen commented Mar 19, 2017

The jbullet.jar is probably missing because of what I said, so its not really intentional. I don't know why you question the reasonability of your issue though. Nobody closed it, nobody spoke against it. Do you personally have any problems with it?

@stephengold
Copy link
Member Author

According to jayfella, jbullet.jar does not belong to jmonkey, so we aren't allowed to re-distribute it. pspeed said that isn't 100% correct, but that it would be "bad form" to re-distribute it. I assume one of these is the reason it's omitted from the 3.1 jme-jbullet library.

I don't question the reasonableness of my own expectations. I'm trying to motivate a fix, for the sake of new users and the success of the project. So far, I haven't get the sense that anyone on the team cares much about this issue.

@normen
Copy link
Member

normen commented Mar 20, 2017

Well since I left the SDK is basically maintained by one contributor and kind of officially separated from the engine so having an issue not worked on for 3 days or some weeks should be met with understanding.

@MeFisto94
Copy link
Member

Exactly, I was busy this weekend thus I did not reply.
We already have jbullet.jar in libs/ folder on this repo.

The issue is: jbullet is our fork of the original jbullet but without a published source. Paul's opinion is that you may not distribute jar's without source code. If jbullet is released under any GPL variant it's definitely required actually. Nevertheless since the engine already has that jbullet.jar in the repository, I added it to the sdk. It is only not available as a proper dependency (but I think jme3-jbullet isn't at all?)

Yes we encourage to move to native bullet and wonder if it hasn't been done yet. if it isn't done, it certainly is for new projects (BasicGameTemplate) however jbullet.jar should be added to jme3-jbullet until we phase it out. The thing is I don't know how those libraries are built, it's some gradle magic, might take some time to understand^^

@normen
Copy link
Member

normen commented Mar 20, 2017

I published "our" version here: https://github.com/normen/jbullet
Its got a ZLIB license btw, shouldn't be an issue.

As for native bullet - I never really finished it completely. Some contributors added almost all missing stuff I guess but I never had the chance to look over those. Some of the contributed stuff is implemented a bit... creatively :) It seems to work fine mostly afaics though.

@stephengold
Copy link
Member Author

Sorry to hear the project is so shorthanded. If I got a false impression of the "team," it was probably from normen's comments, not mefisto94's silence.

@pspeed42
Copy link
Contributor

pspeed42 commented Mar 20, 2017 via email

@MeFisto94
Copy link
Member

Well the regular tests now have a working native bullet and for android I think it used to be native bullet way before due to performance.

That is no excuse to have a broken jBullet setup though.
Technically we could now even release jme3-jbullet, given normens upload, however that is up to you engine guys.

@stephengold No problem. I think jme as a whole suffers a bit from the members being busy and the team being rather small. On the other hand better late then never^^

@normen
Copy link
Member

normen commented Mar 21, 2017

@stephengold Sorry if my comments gave any kind of "impression". I was solely trying to convey facts that might help you understand the issue.

MeFisto94 added a commit that referenced this issue Mar 21, 2017
* master: (49 commits)
  Added stubs for the new Profiler. Possibly the SDK won't be profileable ever.
  Initial step towards Engine Version 3.2
  Small Documentation Addition: Corelibs vs Optlibs
  Revert "Move XBuf to optional libs"
  Fixes #81 - Manual Workaround for XBuf Dependencies, so that the xbuf_loader and others get properly added to the jme3_xbuf library.
  Fixes #119 - The Library jme3-jbullet now has all the proper dependencies, so that jbullet should work again. Keep in mind though that jBullet is deprecated and will be removed in the future
  Add proper `assets` folder for the tests because the build fails otherwise. Used `.keep` files, so git tracks the empty folders.
  Move XBuf to optional libs
  Update Android Test Template: Use 3.1 Libraries instead of 3.0
  jbullet lib lacks jbullet.jar: use native bullet in JmeTests template
  Improves #75 - Set darker default diff colors for DarkMonkey Font & Color Profile
  Readme: Clarification about `stable` tag
  Android: Update NBAndroid Plugin Repo (Note: It says 8.1 but according to their wiki, it should be compatible anyway, there is no 8.2 Repo). Actually we previously used the NB 7.3 Plugin Repo...
  Android fix
  Fix #114
  Readme: Some more fixes
  Readme: fix small formatting issue
  Fixes #113 - Add a proper ReadMe with a good documentation about how to build the engine
  Blender: Update sub folder to adopt to blender foundation's packaging changes for Mac OS X
  Travis: Fix Errors due to wrong quoting.
  ...

Conflicts:
	build.gradle
	build_engine.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants