Skip to content
Permalink
Browse files

Add crowd test tool (#48)

* Expose fields and APIs needed by crowd tool

* Add crowd test tool
  • Loading branch information...
ppiastucki committed Jan 26, 2019
1 parent 7e92e5b commit eeaacb5d8076a658d0c16e2b0b443f2d30367307
@@ -76,108 +76,6 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>windows</id>
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-glfw</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-opengl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-stb</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-tinyfd</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-nuklear</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
</dependencies>
</profile>
<profile>
<id>linux</id>
<activation>
<os>
<family>Linux</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-glfw</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-opengl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-stb</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-tinyfd</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-nuklear</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
</dependencies>
</profile>
<profile>
<id>mac</id>
<activation>
<os>
<family>Mac</family>
</os>
</activation>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.lwjgl</groupId>
@@ -217,18 +115,135 @@
<dependency>
<groupId>org.recast4j</groupId>
<artifactId>recast</artifactId>
<version>1.2.0</version>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>org.recast4j</groupId>
<artifactId>detour</artifactId>
<version>1.2.0</version>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>org.recast4j</groupId>
<artifactId>detour-crowd</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-glfw</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-opengl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-stb</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-tinyfd</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-nuklear</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-linux</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-glfw</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-opengl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-stb</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-tinyfd</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-nuklear</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-windows</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-macos</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-glfw</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-macos</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-opengl</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-macos</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-stb</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-macos</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-tinyfd</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-macos</classifier>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-nuklear</artifactId>
<version>${lwjgl.version}</version>
<classifier>natives-macos</classifier>
</dependency>

</dependencies>
</project>
@@ -117,6 +117,7 @@ recast4j copyright (c) 2015-2019 Piotr Piastucki piotr@jtilia.org
import org.recast4j.demo.sample.Sample;
import org.recast4j.demo.settings.SettingsUI;
import org.recast4j.demo.tool.ConvexVolumeTool;
import org.recast4j.demo.tool.CrowdTool;
import org.recast4j.demo.tool.OffMeshConnectionTool;
import org.recast4j.demo.tool.TestNavmeshTool;
import org.recast4j.demo.tool.Tool;
@@ -325,7 +326,7 @@ public void button(int button, int mods, boolean down) {
});

settingsUI = new SettingsUI();
toolsUI = new ToolsUI(new TestNavmeshTool(), new OffMeshConnectionTool(), new ConvexVolumeTool());
toolsUI = new ToolsUI(new TestNavmeshTool(), new OffMeshConnectionTool(), new ConvexVolumeTool(), new CrowdTool());

nuklearUI = new NuklearUI(window, mouse, settingsUI, toolsUI);

@@ -1060,21 +1060,6 @@ public void debugDrawNavMeshPoly(NavMesh mesh, long ref, int col) {

}

public void debugDrawCross(float x, float y, float z, float size, int col, float lineWidth) {
begin(DebugDrawPrimitives.LINES, lineWidth);
appendCross(x, y, z, size, col);
end();
}

private void appendCross(float x, float y, float z, float s, int col) {
vertex(x - s, y, z, col);
vertex(x + s, y, z, col);
vertex(x, y - s, z, col);
vertex(x, y + s, z, col);
vertex(x, y, z - s, col);
vertex(x, y, z + s, col);
}

public void debugDrawNavMeshPortals(NavMesh mesh) {
for (int i = 0; i < mesh.getMaxTiles(); ++i) {
MeshTile tile = mesh.getTile(i);
@@ -84,6 +84,7 @@ recast4j copyright (c) 2015-2019 Piotr Piastucki piotr@jtilia.org

public final NkColor white = NkColor.create();
public final NkColor background = NkColor.create();
public final NkColor transparent = NkColor.create();
private boolean buildTriggered;
private long buildTime;
private final int[] voxels = new int[2];
@@ -99,6 +100,7 @@ public boolean layout(NkContext ctx, int x, int y, int width, int height, int mo
boolean mouseInside = false;
nk_rgb(255, 255, 255, white);
nk_rgba(0, 0, 0, 192, background);
nk_rgba(255, 0, 0, 0, transparent);
try (MemoryStack stack = stackPush()) {
ctx.style().text().color().set(white);
ctx.style().option().text_normal().set(white);
@@ -110,6 +112,11 @@ public boolean layout(NkContext ctx, int x, int y, int width, int height, int mo
nk_style_item_color(white, styleItem);
ctx.style().option().cursor_hover().set(styleItem);
ctx.style().option().cursor_normal().set(styleItem);
nk_style_item_color(transparent, styleItem);
ctx.style().tab().node_minimize_button().normal().set(styleItem);
ctx.style().tab().node_minimize_button().active().set(styleItem);
ctx.style().tab().node_maximize_button().normal().set(styleItem);
ctx.style().tab().node_maximize_button().active().set(styleItem);
}
try (MemoryStack stack = stackPush()) {
NkRect rect = NkRect.mallocStack(stack);
Oops, something went wrong.

0 comments on commit eeaacb5

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.