Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavMesh tools/libraries enhancements #34

Open
wants to merge 48 commits into
base: master
Choose a base branch
from

Conversation

dbierek
Copy link
Contributor

@dbierek dbierek commented Apr 20, 2024

Adds Anthony Fuller's NavTool updates from #11:

This PR contains multiple improvements and changes to NavWeakness, NavTool, and NavViewer these are outlined below:

NavWeakness

  • Switched to my NavPower header library
  • Added functions to output the navmesh as human readable or for the viewer
  • Changed the Surfaces object to Areas and changed the Unk02 object to KDTree

NavTool

  • Added an option to output as a human readable format (--human)
  • Changed the Surfaces object to Areas and changed the Unk02 object to KDTree

NavViewer

  • Renamed Surfaces.js to NavMeshes.js
  • Changed names of check boxes to match what they actually are
  • Added rendering of k-d tree bounding boxes
  • Now renders faces and edges by default instead of the "unknown points"
  • Changed the Surfaces object to Areas and changed the Unk02 object to KDTree

.gitignore

  • Removed unused Faces.js
  • Changed Surfaces.js to NavMeshes.js
  • Added .vscode and _build

Also adds new updates to enable:
Writing to NAVP
Writing to JSON
Reading from JSON

NavpJsonVersion 0.1
Example:

{
  "Areas": [
    {
      "Area": { "Index": 1 },
      "Edges": [
        {
          "Position": { "X": -22.8499, "Y": -12.9597, "Z": -1.3357 },
          "Flags": 662
        },
        {
          "Position": { "X": -21.75, "Y": -15.85, "Z": -1.3504 },
          "Flags": 451
        },
        {
          "Adjacent Area": 2,
          "Position": { "X": -20.75, "Y": -12.9497, "Z": -1.3505 },
          "Flags": 1772
        }
      ]
    },
    {
      "Area": { "Index": 2, "Type": "Steps" },
      "Edges": [
        {
          "Adjacent Area": 3,
          "Position": { "X": -20.75, "Y": -8.4714, "Z": 1.6817 },
          "Flags": 1776
        },
        { "Position": { "X": -22.5496, "Y": -8.48, "Z": 1.6943 } },
        { "Position": { "X": -22.85, "Y": -8.55, "Z": 1.65 } },
        {
          "Adjacent Area": 1,
          "Position": { "X": -22.8499, "Y": -12.9597, "Z": -1.3357 },
          "Flags": 1772
        },
        { "Position": { "X": -20.75, "Y": -12.9497, "Z": -1.3505 } }
      ]
    },
    {
      "Area": { "Index": 3, "Type": "Steps" },
      "Edges": [
        { "Position": { "X": -22.55, "Y": -8.25, "Z": 1.85 } },
        {
          "Adjacent Area": 2,
          "Position": { "X": -22.5496, "Y": -8.48, "Z": 1.6943 },
          "Flags": 1776
        },
        { "Position": { "X": -20.75, "Y": -8.4714, "Z": 1.6817 } },
        {
          "Position": { "X": -20.75, "Y": -6.45, "Z": 3.0503 },
          "Type": "Portal",
          "Flags": 594
        }
      ]
    }
  ],
  "NavpJsonVersion": "0.1"
}

@dbierek dbierek changed the title Tony's and Danny's navtool updates [NavTool] [NavWeakness] Tony's and Danny's navtool updates Apr 20, 2024
@dbierek dbierek marked this pull request as draft April 22, 2024 18:30
@dbierek dbierek changed the title [NavTool] [NavWeakness] Tony's and Danny's navtool updates [NavTool] [NavWeakness] [NavViewer] NavMesh tools/libraries enhancements Apr 23, 2024
@dbierek dbierek changed the title [NavTool] [NavWeakness] [NavViewer] NavMesh tools/libraries enhancements NavMesh tools/libraries enhancements Apr 23, 2024
@dbierek dbierek marked this pull request as ready for review May 24, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants