2
2
< html lang ="en ">
3
3
4
4
< head >
5
- < link rel ="icon " href ="/vleue_navigator.png " type ="image/png ">
5
+ < link rel ="apple-touch-icon " sizes ="180x180 " href ="./apple-touch-icon.png ">
6
+ < link rel ="icon " type ="image/png " sizes ="32x32 " href ="./favicon-32x32.png ">
7
+ < link rel ="icon " type ="image/png " sizes ="16x16 " href ="./favicon-16x16.png ">
8
+ < link rel ="manifest " href ="./site.webmanifest ">
6
9
< link href ="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css " rel ="stylesheet ">
7
- < link href ="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-twilight .min.css " rel ="stylesheet " />
10
+ < link href ="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow .min.css " rel ="stylesheet " />
8
11
< script src ="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js "> </ script >
9
12
< script src ="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-rust.min.js "> </ script >
10
13
< title >
16
19
top : 0 ;
17
20
left : 0 ;
18
21
width : 100% ;
19
- background-color : rgba (31 , 41 , 55 , 0.9 ); /* bg-gray-800 with opacity */
22
+ background-color : rgba (31 , 41 , 55 , 0.9 );
20
23
display : none;
21
24
align-items : center;
22
25
justify-content : center;
35
38
font-weight : bold;
36
39
color : white;
37
40
}
38
- .copy-button {
39
- transition : background-color 0.3s ease;
41
+
42
+ pre [class *= "language-" ] {
43
+ position : relative;
40
44
}
41
45
42
- .copy-button : active {
43
- transform : scale (0.95 );
46
+ pre [class *= "language-" ] button {
47
+ position : absolute;
48
+ top : 5px ;
49
+ right : 5px ;
50
+ padding : 2px 4px ;
51
+ transition : background-color 0.3s ease;
44
52
}
45
53
</ style >
46
54
</ head >
49
57
50
58
< div class ="bg-gray-800 text-white py-20 ">
51
59
< div class ="container mx-auto text-center flex items-center justify-center ">
52
- < img src ="/ vleue_navigator.png " alt ="Vleue Navigator Logo " class ="w-20 h-20 mr-4 ">
60
+ < img src ="vleue_navigator.png " alt ="Vleue Navigator Logo " class ="w-20 h-20 mr-4 ">
53
61
< div >
54
62
< h1 class ="text-5xl font-bold mb-4 "> Vleue Navigator</ h1 >
55
63
< p class ="text-xl "> Efficient NavMesh and pathfinding solutions for your Bevy projects</ p >
@@ -60,8 +68,10 @@ <h1 class="text-5xl font-bold mb-4">Vleue Navigator</h1>
60
68
< footer class ="bg-gray-800 text-white py-4 ">
61
69
< div class ="container mx-auto text-center ">
62
70
< p >
63
- < a href ="https://github.com/vleue/vleue_navigator " class ="text-blue-500 hover:underline "> GitHub Repository</ a > |
64
- < a href ="https://docs.rs/vleue_navigator/latest/vleue_navigator/ " class ="text-blue-500 hover:underline "> Documentation</ a >
71
+ < a href ="https://github.com/vleue/vleue_navigator " class ="text-blue-500 hover:underline "> GitHub
72
+ Repository</ a > |
73
+ < a href ="https://docs.rs/vleue_navigator/latest/vleue_navigator/ "
74
+ class ="text-blue-500 hover:underline "> Documentation</ a >
65
75
</ p >
66
76
</ div >
67
77
</ footer >
@@ -79,15 +89,17 @@ <h1 class="text-3xl font-bold mb-4">Features</h1>
79
89
< li > Layers support for targeted updated</ li >
80
90
< li > Layers can overlap</ li >
81
91
</ ul >
92
+ </ div >
82
93
94
+ < div class ="container mx-auto p-4 ">
83
95
84
96
< h1 class ="text-3xl font-bold mb-4 "> How to Use</ h1 >
85
-
97
+
86
98
< div class ="mb-8 ">
87
99
< h2 class ="text-2xl font-bold mb-2 "> Installation</ h2 >
88
100
< div class ="relative ">
89
- < pre class =" p-4 rounded overflow-x-auto " > < code class =" language-shell " > cargo add vleue_navigator </ code > </ pre >
90
- < button class ="copy-button absolute top-0 right-0 mt-1 mr-1 bg-gray-500 text-white px-3 py-1 rounded hover:bg-gray-600 " onclick =" copyToClipboard(' cargo add vleue_navigator', this) " > Copy </ button >
101
+ < pre
102
+ class ="p-4 rounded overflow-x-auto " > < code class =" language-shell " > cargo add vleue_navigator</ code > </ pre >
91
103
</ div >
92
104
</ div >
93
105
@@ -108,9 +120,10 @@ <h2 class="text-2xl font-bold mb-2">Usage</h2>
108
120
...
109
121
.run();
110
122
}</ code > </ pre >
111
- You can then spawn a NavMesh entity:
112
- < div class ="relative ">
113
- < pre class ="p-4 rounded overflow-x-auto "> < code class ="language-rust "> fn spawn_navmesh(mut commands: Commands) {
123
+ </ div >
124
+ You can then spawn a NavMesh entity:
125
+ < div class ="relative ">
126
+ < pre class ="p-4 rounded overflow-x-auto "> < code class ="language-rust "> fn spawn_navmesh(mut commands: Commands) {
114
127
commands.spawn(NavMeshBundle {
115
128
settings: NavMeshSettings {
116
129
// Define the outer borders of the navmesh.
@@ -126,10 +139,11 @@ <h2 class="text-2xl font-bold mb-2">Usage</h2>
126
139
..NavMeshBundle::with_default_id()
127
140
});
128
141
}</ code > </ pre >
129
- Using the NavMesh to find a path:
142
+ </ div >
143
+ Using the NavMesh to find a path:
130
144
131
- < div class ="relative ">
132
- < pre class ="p-4 rounded overflow-x-auto "> < code class ="language-rust "> pub fn find_path(navmeshes: Res< Assets < NavMesh > > , navmesh: Query< (&Handle< NavMesh > , Ref< NavMeshStatus > )> ) {
145
+ < div class ="relative ">
146
+ < pre class ="p-4 rounded overflow-x-auto "> < code class ="language-rust "> pub fn find_path(navmeshes: Res< Assets < NavMesh > > , navmesh: Query< (&Handle< NavMesh > , Ref< NavMeshStatus > )> ) {
133
147
let (navmesh_handle, status) = navmesh.single();
134
148
if status != NavMeshStatus::Built {
135
149
// NavMesh is not ready yet.
@@ -147,22 +161,27 @@ <h2 class="text-2xl font-bold mb-2">Usage</h2>
147
161
}
148
162
}
149
163
}</ code > </ pre >
150
- < button class ="copy-button absolute top-0 right-0 mt-1 mr-1 bg-gray-500 text-white px-3 py-1 rounded hover:bg-gray-600 " onclick ="copyToClipboard(`// Example usage of Vleue Navigator\nuse vleue_navigator::NavMesh;\n\nfn main() {\n let navmesh = NavMesh::new();\n // Add your pathfinding logic here\n}`, this) "> Copy</ button >
151
164
</ div >
152
165
</ div >
153
-
166
+ </ div >
167
+
168
+ < div class ="container mx-auto p-4 ">
169
+
154
170
< h1 class ="text-3xl font-bold mb-4 "> Examples</ h1 >
155
171
< div class ="flex flex-col space-y-8 ">
156
172
< a href ="primitive_3d.html " class ="flex items-center ">
157
- < img src ="screenshots/primitive_3d.png " class ="object-cover w-1/2 " alt ="Auto updating a NavMesh from Bevy shapes " />
173
+ < img src ="screenshots/primitive_3d.png " class ="object-cover w-1/2 "
174
+ alt ="Auto updating a NavMesh from Bevy shapes " />
158
175
< div class ="ml-8 text-xl "> Auto updating a NavMesh from Bevy shapes</ div >
159
176
</ a >
160
177
< a href ="auto_navmesh_aabb.html " class ="flex items-center flex-row-reverse ">
161
- < img src ="screenshots/auto_navmesh_aabb.png " class ="object-cover w-1/2 " alt ="Auto updating a NavMesh from Bevy Aabb component " />
178
+ < img src ="screenshots/auto_navmesh_aabb.png " class ="object-cover w-1/2 "
179
+ alt ="Auto updating a NavMesh from Bevy Aabb component " />
162
180
< div class ="mr-8 text-xl "> Auto updating a NavMesh from Bevy `Aabb` component</ div >
163
181
</ a >
164
182
< a href ="auto_navmesh_primitive.html " class ="flex items-center ">
165
- < img src ="screenshots/auto_navmesh_primitive.png " class ="object-cover w-1/2 " alt ="NavMesh updated using primitive shapes " />
183
+ < img src ="screenshots/auto_navmesh_primitive.png " class ="object-cover w-1/2 "
184
+ alt ="NavMesh updated using primitive shapes " />
166
185
< div class ="ml-8 text-xl "> NavMesh updated using primitive shapes (rectangle, circle, ...)</ div >
167
186
</ a >
168
187
< a href ="demo.html " class ="flex items-center flex-row-reverse ">
@@ -174,19 +193,22 @@ <h1 class="text-3xl font-bold mb-4">Examples</h1>
174
193
< h2 class ="text-2xl font-bold mt-8 mb-4 "> Avian integration</ h2 >
175
194
< div class ="flex flex-wrap ">
176
195
< a href ="auto_navmesh_avian2d.html " class ="m-5 text-xl flex flex-col items-center ">
177
- < img src ="screenshots/auto_navmesh_avian2d.png " class ="object-cover " alt ="Auto updating a NavMesh with colliders from Avian2d " />
196
+ < img src ="screenshots/auto_navmesh_avian2d.png " class ="object-cover "
197
+ alt ="Auto updating a NavMesh with colliders from Avian2d " />
178
198
< div class ="mt-2 "> Auto updating a NavMesh with colliders from Avian2d</ div >
179
199
</ a >
180
200
< a href ="auto_navmesh_avian3d.html " class ="m-5 text-xl flex flex-col items-center ">
181
- < img src ="screenshots/auto_navmesh_avian3d.png " class ="object-cover " alt ="Auto updating a NavMesh with colliders from Avian3d " />
201
+ < img src ="screenshots/auto_navmesh_avian3d.png " class ="object-cover "
202
+ alt ="Auto updating a NavMesh with colliders from Avian3d " />
182
203
< div class ="mt-2 "> Auto updating a NavMesh with colliders from Avian3d</ div >
183
204
</ a >
184
205
</ div >
185
206
186
207
< h2 class ="text-2xl font-bold mt-8 mb-4 "> Others</ h2 >
187
208
< div class ="flex flex-wrap ">
188
209
< a href ="many.html " class ="m-5 text-xl flex flex-col items-center ">
189
- < img src ="screenshots/many.png " class ="object-cover " alt ="Spawn many agents and run a lot of concurrent pathfinding tasks " />
210
+ < img src ="screenshots/many.png " class ="object-cover "
211
+ alt ="Spawn many agents and run a lot of concurrent pathfinding tasks " />
190
212
< div class ="mt-2 "> Spawn many agents and run a lot of concurrent pathfinding tasks</ div >
191
213
</ a >
192
214
< a href ="lines.html " class ="m-5 text-xl flex flex-col items-center ">
@@ -206,7 +228,8 @@ <h2 class="text-2xl font-bold mt-8 mb-4">Others</h2>
206
228
< div class ="mt-2 "> Navmesh from random obstacles</ div >
207
229
</ a >
208
230
< a href ="auto_navmesh_aabb.html " class ="m-5 text-xl flex flex-col items-center ">
209
- < img src ="screenshots/auto_navmesh_aabb.png " class ="object-cover " alt ="NavMesh automatically updated from obstacles using Aabb " />
231
+ < img src ="screenshots/auto_navmesh_aabb.png " class ="object-cover "
232
+ alt ="NavMesh automatically updated from obstacles using Aabb " />
210
233
< div class ="mt-2 "> NavMesh automatically updated from obstacles using `Aabb`</ div >
211
234
</ a >
212
235
</ div >
@@ -216,25 +239,25 @@ <h2 class="text-2xl font-bold mt-8 mb-4">Others</h2>
216
239
< h1 class ="text-3xl font-bold mb-4 "> Reading List of implemented and used techniques</ h1 >
217
240
< ul class ="list-disc pl-5 mb-8 ">
218
241
< li > < a class ="text-blue-500 hover:underline "
219
- href ="https://www.ijcai.org/proceedings/2017/0070.pdf "> Compromise-free Pathfinding on a Navigation
220
- Mesh</ a > </ li >
242
+ href ="https://www.ijcai.org/proceedings/2017/0070.pdf "> Compromise-free Pathfinding on a
243
+ Navigation Mesh</ a > </ li >
221
244
< li > < a class ="text-blue-500 hover:underline "
222
245
href ="https://hull-repository.worktribe.com/preview/376364/000870493786962263.pdf "> Line
223
246
Generalisation by Repeated Elimination of Points</ a > </ li >
224
247
< li > < a class ="text-blue-500 hover:underline "
225
248
href ="https://en.wikipedia.org/wiki/Constrained_Delaunay_triangulation "> Constrained Delaunay
226
249
Triangulation</ a > </ li >
227
250
< li > < a class ="text-blue-500 hover:underline "
228
- href ="https://mcmains.me.berkeley.edu/pubs/DAC05OffsetPolygon.pdf "> Polygon Offsetting by Computing
229
- Winding Numbers</ a > </ li >
251
+ href ="https://mcmains.me.berkeley.edu/pubs/DAC05OffsetPolygon.pdf "> Polygon Offsetting by
252
+ Computing Winding Numbers</ a > </ li >
230
253
</ ul >
231
254
</ div >
232
255
233
256
< div class ="container mx-auto p-4 ">
234
- < h1 class ="text-3xl font-bold mb-4 "> Example Videos</ h1 >
257
+ < h1 class ="text-3xl font-bold mb-4 "> Showcase Videos</ h1 >
235
258
< ul class ="list-disc pl-5 mb-8 ">
236
259
< li > < a class ="text-blue-500 hover:underline " href ="https://www.youtube.com/watch?v=Zi9EMAdHp4M "> Pathfinding
237
- many agents</ a > </ li >
260
+ with many agents</ a > </ li >
238
261
< li > < a class ="text-blue-500 hover:underline " href ="https://www.youtube.com/watch?v=wYRrvWaLjJ8 "> Parameters
239
262
for NavMesh generation</ a > </ li >
240
263
</ ul >
@@ -254,13 +277,34 @@ <h1>Vleue Navigator</h1>
254
277
stickyMenu . style . display = 'none' ;
255
278
}
256
279
} ) ;
257
- function copyToClipboard ( text , button ) {
258
- navigator . clipboard . writeText ( text ) . then ( ( ) => {
280
+ const copyButtonLabel = "Copy" ;
281
+
282
+ let blocks = document . querySelectorAll ( "pre" ) ;
283
+
284
+ blocks . forEach ( ( block ) => {
285
+ if ( navigator . clipboard ) {
286
+ let button = document . createElement ( "button" ) ;
287
+ button . className = "rounded bg-gray-600 hover:bg-gray-800"
288
+
289
+ button . innerText = copyButtonLabel ;
290
+ block . appendChild ( button ) ;
291
+
292
+ button . addEventListener ( "click" , async ( ) => {
293
+ button . className = "rounded bg-gray-400"
294
+ await copyCode ( block ) ;
295
+ setTimeout ( ( ) => {
296
+ button . className = "rounded bg-gray-600 hover:bg-gray-800"
297
+ } , 400 ) ;
298
+ } ) ;
299
+ }
300
+ } ) ;
301
+
302
+ async function copyCode ( block ) {
303
+ let code = block . querySelector ( "code" ) ;
304
+ let text = code . innerText ;
259
305
260
- } , ( err ) => {
261
- console . error ( 'Could not copy text: ' , err ) ;
262
- } ) ;
306
+ await navigator . clipboard . writeText ( text ) ;
263
307
}
264
308
</ script >
265
309
266
- </ html >
310
+ </ html >
0 commit comments