Skip to content

Conversation

nelson-mig-l
Copy link
Contributor

method setGravity takes float as parameter instead of Vector3f

method `setGravity` takes `float` as parameter instead of `Vector3f`
@@ -156,7 +156,7 @@ public class HelloTerrainCollision extends SimpleApplication

// You can change the gravity of individual physics objects after they are
// added to the PhysicsSpace.
player.setGravity(new Vector3f(0,-30f,0));
player.setGravity(-30f);
Copy link
Member

@Ali-RS Ali-RS Jan 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@stephengold stephengold Jan 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, @Ali-RS. The PhysicsCharacter.setGravity(float) argument represents acceleration in the character's "down" direction, so it's usually non-negative. That's true in both Minie and jme3-jbullet.

It would be great to get all the sample code in the Wiki synched with the "jme3test.helloworld" package in jme3-examples.

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

Successfully merging this pull request may close these issues.

3 participants