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

Respect Entity#setGravity(false). Closes GH-454 #469

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@satoshinm
Contributor

satoshinm commented May 2, 2017

Adds support for calling setGravity(false) to disable gravity physics on an entity. This is useful for plugins to make their own entities which don't respect gravity:

screen shot 2017-05-01 at 9 59 22 pm

Implemented by adding a getGravityAccel() accessor to complement setGravityAccel() (and getVelocity()), which returns a zero vector if !this.gravity.

@Ultros-Bot Ultros-Bot requested a review from momothereal May 2, 2017

@@ -716,6 +724,7 @@ public boolean intersects(BoundingBox box) {
* Gravity acceleration applied each tick.
*/
protected Vector gravityAccel = new Vector(0, -0.04, 0);
private static final Vector zeroG = new Vector(0, 0, 0);

This comment has been minimized.

@mastercoms

mastercoms May 2, 2017

Member

This can be new Vector(), FYI.

@momothereal momothereal removed their request for review May 2, 2017

@mastercoms

This comment has been minimized.

Member

mastercoms commented May 2, 2017

Merged in 447c945.

@mastercoms mastercoms closed this May 2, 2017

@mastercoms mastercoms self-assigned this May 2, 2017

@satoshinm satoshinm deleted the satoshinm:setgravity branch May 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment