HelloCollision will need update for 3.2

The Hello Collision tutorial in the beginner tutorials will soon need updating for JME 3.2 because it uses 2 deprecated methods (jump() and setGravity(float) in PhysicsCharacter).

I saw those but what about setUp(Vecotr3f) which was setUpAxis(int) ?

It works like so now, player.setUp(Vector3f.UNIT_Y) correct?

Why no getUp() when there is getUpAxis() ?

It looks like, player.setGravity(30.0f) is now player.setGravity(new Vector3f(0.0f, 30.0f, 0.0f)) correct?

Jump works like this now, player.jump(Vector3f.UNIT_Y), correct?

Also, tutorials update on stable releases, so this is an Alpha release, when is stable to be expected?

Is anyone going through tests to update?

I updated most of mine to java 1.8 ver 3.1 stable but the engine is stuck at 1.7.

Edit: The wiki relies on Test projects.

The original physics character isn’t really “deprecated” in the actual sense of the word. Its part of bullet and we can’t really deprecate or remove it ourselves. It was marked ad deprecated to point people at the better and more flexible option of the BCC.

Erm. I’m being a bit cheeky and pre-emptive here, but is it possible we could put these hello examples in the jmonkey official gists? It would allow edits to be tracked and all that, but also downloading them and integrating them will be just a get request away…

The tutorial HelloCollision has some weird effects now.
https://jmonkeyengine.github.io/wiki/jme3/beginner/hello_collision.html

Setting player.setGravity(new Vector3f(0.0f, 30.0f, 0.0f)) results in the camera slowly floating up into infinity.

Setting player.jump(Vector3f.UNIT_Y); results in nothing happening.

So many jars scattered all over the place I must be using the wrong ones.

There is a jme3-examples subproject in the Engine repository on GitHub. The jme3test.helloworld package in that project contains example apps similar to those in the Wiki (including HelloCollision.java). However the wiki and jme3-examples are a bit out of synch.

They are identicle files. The wiki uses the jme3-example files for tutorials.

I ran it both ways with 3.2-6418 and setGravity(30) and setGravity(new Vector3f(0.0f, 30.0f, 0.0f)).
Both do the same thing, character floats away.

If I set it to -30, it stays on ground. player.setGravity(new Vector3f(0,-30,0));

But then jump doesn’t work unless I do something like this player.jump(new Vector3f(0,10,0));.

Is the intended use?

Heh, can still spam the jump trigger and continually go higher but a side effect is now gravity doesn’t drag you down hillside.

Edit: I know you have to check onGround

While similar and doubtless based on the same source, the files have diverged and are not identical. For instance, in HelloCollision’s onAction() the Wiki has:

public void onAction(String binding, boolean isPressed, float tpf) {
    if (binding.equals("Left")) {
      left = isPressed;
    } else if (binding.equals("Right")) {
      right= isPressed;

whereas the v3.1 branch of the Engine has:

  public void onAction(String binding, boolean value, float tpf) {
    if (binding.equals("Left")) {
      if (value) { left = true; } else { left = false; }
    } else if (binding.equals("Right")) {
      if (value) { right = true; } else { right = false; }

It looks like someone has been improving the code in the WIki without updating the Engine repo.

I have tested both versions in my test folder without realizing they were slightly different.

They both require the exact same use of the new methods where you set gravity as a negative Vector3f and now set jump as a positive Vector3f.

I can only conclude that is the intended use since no one has said different.

Edit: As mentioned also, gravity no longer pulls a character down a slope in town.zip as before so some other things must need tweaking or I am using this all wrong now.

Maybe I am using the wrong jars?

jme3-core-3.2.0-SNAPSHOT.jar
jme3desktop-3.2.0-SNAPSHOT.jar
jme3-lwjgl-3.2.0-SNAPSHOT.jar
jme3-jogg-3.2.0-SNAPSHOT.jar}
jme3-plugins-3.2.0-SNAPSHOT.jar
jme3-blender-3.2.0-SNAPSHOT.jar
jme3-terrain-3.2.0-SNAPSHOT.jar
jme3-effects-3.2.0-SNAPSHOT.jar
jme3-bullet-3.2.0-SNAPSHOT.jar
jme3-bullet-native-3.2.0-SNAPSHOT.jar
lwjgl-platform-2.9.3-natives-windows.jar
jutils-1.0.0.jar
jinput-2.0.5.jar
jinput-platform-2.0.5-natives-windows.jar
lwjgl-2.9.3.jar
gson-2.8.1.jar
j-ogg-all-1.0.0.jar

Hah. Yeah. I filtered everything out with the word test in it. I can see them now :stuck_out_tongue:

The gravity issue in HelloCollision was issue 910 at GitHub, which is fixed in master but not v3.2.3:
PhysicsCharacter incompatible between jme3-bullet and jme3-jbullet · Issue #910 · jMonkeyEngine/jmonkeyengine · GitHub

A new issue has been filed regarding the tutorial code in the Wiki:
Tutorial code needs to be updated · Issue #1124 · jMonkeyEngine/jmonkeyengine · GitHub

If someone would investigate the new issue and propose a fix, I’d be grateful.

@Darkchaos could you please help with propose a fix.

i see this is about SDK tests project/wiki. im not sure if SDK pull tests project or its inside SDK source, same about wiki.

still. even if we fix it, it would require 3.3 sdk that require other changes(new animation system) that is problematic. (or 3.2.2-stable2?)

So what exactly is required?
The SDK should generate the TestTemplate by just using jme3’s tests (sdk/JME3TestsTemplate at master · jMonkeyEngine/sdk · GitHub), so it’s just a template for a new Project containing all the tests.
And this: sdk/build.gradle at master · jMonkeyEngine/sdk · GitHub
So essentially it should work.

Wiki is Wiki and for the SDK it’s “broken” because it relied on an xhtml export of the old wiki, so it just had plain, stripped html pages. One would need to investigate how good the current wiki works (export seemd to handle stuff like images, which all aren’t available to offline sdk users).

SDK Releases currently are on a halt due to problems with oracle not allowing us to download jdks anymore, so we need to fix this fundamentally first.

1 Like

You can download the JDKs - I have a list of urls that let you do it. Some require a cookie to be sent with it, though, depending on the version. Some don’t require one. The cookies pretty much just say you accept the terms. Some of them let you specify URL key/values instead.

I’ll post them in a few hours when I get back on my pc.

1 Like

Those? sdk/download-jdks.sh at master · jMonkeyEngine/sdk · GitHub
because Oracle changed it recently that you need an oracle.com account to download anything.
Maybe I’m just stupid and would need an oracle link to find the appropriate direct link, but I was assuming they locked it completely.

I don’t think so. This is the actual source I got it all from. Luckily I kept a remark for it. There are updated answers as you scroll down, too, if they don’t seem to work.

You can also get everything here from github via a regular download, nothing special needed, just grab it via a link.

They say they are going to keep putting out the jre also.

1 Like