New and Working with JME3

Hello,



I'm new to using jME.  I'd been looking at playing with jME for awhile, as I'm a wanna-be indie game developer, and happened to decide to sit down and use it just as jME3 came out with the alpha.  Go timing!



So to start learning the engine I'm making a "SimpleBulletApplication" that involves kicking a ball around.  I was having trouble getting the "PhysicsCharacterNode" to push objects around so I started using "PhysicsNode" and just applying force with lots of friction/damping.  Dunno if this is the best way to do it, but it's sort of working.  To get the gravity to work better on my player I was going to do something along the lines of:

player.setGravity(player.getGravity().mult(10f);





I received an error message and went to look at the getGravity() method in PhysicsNode.  I found what looks like it's setting the gravity. (?)



    public void getGravity(Vector3f gravity){
        //TODO: gravity
        rBody.setGravity(Converter.convert(gravity));
    }



I saw that and thought "Awesome! I might be able to help contribute! :D".

By the way, nice to meet all of you.  I've been reading around the forums to try to get caught up on who everyone is and what they're doing.

~GBreadMan    <- Momoko_Fan Fan

Yes, that would be getGravity there, thanks. Still, you should change the gravity of the whole PhysicsSpace and not just of the player I suggest. Too many objects with differing gravity will make the physics look strange.

Cheers,

Normen

normen said:
Too many objects with differing gravity will make the physics look strange.


But it surely would be cool, to be able to disable the gravity on certain objects.
I've also saw that the getGravity()/setGravity() method pair is buggy, e.g. getGravity() should return a Vector3f etc..
but the "TODO: gravity" make me feel, that somebody is already working on this^^

So I've been helping me out, with applyContinuosForce()... :(
tim8dev said:

But it surely would be cool, to be able to disable the gravity on certain objects.
I've also saw that the getGravity()/setGravity() method pair is buggy, e.g. getGravity() should return a Vector3f etc..
but the "TODO: gravity" make me feel, that somebody is already working on this^^

So I've been helping me out, with applyContinuosForce()... :(

It is working, you just have to know what you want from it and what it will produce.
The supply vector instead of a return vector is intended to avoid creating a new Vector3f in memory. The fix is simply adding


Converter.convert(rBody.getGravity(),gravity);


as the body of the method.

But that value is not very interesting, it should be the same as the world gravity, never needed a getter for it ;)..