-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix to hardcode recast-detour package to previous release, as the …
…latest package that BabylonJS automatically downloads breaks the build.
- Loading branch information
1 parent
53eecdb
commit d5b053d
Showing
5 changed files
with
221 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"_from": "[email protected]", | ||
"_id": "[email protected]", | ||
"_inBundle": false, | ||
"_integrity": "sha512-d69n2yZl79MFynmAs/Vkkt2J6RYkBkdO5JOw3T7NfkGD9sltRAnstFVTH9mYJwBgOgdlXuzbUBV6EgpscTMzvA==", | ||
"_location": "/recast-detour", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"type": "version", | ||
"registry": true, | ||
"raw": "[email protected]", | ||
"name": "recast-detour", | ||
"escapedName": "recast-detour", | ||
"rawSpec": "1.3.0", | ||
"saveSpec": null, | ||
"fetchSpec": "1.3.0" | ||
}, | ||
"_requiredBy": [ | ||
"#USER", | ||
"/" | ||
], | ||
"_resolved": "https://registry.npmjs.org/recast-detour/-/recast-detour-1.3.0.tgz", | ||
"_shasum": "d21532b219d10c6b6b578ac5220b8e50f4db3790", | ||
"_spec": "[email protected]", | ||
"_where": "C:\\Users\\eric\\source\\repos\\killer-bunnies", | ||
"author": "", | ||
"bundleDependencies": false, | ||
"deprecated": false, | ||
"description": "recastjs is a port of recastnavigation and a thin abstraction layer using emscripten. https://github.com/emscripten-core/emscripten\r This port allows the use of recastnavigation in your browser using JavaScript or WebAssembly.", | ||
"keywords": [ | ||
"recast", | ||
"detour", | ||
"navigation", | ||
"navmesh" | ||
], | ||
"license": "ISC", | ||
"main": "recast.js", | ||
"name": "recast-detour", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"version": "1.3.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## What is recastjs ? | ||
|
||
recastjs is a port of recastnavigation and a thin abstraction layer using emscripten. https://github.com/emscripten-core/emscripten | ||
This port allows the use of recastnavigation in your browser using JavaScript or WebAssembly. | ||
|
||
## What is recastnavigation ? | ||
|
||
Recast is a navigation mesh construction toolset for games. | ||
Recast is accompanied by Detour, a spatial reasoning toolkit. | ||
You can use any navigation mesh with Detour, but of course the data generated by Recast fits perfectly. | ||
The crowd management module provides you with features for agents handling and behavior customization | ||
|
||
Some documentation is available here : http://masagroup.github.io/recastdetour/index.html | ||
|
||
## How to extend recastjs ? | ||
|
||
Recast/Detour can be difficult to use directly. A simplification layer is done thru src/recastjs.h/.cpp. All the functionnalities have to be exposed to JS by the IDL file. | ||
Basically, that file lists all the structures, classes, methods visible to JS. The glue generation and build is handled ny make.py script. Any new functionnality should be written in recastjs.cpp file and exposed by the IDL | ||
For more information on Web IDL : https://emscripten.org/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html | ||
|
||
## License | ||
|
||
Recastjs is licensed under the same terms as Recastnavigation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
export namespace Recast { | ||
// eslint-disable-next-line @typescript-eslint/class-name-casing | ||
export class rcConfig { | ||
new (); | ||
width: number; | ||
height: number; | ||
tileSize: number; | ||
borderSize: number; | ||
cs: number; | ||
ch: number; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
bmin: any; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
bmax: any; | ||
walkableSlopeAngle: number; | ||
walkableHeight: number; | ||
walkableClimb: number; | ||
walkableRadius: number; | ||
maxEdgeLen: number; | ||
maxSimplificationError: number; | ||
minRegionArea: number; | ||
mergeRegionArea: number; | ||
maxVertsPerPoly: number; | ||
detailSampleDist: number; | ||
detailSampleMaxError: number; | ||
} | ||
export class Vec3 { | ||
new (); | ||
new (x: number, y: number, z: number); | ||
x: number; | ||
y: number; | ||
z: number; | ||
} | ||
export class Triangle { | ||
new (); | ||
getPoint(n: number): Vec3; | ||
} | ||
export class DebugNavMesh { | ||
new (); | ||
getTriangleCount(): number; | ||
getTriangle(n: number): Triangle; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/class-name-casing | ||
export class dtNavMesh { | ||
} | ||
// eslint-disable-next-line @typescript-eslint/class-name-casing | ||
export class dtObstacleRef { | ||
} | ||
export class NavmeshData { | ||
new (); | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
dataPointer: any; | ||
size: number; | ||
} | ||
export class NavPath { | ||
getPointCount(): number; | ||
getPoint(n: number): Vec3; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/class-name-casing | ||
export class dtCrowdAgentParams { | ||
new (); | ||
radius: number; | ||
height: number; | ||
maxAcceleration: number; | ||
maxSpeed: number; | ||
collisionQueryRange: number; | ||
pathOptimizationRange: number; | ||
separationWeight: number; | ||
updateFlags: number; | ||
obstacleAvoidanceType: number; | ||
queryFilterType: number; | ||
userData: unknown; | ||
} | ||
export class NavMesh { | ||
new (); | ||
destroy(): void; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
build(positions: any, positionCount: number, indices: any, indexCount: number, config: rcConfig): void; | ||
buildFromNavmeshData(data: NavmeshData): void; | ||
getNavmeshData(): NavmeshData; | ||
freeNavmeshData(data: NavmeshData): void; | ||
getDebugNavMesh(): DebugNavMesh; | ||
getClosestPoint(position: Vec3): Vec3; | ||
getRandomPointAround(position: Vec3, maxRadius: number): Vec3; | ||
moveAlong(position: Vec3, destination: Vec3): Vec3; | ||
getNavMesh(): dtNavMesh; | ||
computePath(start: Vec3, end: Vec3): NavPath; | ||
setDefaultQueryExtent(extent: Vec3): void; | ||
getDefaultQueryExtent(): Vec3; | ||
addCylinderObstacle(position: Vec3, radius: number, height: number): dtObstacleRef; | ||
addBoxObstacle(position: Vec3, extent: Vec3, angle: number): dtObstacleRef; | ||
removeObstacle(obstacle: dtObstacleRef): void; | ||
update(): void; | ||
} | ||
export class Crowd { | ||
new (maxAgents: number, maxAgentRadius: number, nav: dtNavMesh); | ||
destroy(): void; | ||
addAgent(position: Vec3, params: dtCrowdAgentParams): number; | ||
removeAgent(idx: number): void; | ||
update(dt: number): void; | ||
getAgentPosition(idx: number): Vec3; | ||
getAgentVelocity(idx: number): Vec3; | ||
getAgentNextTargetPath(idx: number): Vec3; | ||
getAgentState(idx: number): number; | ||
overOffmeshConnection(idx: number): boolean; | ||
agentGoto(idx: number, destination: Vec3): void; | ||
agentTeleport(idx: number, destination: Vec3): void; | ||
getAgentParameters(idx: number): dtCrowdAgentParams; | ||
setAgentParameters(idx: number, params: dtCrowdAgentParams): void; | ||
setDefaultQueryExtent(extent: Vec3): void; | ||
getDefaultQueryExtent(): Vec3; | ||
getCorners(idx: number): NavPath; | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.