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);
|
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);
|
||||||
DVector3C linearVelocity = body.getLinearVel();
|
if(body != null){
|
||||||
body.setLinearVel(linearVelocity.get0(), 0, linearVelocity.get2());
|
DVector3C linearVelocity = body.getLinearVel();
|
||||||
//push parent up
|
body.setLinearVel(linearVelocity.get0(), 0, linearVelocity.get2());
|
||||||
body.addForce(0, currentJumpForce, 0);
|
//push parent up
|
||||||
body.enable();
|
body.addForce(0, currentJumpForce, 0);
|
||||||
|
body.enable();
|
||||||
|
}
|
||||||
//potentially disable
|
//potentially disable
|
||||||
if(currentFrame >= jumpFrames){
|
if(currentFrame >= jumpFrames){
|
||||||
this.setState(JumpState.AWAITING_LAND);
|
this.setState(JumpState.AWAITING_LAND);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user