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

Update sample code - Terrain Collision #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update sample code - Terrain Collision #144

wants to merge 1 commit into from

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