jump tree conditional body logic
This commit is contained in:
parent
3625123363
commit
6eb53acbb3
@ -85,11 +85,13 @@ public class ServerJumpTree implements BehaviorTree {
|
||||
this.setCurrentJumpForce(currentJumpForce * jumpFalloff);
|
||||
//stop body falling if it is
|
||||
DBody body = PhysicsEntityUtils.getDBody(parent);
|
||||
if(body != null){
|
||||
DVector3C linearVelocity = body.getLinearVel();
|
||||
body.setLinearVel(linearVelocity.get0(), 0, linearVelocity.get2());
|
||||
//push parent up
|
||||
body.addForce(0, currentJumpForce, 0);
|
||||
body.enable();
|
||||
}
|
||||
//potentially disable
|
||||
if(currentFrame >= jumpFrames){
|
||||
this.setState(JumpState.AWAITING_LAND);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user