Skip to content

Commit

Permalink
fix counter force
Browse files Browse the repository at this point in the history
  • Loading branch information
svencc committed Jan 30, 2024
1 parent 2bc0e7d commit 56494e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.recom.tacview.engine.entitycomponentsystem.component;

public class PhysicComponent extends ComponentTemplate {
private static float COUNTER_FORCE = 40f;
private static float COUNTER_FORCE = 100f;
private static float DAMPING_COEFFICIENT = 10f;

public PhysicComponent() {
Expand All @@ -22,10 +22,10 @@ public void update(final long elapsedNanoTime) {
physicsCoreComponent.setPositionY(newPositionY);


// double newVelocityX = applyLinearCounterForce(physicsCoreComponent.getVelocityXComponent(), COUNTER_FORCE * elapsedSeconds);
// double newVelocityY = applyLinearCounterForce(physicsCoreComponent.getVelocityYComponent(), COUNTER_FORCE * elapsedSeconds);
// physicsCoreComponent.setVelocityXComponent(newVelocityX);
// physicsCoreComponent.setVelocityYComponent(newVelocityY);
double newVelocityX = applyLinearCounterForce(physicsCoreComponent.getVelocityXComponent(), COUNTER_FORCE);
double newVelocityY = applyLinearCounterForce(physicsCoreComponent.getVelocityYComponent(), COUNTER_FORCE );
physicsCoreComponent.setVelocityXComponent(newVelocityX);
physicsCoreComponent.setVelocityYComponent(newVelocityY);

// double newVelocityX = applyQuadraticDamping(physicsCoreComponent.getVelocityXComponent(), elapsedSeconds);
// double newVelocityY = applyQuadraticDamping(physicsCoreComponent.getVelocityYComponent(), elapsedSeconds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@Component
public class RECOMMapInputComponent extends InputComponent {

private static final float velocityX = 50f;
private static final float velocityX = 140f;


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ spring.threads.virtual.enabled=true


# ENGINE
engine.renderer.width=2000
engine.renderer.height=1300
engine.renderer.width=1000
engine.renderer.height=400
engine.renderer.scale=1
engine.renderer.parallelizedRendering=true
engine.renderer.renderFragments=8
Expand Down

0 comments on commit 56494e9

Please sign in to comment.