public override Vector3 ProcessMovement(Vector3 input) { MotorHelper.KillVector(ref input, machine.WallVector); MotorHelper.ApplySpeed(ref input, machine.speed); MotorHelper.ApplyGravity(ref input, ref currentFallingSpeed, machine.Gravity, terminalVelocity); return(input); }
// Used in combat to create a target Vector from input at a given speed. private Vector3 ProcessStep(Vector3 input, float stepSpeed) { VerticalVelocity = 0; MotorHelper.KillVector(ref input, WallVector); MotorHelper.FollowVector(ref input, SlopeNormal); MotorHelper.ApplySpeed(ref input, stepSpeed); return(input); }
public Vector3 ProcessFall(Vector3 input) { MotorHelper.KillVector(ref input, WallVector); MotorHelper.ApplySpeed(ref input, Speed); MotorHelper.ApplyGravity(ref input, ref VerticalVelocity, Gravity, TerminalVelocity); // Influence Air Velocity function not written currently return(input); }
public override Vector3 ProcessMovement(Vector3 input) { MotorHelper.KillVector(ref input, machine.WallVector); MotorHelper.ApplySpeed(ref input, machine.speed); input.Set(0, currentJumpForce, input.z); currentJumpForce -= (machine.Gravity * Time.deltaTime); return(base.ProcessMovement(input)); }
public override Vector3 ProcessMovement(Vector3 input) { float speed = MainManager.Get.settings.data.playerSpeed; input.Set(0, 0, input.z); currentSpeed = Mathf.Min(currentSpeed + 1, speed); MotorHelper.FollowVector(ref input, machine.SlopeNormal); MotorHelper.KillVector(ref input, machine.WallVector); MotorHelper.ApplySpeed(ref input, currentSpeed); return(input); }
// Returns rotation facing move public static Quaternion FaceDirection(Vector3 move) { Vector3 dir = move; MotorHelper.KillVertical(ref dir); if (dir == Vector3.zero) { return(Quaternion.identity); } return(Quaternion.LookRotation(dir, Vector3.up)); }
public virtual Vector2 ProcessRotation() { return(MotorHelper.DirectionToCursor(transform.position, motor.MainCamera)); }