jump tree conditional body logic

This commit is contained in:
austin 2025-05-24 22:57:37 -04:00
parent 3625123363
commit 6eb53acbb3

View File

@ -85,11 +85,13 @@ public class ServerJumpTree implements BehaviorTree {
this.setCurrentJumpForce(currentJumpForce * jumpFalloff); this.setCurrentJumpForce(currentJumpForce * jumpFalloff);
//stop body falling if it is //stop body falling if it is
DBody body = PhysicsEntityUtils.getDBody(parent); DBody body = PhysicsEntityUtils.getDBody(parent);
if(body != null){
DVector3C linearVelocity = body.getLinearVel(); DVector3C linearVelocity = body.getLinearVel();
body.setLinearVel(linearVelocity.get0(), 0, linearVelocity.get2()); body.setLinearVel(linearVelocity.get0(), 0, linearVelocity.get2());
//push parent up //push parent up
body.addForce(0, currentJumpForce, 0); body.addForce(0, currentJumpForce, 0);
body.enable(); body.enable();
}
//potentially disable //potentially disable
if(currentFrame >= jumpFrames){ if(currentFrame >= jumpFrames){
this.setState(JumpState.AWAITING_LAND); this.setState(JumpState.AWAITING_LAND);