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

Recast Navigation plugin V2 #16180

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

RolandCsibrei
Copy link
Contributor

@RolandCsibrei RolandCsibrei commented Feb 12, 2025

Uses the recast-navigation-js library

@RolandCsibrei RolandCsibrei marked this pull request as draft February 12, 2025 14:25
@bjsplat
Copy link
Collaborator

bjsplat commented Feb 12, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 12, 2025

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 12, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 12, 2025

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 12, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 12, 2025

Reviewer - this PR has made changes to one or more package.json files.

package.json Outdated
@@ -108,5 +108,8 @@
"nextVersion": "Unreleased",
"ignoreCommitters": [],
"feature": "New Feature"
},
"dependencies": {
"recast-navigation": "^0.39.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this so it wouldn't be merged - please don't add dependencies on the main package.json (only dev-dependencies needed for the monorepo). If it is a dependency for a specific package, add it to the specific package, however, as mentioned offline - it would be good not to have any dependency added to our core library. Instead, handle dependencies like we handle draco/havok/csg2/recast1

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 13, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@@ -0,0 +1,1770 @@
/* eslint-disable no-console */

import * as Recast2 from "recast-navigation";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be imported, but injected in the constructor

Comment on lines +18 to +21
import type { SoloNavMeshGeneratorConfig, SoloNavMeshGeneratorIntermediates, TiledNavMeshGeneratorConfig, TiledNavMeshGeneratorIntermediates } from "recast-navigation/generators";
import type { NavMesh, QueryFilter, TileCache } from "recast-navigation";
import { generateSoloNavMesh, generateTileCache, generateTiledNavMesh } from "recast-navigation/generators";
import { Crowd, Detour, exportNavMesh, getNavMeshPositionsAndIndices, getRandomSeed, importNavMesh, NavMeshQuery, setRandomSeed } from "recast-navigation";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting issue we have not solved yet. These types need to be declared and not imported, as it messes up the UMD declaration file. Is it optimal? nope. Is it safer for dev/core - yep :-)

Anything you need to import (and not import type) from the package needs to be injected. It can be an entire namespace, if needed.

@RolandCsibrei
Copy link
Contributor Author

@RaananW Hello! Thanks for the comments, but this PR is still in Draft mode and not ready for review yet :-) I responded to your message on the forum.

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.

3 participants