Skip to content

Commit

Permalink
nearly
Browse files Browse the repository at this point in the history
  • Loading branch information
wefcdse committed Feb 3, 2024
1 parent 3786404 commit 0190bac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/client/java/com/iung/fpv20/flying/GlobalFlying.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public GlobalFlying(int camRoll, float angular_speed) {
this.drone = new DefaultDrone();
this.droneRotation = new Quaternionf();
this.lastDroneRotation = new Quaternionf();
this.cam_angel_deg = 40;
this.cam_angel_deg = 30;
this.last_pos = new Vec3d(0, 0, 0);
}

Expand Down
13 changes: 10 additions & 3 deletions src/client/java/com/iung/fpv20/physics/DefaultDrone.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public DefaultDrone() {
this.v = new Vector3f();

this.mass = 0.5f;
this.area = (float) (FastMath.PI * 0.4 * 0.4);
this.max_force = 5;
this.area = (float) (FastMath.PI * 0.2 * 0.2);
this.max_force = 3f;
}

@Override
Expand Down Expand Up @@ -72,7 +72,14 @@ public void update_physics(float throttle, float dt) {
Vector3f total_force = new Vector3f().add(ambientDragForce).add(thrust);

// i don't know what's wrong, but it just falls too fast and i don't like it
this.a = total_force.div(mass).add(new Vector3f(G).mul(0.2f));
float gf = 0.2f;
if (Math.abs(this.v.y) > 2){
gf = 0;
}
Fpv20.LOGGER.info("####vy {}", this.v.y);

this.a = total_force.div(mass).add(new Vector3f(G).mul(gf));

Fpv20.LOGGER.info("#a {}", this.a);

Fpv20.LOGGER.info("#f {}", dt);
Expand Down

0 comments on commit 0190bac

Please sign in to comment.