1 /** 2 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.navigationmesh; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.meta; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.object; 22 import godot.classdb; 23 import godot.resource; 24 import godot.mesh; 25 import godot.reference; 26 /** 27 28 */ 29 @GodotBaseClass struct NavigationMesh 30 { 31 enum string _GODOT_internal_name = "NavigationMesh"; 32 public: 33 @nogc nothrow: 34 union { godot_object _godot_object; Resource _GODOT_base; } 35 alias _GODOT_base this; 36 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 37 package(godot) __gshared bool _classBindingInitialized = false; 38 package(godot) static struct _classBinding 39 { 40 __gshared: 41 @GodotName("set_sample_partition_type") GodotMethod!(void, long) setSamplePartitionType; 42 @GodotName("get_sample_partition_type") GodotMethod!(long) getSamplePartitionType; 43 @GodotName("set_cell_size") GodotMethod!(void, double) setCellSize; 44 @GodotName("get_cell_size") GodotMethod!(double) getCellSize; 45 @GodotName("set_cell_height") GodotMethod!(void, double) setCellHeight; 46 @GodotName("get_cell_height") GodotMethod!(double) getCellHeight; 47 @GodotName("set_agent_height") GodotMethod!(void, double) setAgentHeight; 48 @GodotName("get_agent_height") GodotMethod!(double) getAgentHeight; 49 @GodotName("set_agent_radius") GodotMethod!(void, double) setAgentRadius; 50 @GodotName("get_agent_radius") GodotMethod!(double) getAgentRadius; 51 @GodotName("set_agent_max_climb") GodotMethod!(void, double) setAgentMaxClimb; 52 @GodotName("get_agent_max_climb") GodotMethod!(double) getAgentMaxClimb; 53 @GodotName("set_agent_max_slope") GodotMethod!(void, double) setAgentMaxSlope; 54 @GodotName("get_agent_max_slope") GodotMethod!(double) getAgentMaxSlope; 55 @GodotName("set_region_min_size") GodotMethod!(void, double) setRegionMinSize; 56 @GodotName("get_region_min_size") GodotMethod!(double) getRegionMinSize; 57 @GodotName("set_region_merge_size") GodotMethod!(void, double) setRegionMergeSize; 58 @GodotName("get_region_merge_size") GodotMethod!(double) getRegionMergeSize; 59 @GodotName("set_edge_max_length") GodotMethod!(void, double) setEdgeMaxLength; 60 @GodotName("get_edge_max_length") GodotMethod!(double) getEdgeMaxLength; 61 @GodotName("set_edge_max_error") GodotMethod!(void, double) setEdgeMaxError; 62 @GodotName("get_edge_max_error") GodotMethod!(double) getEdgeMaxError; 63 @GodotName("set_verts_per_poly") GodotMethod!(void, double) setVertsPerPoly; 64 @GodotName("get_verts_per_poly") GodotMethod!(double) getVertsPerPoly; 65 @GodotName("set_detail_sample_distance") GodotMethod!(void, double) setDetailSampleDistance; 66 @GodotName("get_detail_sample_distance") GodotMethod!(double) getDetailSampleDistance; 67 @GodotName("set_detail_sample_max_error") GodotMethod!(void, double) setDetailSampleMaxError; 68 @GodotName("get_detail_sample_max_error") GodotMethod!(double) getDetailSampleMaxError; 69 @GodotName("set_filter_low_hanging_obstacles") GodotMethod!(void, bool) setFilterLowHangingObstacles; 70 @GodotName("get_filter_low_hanging_obstacles") GodotMethod!(bool) getFilterLowHangingObstacles; 71 @GodotName("set_filter_ledge_spans") GodotMethod!(void, bool) setFilterLedgeSpans; 72 @GodotName("get_filter_ledge_spans") GodotMethod!(bool) getFilterLedgeSpans; 73 @GodotName("set_filter_walkable_low_height_spans") GodotMethod!(void, bool) setFilterWalkableLowHeightSpans; 74 @GodotName("get_filter_walkable_low_height_spans") GodotMethod!(bool) getFilterWalkableLowHeightSpans; 75 @GodotName("set_vertices") GodotMethod!(void, PoolVector3Array) setVertices; 76 @GodotName("get_vertices") GodotMethod!(PoolVector3Array) getVertices; 77 @GodotName("add_polygon") GodotMethod!(void, PoolIntArray) addPolygon; 78 @GodotName("get_polygon_count") GodotMethod!(long) getPolygonCount; 79 @GodotName("get_polygon") GodotMethod!(PoolIntArray, long) getPolygon; 80 @GodotName("clear_polygons") GodotMethod!(void) clearPolygons; 81 @GodotName("create_from_mesh") GodotMethod!(void, Mesh) createFromMesh; 82 @GodotName("_set_polygons") GodotMethod!(void, Array) _setPolygons; 83 @GodotName("_get_polygons") GodotMethod!(Array) _getPolygons; 84 } 85 bool opEquals(in NavigationMesh other) const { return _godot_object.ptr is other._godot_object.ptr; } 86 NavigationMesh opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 87 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 88 mixin baseCasts; 89 static NavigationMesh _new() 90 { 91 static godot_class_constructor constructor; 92 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("NavigationMesh"); 93 if(constructor is null) return typeof(this).init; 94 return cast(NavigationMesh)(constructor()); 95 } 96 @disable new(size_t s); 97 /// 98 enum Constants : int 99 { 100 /** 101 102 */ 103 samplePartitionWatershed = 0, 104 /** 105 106 */ 107 samplePartitionMonotone = 1, 108 /** 109 110 */ 111 samplePartitionLayers = 2, 112 } 113 /** 114 115 */ 116 void setSamplePartitionType(in long sample_partition_type) 117 { 118 checkClassBinding!(typeof(this))(); 119 ptrcall!(void)(_classBinding.setSamplePartitionType, _godot_object, sample_partition_type); 120 } 121 /** 122 123 */ 124 long getSamplePartitionType() const 125 { 126 checkClassBinding!(typeof(this))(); 127 return ptrcall!(long)(_classBinding.getSamplePartitionType, _godot_object); 128 } 129 /** 130 131 */ 132 void setCellSize(in double cell_size) 133 { 134 checkClassBinding!(typeof(this))(); 135 ptrcall!(void)(_classBinding.setCellSize, _godot_object, cell_size); 136 } 137 /** 138 139 */ 140 double getCellSize() const 141 { 142 checkClassBinding!(typeof(this))(); 143 return ptrcall!(double)(_classBinding.getCellSize, _godot_object); 144 } 145 /** 146 147 */ 148 void setCellHeight(in double cell_height) 149 { 150 checkClassBinding!(typeof(this))(); 151 ptrcall!(void)(_classBinding.setCellHeight, _godot_object, cell_height); 152 } 153 /** 154 155 */ 156 double getCellHeight() const 157 { 158 checkClassBinding!(typeof(this))(); 159 return ptrcall!(double)(_classBinding.getCellHeight, _godot_object); 160 } 161 /** 162 163 */ 164 void setAgentHeight(in double agent_height) 165 { 166 checkClassBinding!(typeof(this))(); 167 ptrcall!(void)(_classBinding.setAgentHeight, _godot_object, agent_height); 168 } 169 /** 170 171 */ 172 double getAgentHeight() const 173 { 174 checkClassBinding!(typeof(this))(); 175 return ptrcall!(double)(_classBinding.getAgentHeight, _godot_object); 176 } 177 /** 178 179 */ 180 void setAgentRadius(in double agent_radius) 181 { 182 checkClassBinding!(typeof(this))(); 183 ptrcall!(void)(_classBinding.setAgentRadius, _godot_object, agent_radius); 184 } 185 /** 186 187 */ 188 double getAgentRadius() 189 { 190 checkClassBinding!(typeof(this))(); 191 return ptrcall!(double)(_classBinding.getAgentRadius, _godot_object); 192 } 193 /** 194 195 */ 196 void setAgentMaxClimb(in double agent_max_climb) 197 { 198 checkClassBinding!(typeof(this))(); 199 ptrcall!(void)(_classBinding.setAgentMaxClimb, _godot_object, agent_max_climb); 200 } 201 /** 202 203 */ 204 double getAgentMaxClimb() const 205 { 206 checkClassBinding!(typeof(this))(); 207 return ptrcall!(double)(_classBinding.getAgentMaxClimb, _godot_object); 208 } 209 /** 210 211 */ 212 void setAgentMaxSlope(in double agent_max_slope) 213 { 214 checkClassBinding!(typeof(this))(); 215 ptrcall!(void)(_classBinding.setAgentMaxSlope, _godot_object, agent_max_slope); 216 } 217 /** 218 219 */ 220 double getAgentMaxSlope() const 221 { 222 checkClassBinding!(typeof(this))(); 223 return ptrcall!(double)(_classBinding.getAgentMaxSlope, _godot_object); 224 } 225 /** 226 227 */ 228 void setRegionMinSize(in double region_min_size) 229 { 230 checkClassBinding!(typeof(this))(); 231 ptrcall!(void)(_classBinding.setRegionMinSize, _godot_object, region_min_size); 232 } 233 /** 234 235 */ 236 double getRegionMinSize() const 237 { 238 checkClassBinding!(typeof(this))(); 239 return ptrcall!(double)(_classBinding.getRegionMinSize, _godot_object); 240 } 241 /** 242 243 */ 244 void setRegionMergeSize(in double region_merge_size) 245 { 246 checkClassBinding!(typeof(this))(); 247 ptrcall!(void)(_classBinding.setRegionMergeSize, _godot_object, region_merge_size); 248 } 249 /** 250 251 */ 252 double getRegionMergeSize() const 253 { 254 checkClassBinding!(typeof(this))(); 255 return ptrcall!(double)(_classBinding.getRegionMergeSize, _godot_object); 256 } 257 /** 258 259 */ 260 void setEdgeMaxLength(in double edge_max_length) 261 { 262 checkClassBinding!(typeof(this))(); 263 ptrcall!(void)(_classBinding.setEdgeMaxLength, _godot_object, edge_max_length); 264 } 265 /** 266 267 */ 268 double getEdgeMaxLength() const 269 { 270 checkClassBinding!(typeof(this))(); 271 return ptrcall!(double)(_classBinding.getEdgeMaxLength, _godot_object); 272 } 273 /** 274 275 */ 276 void setEdgeMaxError(in double edge_max_error) 277 { 278 checkClassBinding!(typeof(this))(); 279 ptrcall!(void)(_classBinding.setEdgeMaxError, _godot_object, edge_max_error); 280 } 281 /** 282 283 */ 284 double getEdgeMaxError() const 285 { 286 checkClassBinding!(typeof(this))(); 287 return ptrcall!(double)(_classBinding.getEdgeMaxError, _godot_object); 288 } 289 /** 290 291 */ 292 void setVertsPerPoly(in double verts_per_poly) 293 { 294 checkClassBinding!(typeof(this))(); 295 ptrcall!(void)(_classBinding.setVertsPerPoly, _godot_object, verts_per_poly); 296 } 297 /** 298 299 */ 300 double getVertsPerPoly() const 301 { 302 checkClassBinding!(typeof(this))(); 303 return ptrcall!(double)(_classBinding.getVertsPerPoly, _godot_object); 304 } 305 /** 306 307 */ 308 void setDetailSampleDistance(in double detail_sample_dist) 309 { 310 checkClassBinding!(typeof(this))(); 311 ptrcall!(void)(_classBinding.setDetailSampleDistance, _godot_object, detail_sample_dist); 312 } 313 /** 314 315 */ 316 double getDetailSampleDistance() const 317 { 318 checkClassBinding!(typeof(this))(); 319 return ptrcall!(double)(_classBinding.getDetailSampleDistance, _godot_object); 320 } 321 /** 322 323 */ 324 void setDetailSampleMaxError(in double detail_sample_max_error) 325 { 326 checkClassBinding!(typeof(this))(); 327 ptrcall!(void)(_classBinding.setDetailSampleMaxError, _godot_object, detail_sample_max_error); 328 } 329 /** 330 331 */ 332 double getDetailSampleMaxError() const 333 { 334 checkClassBinding!(typeof(this))(); 335 return ptrcall!(double)(_classBinding.getDetailSampleMaxError, _godot_object); 336 } 337 /** 338 339 */ 340 void setFilterLowHangingObstacles(in bool filter_low_hanging_obstacles) 341 { 342 checkClassBinding!(typeof(this))(); 343 ptrcall!(void)(_classBinding.setFilterLowHangingObstacles, _godot_object, filter_low_hanging_obstacles); 344 } 345 /** 346 347 */ 348 bool getFilterLowHangingObstacles() const 349 { 350 checkClassBinding!(typeof(this))(); 351 return ptrcall!(bool)(_classBinding.getFilterLowHangingObstacles, _godot_object); 352 } 353 /** 354 355 */ 356 void setFilterLedgeSpans(in bool filter_ledge_spans) 357 { 358 checkClassBinding!(typeof(this))(); 359 ptrcall!(void)(_classBinding.setFilterLedgeSpans, _godot_object, filter_ledge_spans); 360 } 361 /** 362 363 */ 364 bool getFilterLedgeSpans() const 365 { 366 checkClassBinding!(typeof(this))(); 367 return ptrcall!(bool)(_classBinding.getFilterLedgeSpans, _godot_object); 368 } 369 /** 370 371 */ 372 void setFilterWalkableLowHeightSpans(in bool filter_walkable_low_height_spans) 373 { 374 checkClassBinding!(typeof(this))(); 375 ptrcall!(void)(_classBinding.setFilterWalkableLowHeightSpans, _godot_object, filter_walkable_low_height_spans); 376 } 377 /** 378 379 */ 380 bool getFilterWalkableLowHeightSpans() const 381 { 382 checkClassBinding!(typeof(this))(); 383 return ptrcall!(bool)(_classBinding.getFilterWalkableLowHeightSpans, _godot_object); 384 } 385 /** 386 387 */ 388 void setVertices(in PoolVector3Array vertices) 389 { 390 checkClassBinding!(typeof(this))(); 391 ptrcall!(void)(_classBinding.setVertices, _godot_object, vertices); 392 } 393 /** 394 395 */ 396 PoolVector3Array getVertices() const 397 { 398 checkClassBinding!(typeof(this))(); 399 return ptrcall!(PoolVector3Array)(_classBinding.getVertices, _godot_object); 400 } 401 /** 402 403 */ 404 void addPolygon(in PoolIntArray polygon) 405 { 406 checkClassBinding!(typeof(this))(); 407 ptrcall!(void)(_classBinding.addPolygon, _godot_object, polygon); 408 } 409 /** 410 411 */ 412 long getPolygonCount() const 413 { 414 checkClassBinding!(typeof(this))(); 415 return ptrcall!(long)(_classBinding.getPolygonCount, _godot_object); 416 } 417 /** 418 419 */ 420 PoolIntArray getPolygon(in long idx) 421 { 422 checkClassBinding!(typeof(this))(); 423 return ptrcall!(PoolIntArray)(_classBinding.getPolygon, _godot_object, idx); 424 } 425 /** 426 427 */ 428 void clearPolygons() 429 { 430 checkClassBinding!(typeof(this))(); 431 ptrcall!(void)(_classBinding.clearPolygons, _godot_object); 432 } 433 /** 434 435 */ 436 void createFromMesh(Mesh mesh) 437 { 438 checkClassBinding!(typeof(this))(); 439 ptrcall!(void)(_classBinding.createFromMesh, _godot_object, mesh); 440 } 441 /** 442 443 */ 444 void _setPolygons(in Array polygons) 445 { 446 Array _GODOT_args = Array.empty_array; 447 _GODOT_args.append(polygons); 448 String _GODOT_method_name = String("_set_polygons"); 449 this.callv(_GODOT_method_name, _GODOT_args); 450 } 451 /** 452 453 */ 454 Array _getPolygons() const 455 { 456 Array _GODOT_args = Array.empty_array; 457 String _GODOT_method_name = String("_get_polygons"); 458 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!Array); 459 } 460 /** 461 462 */ 463 @property PoolVector3Array vertices() 464 { 465 return getVertices(); 466 } 467 /// ditto 468 @property void vertices(PoolVector3Array v) 469 { 470 setVertices(v); 471 } 472 /** 473 474 */ 475 @property Array polygons() 476 { 477 return _getPolygons(); 478 } 479 /// ditto 480 @property void polygons(Array v) 481 { 482 _setPolygons(v); 483 } 484 /** 485 486 */ 487 @property long samplePartitionTypeSamplePartitionType() 488 { 489 return getSamplePartitionType(); 490 } 491 /// ditto 492 @property void samplePartitionTypeSamplePartitionType(long v) 493 { 494 setSamplePartitionType(v); 495 } 496 /** 497 498 */ 499 @property double cellSize() 500 { 501 return getCellSize(); 502 } 503 /// ditto 504 @property void cellSize(double v) 505 { 506 setCellSize(v); 507 } 508 /** 509 510 */ 511 @property double cellHeight() 512 { 513 return getCellHeight(); 514 } 515 /// ditto 516 @property void cellHeight(double v) 517 { 518 setCellHeight(v); 519 } 520 /** 521 522 */ 523 @property double agentHeight() 524 { 525 return getAgentHeight(); 526 } 527 /// ditto 528 @property void agentHeight(double v) 529 { 530 setAgentHeight(v); 531 } 532 /** 533 534 */ 535 @property double agentRadius() 536 { 537 return getAgentRadius(); 538 } 539 /// ditto 540 @property void agentRadius(double v) 541 { 542 setAgentRadius(v); 543 } 544 /** 545 546 */ 547 @property double agentMaxClimb() 548 { 549 return getAgentMaxClimb(); 550 } 551 /// ditto 552 @property void agentMaxClimb(double v) 553 { 554 setAgentMaxClimb(v); 555 } 556 /** 557 558 */ 559 @property double agentMaxSlope() 560 { 561 return getAgentMaxSlope(); 562 } 563 /// ditto 564 @property void agentMaxSlope(double v) 565 { 566 setAgentMaxSlope(v); 567 } 568 /** 569 570 */ 571 @property double regionMinSize() 572 { 573 return getRegionMinSize(); 574 } 575 /// ditto 576 @property void regionMinSize(double v) 577 { 578 setRegionMinSize(v); 579 } 580 /** 581 582 */ 583 @property double regionMergeSize() 584 { 585 return getRegionMergeSize(); 586 } 587 /// ditto 588 @property void regionMergeSize(double v) 589 { 590 setRegionMergeSize(v); 591 } 592 /** 593 594 */ 595 @property double edgeMaxLength() 596 { 597 return getEdgeMaxLength(); 598 } 599 /// ditto 600 @property void edgeMaxLength(double v) 601 { 602 setEdgeMaxLength(v); 603 } 604 /** 605 606 */ 607 @property double edgeMaxError() 608 { 609 return getEdgeMaxError(); 610 } 611 /// ditto 612 @property void edgeMaxError(double v) 613 { 614 setEdgeMaxError(v); 615 } 616 /** 617 618 */ 619 @property double polygonVertsPerPoly() 620 { 621 return getVertsPerPoly(); 622 } 623 /// ditto 624 @property void polygonVertsPerPoly(double v) 625 { 626 setVertsPerPoly(v); 627 } 628 /** 629 630 */ 631 @property double detailSampleDistance() 632 { 633 return getDetailSampleDistance(); 634 } 635 /// ditto 636 @property void detailSampleDistance(double v) 637 { 638 setDetailSampleDistance(v); 639 } 640 /** 641 642 */ 643 @property double detailSampleMaxError() 644 { 645 return getDetailSampleMaxError(); 646 } 647 /// ditto 648 @property void detailSampleMaxError(double v) 649 { 650 setDetailSampleMaxError(v); 651 } 652 /** 653 654 */ 655 @property bool filterLowHangingObstacles() 656 { 657 return getFilterLowHangingObstacles(); 658 } 659 /// ditto 660 @property void filterLowHangingObstacles(bool v) 661 { 662 setFilterLowHangingObstacles(v); 663 } 664 /** 665 666 */ 667 @property bool filterLedgeSpans() 668 { 669 return getFilterLedgeSpans(); 670 } 671 /// ditto 672 @property void filterLedgeSpans(bool v) 673 { 674 setFilterLedgeSpans(v); 675 } 676 /** 677 678 */ 679 @property bool filterFilterWalkableLowHeightSpans() 680 { 681 return getFilterWalkableLowHeightSpans(); 682 } 683 /// ditto 684 @property void filterFilterWalkableLowHeightSpans(bool v) 685 { 686 setFilterWalkableLowHeightSpans(v); 687 } 688 }