Browse Source

Version 04.12 "vollständiges Programm mit Fehlern"

master
David Moeckel 2 weeks ago
parent
commit
5f211026e4
4 changed files with 40 additions and 11 deletions
  1. 18
    3
      .idea/workspace.xml
  2. 11
    8
      src/main/java/GameLoop.java
  3. 3
    0
      src/main/java/Main.java
  4. 8
    0
      src/main/java/Tracker.java

+ 18
- 3
.idea/workspace.xml View File

@@ -5,7 +5,8 @@
</component>
<component name="ChangeListManager">
<list default="true" id="4d75e996-cee4-4ec6-b802-5b56d0c0eac4" name="Changes" comment="Version 27.11 (&quot;fertiger&quot; Tracker)">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/GameLoop.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/GameLoop.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Tracker.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Tracker.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@@ -36,6 +37,7 @@
"keyToString": {
"Application.GTCar.executor": "Run",
"Application.GraphicsProgram.executor": "Run",
"Application.Main.executor": "Run",
"Application.Tracker.executor": "Run",
"Downloaded.Files.Path.Enabled": "false",
"Repository.Attach.Annotations": "false",
@@ -46,7 +48,7 @@
"com.codeium.enabled": "true",
"git-widget-placeholder": "master",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "C:/Users/david/Documents/Uni/GTCar/opencv/build/java/opencv-4100.jar",
"last_opened_file_path": "C:/Users/david/Documents/Uni/GTCar/processing-4.3/core/library/core.jar",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
@@ -58,7 +60,7 @@
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="RunManager">
<component name="RunManager" selected="Application.Main">
<configuration name="GTCar" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="Tracker" />
<module name="GTCar_V2_maven" />
@@ -67,6 +69,18 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="GTCar_V2_maven" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
@@ -78,6 +92,7 @@
<updated>1732108904989</updated>
<workItem from="1732108906083" duration="758000" />
<workItem from="1732113837570" duration="20534000" />
<workItem from="1733327375447" duration="951000" />
</task>
<task id="LOCAL-00001" summary="First Commit Test">
<option name="closed" value="true" />

+ 11
- 8
src/main/java/GameLoop.java View File

@@ -17,8 +17,8 @@ public class GameLoop {
Player player2;

public GameLoop(){
player1 = new Player(0, "ip", 9000);
player2 = new Player(1, "ip", 9000);
player1 = new Player(0, "192.168.33.33", 9000);
player2 = new Player(1, "192.168.33.44", 9000);
tracker = new Tracker();
graphics = new GraphicsProgram();
String[] args = {"GraphicsProgram"};
@@ -69,15 +69,18 @@ public class GameLoop {
}

private List<Point> track(){
Point p1 = tracker.getP1();
Point p2 = tracker.getP2();
org.opencv.core.Point p1 = tracker.getP1();
org.opencv.core.Point p2 = tracker.getP2();

player1.setKoords(p1.x, p1.y);
player2.setKoords(p2.x, p2.y);
java.awt.Point p1Java = new java.awt.Point((int) p1.x, (int) p1.y);
java.awt.Point p2Java = new java.awt.Point((int) p2.x, (int) p2.y);

player1.setKoords(p1Java.x, p1Java.y);
player2.setKoords(p2Java.x, p2Java.y);

List<Point> output = new ArrayList<>();
output.set(0, p1);
output.add(p2);
output.set(0, p1Java);
output.set(1, p2Java);
return output;
}


+ 3
- 0
src/main/java/Main.java View File

@@ -1,2 +1,5 @@
public class Main {
public static void main(String[] args){
GameLoop gl = new GameLoop();
}
}

+ 8
- 0
src/main/java/Tracker.java View File

@@ -99,6 +99,14 @@ public class Tracker {
return positions;
}

public Point getP1(){
return currentPositionP1;
}

public Point getP2(){
return currentPositionP2;
}

private void drawMarkers(Mat frame) {
// Größe der Quadrate
int size = 10;

Loading…
Cancel
Save