[SOLVED] HelloCollision gravity inverted


#1

I ran the exact example code for HelloCollision.java and while the gravity works, it is inverted and causes the player to fall upward into the sky. Does anyone else have this issue when they run this code?


#2

I typed HelloCollision into the search box and found:


…that might be related.


#3

The second thread you mentioned states a similar issue to mine and they also state that they are using the Linux version. I’m running the code on Linux. I’m going to try running it on a Mac and see what happens.


#4

You should try with a snapshot from the master branch, you can use jitpack for that, since there is a patch for what i believe may be your issue


#5

I will try downloading the snapshot. I just tested on OS X v3.2.2-stable-sdk1 and I can confirm that I get the same issue.


#6

Another workaround: if you use the jme3-jbullet library for your physics (instead of jme3-bullet), the issue should go away.


#7

Apologies if this is a dumb question. How exactly do I swap out the jme3-bullet library with the jme3-jbullet library?


#8

If you’re using the SDK and building your project with ANT:

  1. right-click on your project in the “Projects” window
  2. from the popup menu select “Properties…”
  3. in the dialog box under “Categories” select “Libraries”
  4. select the “Compile” tab (if it isn’t already selected)
  5. under “Compile-time Libraries” select jme3-bullet
  6. left-click on the “Remove” button
  7. left-click on the “Add Library…” button
  8. select the jme3-jbullet library
  9. left-click on the “Add Library” button
  10. left-click on the “OK” button

For completeness, you should also remove the jme3-bullet-native library, but it’s not necessary.


#9

Thank you, this resolved my issue.


#10

i had the same issue, it had different gravity direction for linux and windows computers.

what is did is here:

not sure if in your case you can do exactly same, but hope it can help too.