1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: Castle3D: Class T3D</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<a name="T3D"></a><h1 class="cio">Class T3D</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></td><td>Fields</td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td><a class="section" href="#PasDoc-Properties">Properties</a></td></tr></table>
<a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="Castle3D.html">Castle3D</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type T3D = class(TComponent)</code></p>
<h2 class="description">Description</h2>
<p>
Base 3D object, that can be managed by <a class="normal" href="CastleSceneManager.TCastleSceneManager.html">TCastleSceneManager</a>. All 3D objects should descend from this, this way we can easily insert them into the <a class="normal" href="CastleSceneManager.TCastleSceneManager.html">TCastleSceneManager</a>.
<p>Default implementations of collision methods in this class work with our <a class="normal" href="Castle3D.T3D.html#BoundingBox">BoundingBox</a>:
<p></p>
<ul class="paragraph_spacing">
<li><p>Wall-sliding <a class="normal" href="Castle3D.T3D.html#MoveCollision">MoveCollision</a> version simply calls non-wall-sliding version (without separate ProposedNewPos and NewPos).</p></li>
<li><p>Non-wall-sliding <a class="normal" href="Castle3D.T3D.html#MoveCollision">MoveCollision</a> version, <a class="normal" href="Castle3D.T3D.html#SegmentCollision">SegmentCollision</a>, <a class="normal" href="Castle3D.T3D.html#SphereCollision">SphereCollision</a>, <a class="normal" href="Castle3D.T3D.html#BoxCollision">BoxCollision</a> and <a class="normal" href="Castle3D.T3D.html#RayCollision">RayCollision</a> and <a class="normal" href="Castle3D.T3D.html#HeightCollision">HeightCollision</a> check for collisions with our <a class="normal" href="Castle3D.T3D.html#BoundingBox">BoundingBox</a>, using <a class="normal" href="CastleBoxes.TBox3D.html">TBox3D</a> methods: <a class="normal" href="CastleBoxes.TBox3D.html#TryRayClosestIntersection">TBox3D.TryRayClosestIntersection</a>, <a class="normal" href="CastleBoxes.TBox3D.html#TryRayEntrance">TBox3D.TryRayEntrance</a>, <a class="normal" href="CastleBoxes.TBox3D.html#SegmentCollision">TBox3D.SegmentCollision</a>, <a class="normal" href="CastleBoxes.TBox3D.html#SphereCollision">TBox3D.SphereCollision</a> and <a class="normal" href="CastleBoxes.TBox3D.html#Collision">TBox3D.Collision</a>.</p></li>
</ul>
<p>
<p>The idea is that by default everything simply uses <a class="normal" href="Castle3D.T3D.html#BoundingBox">BoundingBox</a>, and that is the only method that you really <i>have</i> to override. You do not have to (in fact, usually you should not) call "inherited" when overriding collision methods mentioned above.</p>
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TComponent</li>
<li class="thisitem">T3D</li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Methods"></a><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#CursorChange">CursorChange</a></b>; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#HeightCollision">HeightCollision</a></b>(const Position, GravityUp: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>; out AboveHeight: Single; out AboveGround: <a href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#MoveCollision">MoveCollision</a></b>( const OldPos, ProposedNewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#MoveCollision">MoveCollision</a></b>( const OldPos, NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#SegmentCollision">SegmentCollision</a></b>(const Pos1, Pos2: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>; const ALineOfSight: boolean): boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#SphereCollision">SphereCollision</a></b>(const Pos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const Radius: Single; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#BoxCollision">BoxCollision</a></b>(const Box: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#RayCollision">RayCollision</a></b>(const RayOrigin, RayDirection: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a href="Castle3D.TRayCollision.html">TRayCollision</a>; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>constructor <b><a href="Castle3D.T3D.html#Create">Create</a></b>(AOwner: TComponent); override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>destructor <b><a href="Castle3D.T3D.html#Destroy">Destroy</a></b>; override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#GetExists">GetExists</a></b>: boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#GetCollides">GetCollides</a></b>: boolean; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#GetPickable">GetPickable</a></b>: boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#Disable">Disable</a></b>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#Enable">Enable</a></b>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#BoundingBox">BoundingBox</a></b>: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; virtual; abstract;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#Render">Render</a></b>(const Frustum: <a href="CastleFrustum.TFrustum.html">TFrustum</a>; const Params: <a href="Castle3D.TRenderParams.html">TRenderParams</a>); virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#RenderShadowVolume">RenderShadowVolume</a></b>( ShadowVolumeRenderer: <a href="Castle3D.TBaseShadowVolumeRenderer.html">TBaseShadowVolumeRenderer</a>; const ParentTransformIsIdentity: boolean; const ParentTransform: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>); virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#PrepareResources">PrepareResources</a></b>( Options: <a href="Castle3D.html#TPrepareResourcesOptions">TPrepareResourcesOptions</a>; ProgressStep: boolean; BaseLights: <a href="Castle3D.html#TAbstractLightInstancesList">TAbstractLightInstancesList</a>); virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#PrepareResourcesSteps">PrepareResourcesSteps</a></b>: Cardinal; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Press">Press</a></b>(const Event: <a href="CastleKeysMouse.TInputPressRelease.html">TInputPressRelease</a>): boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Release">Release</a></b>(const Event: <a href="CastleKeysMouse.TInputPressRelease.html">TInputPressRelease</a>): boolean; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#PointingDeviceActivate">PointingDeviceActivate</a></b>(const Active: boolean; const Distance: Single): boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#PointingDeviceMove">PointingDeviceMove</a></b>(const Pick: <a href="Castle3D.TRayCollisionNode.html">TRayCollisionNode</a>; const Distance: Single): boolean; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#Update">Update</a></b>(const SecondsPassed: Single; var RemoveMe: <a href="Castle3D.html#TRemoveType">TRemoveType</a>); virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#VisibleChangeHere">VisibleChangeHere</a></b>(const Changes: <a href="Castle3D.html#TVisibleChanges">TVisibleChanges</a>); virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#World">World</a></b>: <a href="Castle3D.T3DWorld.html">T3DWorld</a>; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#VisibleChangeNotification">VisibleChangeNotification</a></b>(const Changes: <a href="Castle3D.html#TVisibleChanges">TVisibleChanges</a>); virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#GLContextClose">GLContextClose</a></b>; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#UpdateGeneratedTextures">UpdateGeneratedTextures</a></b>( const RenderFunc: <a href="Castle3D.html#TRenderFromViewFunction">TRenderFromViewFunction</a>; const ProjectionNear, ProjectionFar: Single; const OriginalViewport: <a href="CastleRectangles.TRectangle.html">TRectangle</a>); virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Dragging">Dragging</a></b>: boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3D.html#Translate">Translate</a></b>(const T: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>); virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Middle">Middle</a></b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Sector">Sector</a></b>: <a href="CastleSectors.TSector.html">TSector</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Sphere">Sphere</a></b>(out Radius: Single): boolean; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Height">Height</a></b>(const MyPosition: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out AboveHeight: Single): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Height">Height</a></b>(const MyPosition: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out AboveHeight: Single; out AboveGround: <a href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#LineOfSight">LineOfSight</a></b>(const Pos1, Pos2: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#MoveAllowed">MoveAllowed</a></b>(const OldPos, ProposedNewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const BecauseOfGravity: boolean): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#MoveAllowed">MoveAllowed</a></b>(const OldPos, NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const BecauseOfGravity: boolean): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Move">Move</a></b>(const Translation: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const BecauseOfGravity: boolean; const EnableWallSliding: boolean = true): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Ray">Ray</a></b>(const RayOrigin, RayDirection: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a href="Castle3D.TRayCollision.html">TRayCollision</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3D.html#Shared">Shared</a></b>: <a href="Castle3D.T3D.html">T3D</a>; virtual;</code></td>
</tr>
</table>
<a name="PasDoc-Properties"></a><h3 class="summary">Properties</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3D.html#Exists">Exists</a></b>: boolean read FExists write FExists default true;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3D.html#Collides">Collides</a></b>: boolean read FCollides write FCollides default true;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3D.html#Pickable">Pickable</a></b>: boolean read FPickable write FPickable default true;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3D.html#CastShadowVolumes">CastShadowVolumes</a></b>: boolean
read FCastShadowVolumes write FCastShadowVolumes default true;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3D.html#Parent">Parent</a></b>: <a href="Castle3D.T3DList.html">T3DList</a> read FParent;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3D.html#Cursor">Cursor</a></b>: <a href="CastleKeysMouse.html#TMouseCursor">TMouseCursor</a> read FCursor write SetCursor default mcDefault;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3D.html#CollidesWithMoving">CollidesWithMoving</a></b>: boolean read FCollidesWithMoving write FCollidesWithMoving default false;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3D.html#ExcludeFromGlobalLights">ExcludeFromGlobalLights</a></b>: boolean
read FExcludeFromGlobalLights write FExcludeFromGlobalLights default false;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="CursorChange"></a><code>procedure <b>CursorChange</b>; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
In <a class="normal" href="Castle3D.T3D.html">T3D</a> class, just calls Parent.CursorChange.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="HeightCollision"></a><code>function <b>HeightCollision</b>(const Position, GravityUp: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>; out AboveHeight: Single; out AboveGround: <a href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Height of a point above the 3D model. This checks ray collision, from Position along the negated GravityUp vector. Measures distance to the nearest scene item (called "ground" here).
<p>
<p>
<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>AboveHeight</dt>
<dd>Height above the ground. <i>One height unit equals one GravityUp vector</i>. Always use normalized GravityUp vector if you expect to receive here a normal distance.
<p>AboveHeight is always set to <a class="normal" href="Castle3D.html#MaxSingle">MaxSingle</a> when returned result is <code>False</code> (this guarantee simplifies some code).</dd>
<dt>AboveGround</dt>
<dd>Pointer to <a class="normal" href="CastleTriangles.html#P3DTriangle">P3DTriangle</a> representing the ground. Must be <code>Nil</code> if returned result is <code>False</code>. <b>May</b> be <code>Nil</code> even if we returned <code>True</code> (not all 3D objects may be able to generate <a class="normal" href="CastleTriangles.html#P3DTriangle">P3DTriangle</a> information about collision).
<p>This may be useful for example to make a footsteps sound dependent on texture of the ground. Or to decrease player life points for walking on hot lava. See "The Castle" game for examples.</dd>
</dl>
<h6 class="description_section">Returns</h6>
<p class="return">If the 3D scene is hit. <code>False</code> means that Position floats above an empty space. That is, if you turn gravity on, it will fall down forever, as far as this 3D scene is concerned.</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="MoveCollision"></a><code>function <b>MoveCollision</b>( const OldPos, ProposedNewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Can other 3D object (maybe a player) move without colliding with this object.
<p>If IsRadius, then you should prefer to perform exact collision with sphere of given radius (must be > 0). At the very least, this checks that the line segment between OldPos and NewPos doesn't collide, <b>and</b> that sphere with given Radius centered around NewPos doesn't collide.
<p>If not IsRadius, or if checking for collisions with sphere is not possible for some reasons, then you can check for collisions with boxes. OldBox should usually be ignored (it can be useful when collision-checking has to be approximate in some corner cases, see TCreature.MoveCollision). NewBox plays the same role as "sphere centered around NewPos" in paragraph above.
<p>Overloaded version with separate ProposedNewPos and NewPos parameters allows you to accept the move, but for NewPos (that should be some slightly modified version of ProposedNewPos). This allows to implement wall-sliding: when camera tries to walk into the wall, we will change movement to move alongside the wall (instead of just completely blocking the move). When this version returns <code>False</code>, it's undefined what is the NewPos.
<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="MoveCollision"></a><code>function <b>MoveCollision</b>( const OldPos, NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="SegmentCollision"></a><code>function <b>SegmentCollision</b>(const Pos1, Pos2: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>; const ALineOfSight: boolean): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="SphereCollision"></a><code>function <b>SphereCollision</b>(const Pos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const Radius: Single; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="BoxCollision"></a><code>function <b>BoxCollision</b>(const Box: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="RayCollision"></a><code>function <b>RayCollision</b>(const RayOrigin, RayDirection: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a href="Castle3D.TRayCollision.html">TRayCollision</a>; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Check collision with a ray, building a <a class="normal" href="Castle3D.TRayCollision.html">TRayCollision</a> result. Returns a collision as <a class="normal" href="Castle3D.TRayCollision.html">TRayCollision</a> instance, or <code>Nil</code> if no collision. Caller is responsible for freeing the returned <a class="normal" href="Castle3D.TRayCollision.html">TRayCollision</a> instance.
<p>Contrary to other collision routines, this should <i>ignore the <a class="normal" href="Castle3D.T3D.html#Collides">Collides</a> property</i>. The <a class="normal" href="Castle3D.T3D.html#Collides">Collides</a> property specifies whether item collides with camera. And this method is used for picking (pointing) 3D stuff — everything visible can be picked, collidable or not. Instead, this looks at <a class="normal" href="Castle3D.T3D.html#Pickable">Pickable</a> property (actually, at <a class="normal" href="Castle3D.T3D.html#GetPickable">GetPickable</a> method result).
<p>This always returns the first collision with the 3D world, that is the one with smallest <a class="normal" href="Castle3D.TRayCollision.html#Distance">TRayCollision.Distance</a>. For example, when implemented in <a class="normal" href="Castle3D.T3DList.html">T3DList</a>, this checks collisions for all list items, and chooses the closest one.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Create"></a><code>constructor <b>Create</b>(AOwner: TComponent); override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Destroy"></a><code>destructor <b>Destroy</b>; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="GetExists"></a><code>function <b>GetExists</b>: boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Does item really exist, see <a class="normal" href="Castle3D.T3D.html#Exists">Exists</a> and <a class="normal" href="Castle3D.T3D.html#Enable">Enable</a>, <a class="normal" href="Castle3D.T3D.html#Disable">Disable</a>. It <a class="normal" href="Castle3D.T3D.html">T3D</a> class, returns <code>True</code> if <a class="normal" href="Castle3D.T3D.html#Exists">Exists</a> and not disabled. May be modified in subclasses, to return something more complicated.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="GetCollides"></a><code>function <b>GetCollides</b>: boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Does item really collide, see <a class="normal" href="Castle3D.T3D.html#Collides">Collides</a>. It <a class="normal" href="Castle3D.T3D.html">T3D</a> class, returns <a class="normal" href="Castle3D.T3D.html#Collides">Collides</a> and <a class="normal" href="Castle3D.T3D.html#GetExists">GetExists</a>. May be modified in subclasses, to return something more complicated.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="GetPickable"></a><code>function <b>GetPickable</b>: boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Is item really pickable, see <a class="normal" href="Castle3D.T3D.html#Pickable">Pickable</a>. It <a class="normal" href="Castle3D.T3D.html">T3D</a> class, returns <a class="normal" href="Castle3D.T3D.html#Pickable">Pickable</a> and <a class="normal" href="Castle3D.T3D.html#GetExists">GetExists</a>. May be modified in subclasses, to return something more complicated.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Disable"></a><code>procedure <b>Disable</b>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Items that are at least once disabled are treated like not existing. Every <a class="normal" href="Castle3D.T3D.html#Disable">Disable</a> call should always be paired with <a class="normal" href="Castle3D.T3D.html#Enable">Enable</a> call (usually using <code>try ... finally .... end</code> block). Internally, we keep a counter of how many times the object is disabled, and if this counter is <> 0 then <a class="normal" href="Castle3D.T3D.html#GetExists">GetExists</a> returns <code>False</code>. Using this is useful for taming collisions, especially to avoid self-collisions (when a creature moves, it doesn't want to collide with other creatures, but obviously it doesn't collide with it's own bounding volume). </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Enable"></a><code>procedure <b>Enable</b>;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="BoundingBox"></a><code>function <b>BoundingBox</b>: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
<p>
Bounding box of the 3D object.
<p>Should take into account both collidable and visible objects. For examples, invisible walls (not visible) and fake walls (not collidable) should all be accounted here.
<p>As it's a <i>bounding</i> volume, it may naturally be slightly too large (although, for the same of various optimizations, you should try to make it as tight as reasonably possible.) For now, it's also OK to make it a little too small (nothing bad will happen). Although all currently implemented descendants (<a class="normal" href="CastleSceneCore.TCastleSceneCore.html">TCastleSceneCore</a>, <a class="normal" href="CastlePrecalculatedAnimationCore.TCastlePrecalculatedAnimationCore.html">TCastlePrecalculatedAnimationCore</a>, more) guarantee it's never too small.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Render"></a><code>procedure <b>Render</b>(const Frustum: <a href="CastleFrustum.TFrustum.html">TFrustum</a>; const Params: <a href="Castle3D.TRenderParams.html">TRenderParams</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Render given object. Should check and immediately exit when <a class="normal" href="Castle3D.T3D.html#Exists">Exists</a> is <code>False</code>. Should render only parts with matching Params.Transparency and Params.ShadowVolumesReceivers values (it may be called more than once to render frame).
<p>
<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>Frustum</dt>
<dd>May be used to optimize rendering, to not render the parts outside the Frustum.</dd>
<dt>Params</dt>
<dd>Other parameters helpful for rendering.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="RenderShadowVolume"></a><code>procedure <b>RenderShadowVolume</b>( ShadowVolumeRenderer: <a href="Castle3D.TBaseShadowVolumeRenderer.html">TBaseShadowVolumeRenderer</a>; const ParentTransformIsIdentity: boolean; const ParentTransform: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Render shadow quads for all the things rendered by <a class="normal" href="Castle3D.T3D.html#Render">Render</a>. This is done only if <a class="normal" href="Castle3D.T3D.html#Exists">Exists</a> and <a class="normal" href="Castle3D.T3D.html#CastShadowVolumes">CastShadowVolumes</a>.
<p>It does shadow volumes culling inside (so ShadowVolumeRenderer should have FrustumCullingInit already initialized).
<p>ParentTransform and ParentTransformIsIdentity describe the transformation of this object in the 3D world. <a class="normal" href="Castle3D.T3D.html">T3D</a> objects may be organized in a hierarchy when parent transforms it's children. When ParentTransformIsIdentity, ParentTransform must be <a class="normal" href="CastleVectors.html#IdentityMatrix4Single">IdentityMatrix4Single</a> (it's not guaranteed that when ParentTransformIsIdentity = <code>True</code>, Transform value will be ignored !).
<p><i>Implementation note:</i> In <a class="normal" href="Castle3D.T3D.html#Render">Render</a>, it is usually possible to implement ParentTransform* by glPush/PopMatrix and Frustum.Move tricks. But <code>RenderShadowVolume</code> needs actual transformation explicitly: ShadowMaybeVisible needs actual box position in world coordinates, so bounding box has to be transformed by ParentTransform. And TCastleScene.RenderShadowVolumeCore needs explicit ParentTransform to correctly detect front/back sides (for silhouette edges and volume capping).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrepareResources"></a><code>procedure <b>PrepareResources</b>( Options: <a href="Castle3D.html#TPrepareResourcesOptions">TPrepareResourcesOptions</a>; ProgressStep: boolean; BaseLights: <a href="Castle3D.html#TAbstractLightInstancesList">TAbstractLightInstancesList</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Prepare resources, making various methods (like rendering and such) to execute fast.
<p>This requires OpenGL to be initailized for most 3D objects. If not, some parts of preparations will be aborted.
<p>This makes sure that appropriate methods execute as fast as possible. It's never required to call this method — everything will be prepared "as needed" anyway. But if you allow everything to be prepared "as needed", then e.g. the first <a class="normal" href="Castle3D.T3D.html#Render">Render</a> call may take a long time because it may have to prepare resources that will be reused in next <a class="normal" href="Castle3D.T3D.html#Render">Render</a> calls. This is bad, as your program will seem very slow at the beginning (when rendering resources are prepared, so a first frame, or a couple of first frames, if it's something like a precalculated animation). To avoid this, call this method, showing the user something like "now we're preparing the resources — please wait".
<p>For OpenGL rendered objects, this method ties this object to the current OpenGL context. But it doesn't change any OpenGL state or buffers contents (at most, it allocates some texture and display list names).
<p>
<p>
<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>Options</dt>
<dd>What features should be prepared to execute fast. See <a class="normal" href="Castle3D.html#TPrepareResourcesOption">TPrepareResourcesOption</a>, the names should be self-explanatory (they refer to appropriate methods of <a class="normal" href="Castle3D.T3D.html">T3D</a>, <a class="normal" href="CastleSceneCore.TCastleSceneCore.html">TCastleSceneCore</a> or <a class="normal" href="CastleScene.TCastleScene.html">TCastleScene</a>).</dd>
<dt>ProgressStep</dt>
<dd>Says that we should make this many Progress.Step calls during preparation. Useful to show progress bar to the user during long preparation.
<p>TODO: for now, do not include prSpatial if you use ProgressStep. Reason: octree preparations have a separate mechanism that may want to show progress.</dd>
<dt>BaseLights</dt>
<dd>Used if Options contains <a class="normal" href="CastleScene.html#prRender">prRender</a>. A list of base lights (always <a class="normal" href="X3DNodes.TLightInstancesList.html">TLightInstancesList</a>, although cannot be declated as such) used for rendering. May be <code>Nil</code> (equivalent to empty).</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrepareResourcesSteps"></a><code>function <b>PrepareResourcesSteps</b>: Cardinal; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
How many times <a class="normal" href="Castle3D.T3D.html#PrepareResources">PrepareResources</a> will call Progress.Step. Useful only if you want to pass ProgressStep = <code>True</code> to <a class="normal" href="Castle3D.T3D.html#PrepareResources">PrepareResources</a>. In the base class <a class="normal" href="Castle3D.T3D.html">T3D</a> this just returns 0.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Press"></a><code>function <b>Press</b>(const Event: <a href="CastleKeysMouse.TInputPressRelease.html">TInputPressRelease</a>): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Press and release events of key and mouse. Return <code>True</code> if you handled them. See also <a class="normal" href="CastleUIControls.TUIControl.html">TUIControl</a> analogous events. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Release"></a><code>function <b>Release</b>(const Event: <a href="CastleKeysMouse.TInputPressRelease.html">TInputPressRelease</a>): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PointingDeviceActivate"></a><code>function <b>PointingDeviceActivate</b>(const Active: boolean; const Distance: Single): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Pointing device (usually mouse) events. Return <code>True</code> if you handled the event.
<p></p>
<ul class="paragraph_spacing">
<li><p><code>PointingDeviceActivate</code> signals that the picking button (usually, left mouse button) is pressed or released (depending on Active parameter).
<p>Note that the exact key or mouse responsible for this is configurable in our engine by <a class="normal" href="CastleSceneManager.html#Input_Interact">Input_Interact</a>. By default it's the left mouse button, as is usual for VRML/X3D browsers. But it can be configured to be other mouse button or a key, for example most 3D games use "e" key to interact.</p></li>
<li><p><a class="normal" href="Castle3D.T3D.html#PointingDeviceMove">PointingDeviceMove</a> signals that pointer moves over this 3D object.</p></li>
</ul>
<p>
<p><a class="normal" href="Castle3D.T3D.html#PointingDeviceMove">PointingDeviceMove</a> receives Pick information about what exactly is hit by the 3D ray corresponding to the current mouse position. It contains the detailed information about 3D point, triangle and ray (all in local coordinate system) that are indicated by the mouse. <code>PointingDeviceActivate</code> does not receive this information now (because it may happen in obscure situations when ray direction is not known; this is all related to our "fallback to MainScene" mechanism).
<p>They also receive Distance to the collision, in world coordinates. See <a class="normal" href="Castle3D.TRayCollision.html#Distance">TRayCollision.Distance</a>.
<p>The pointing device event (activation, deactivation or move) is send first to the innermost 3D object. That is, we first send this event to the first item on <a class="normal" href="Castle3D.TRayCollision.html">TRayCollision</a> list corresponding to the current ray. This way, the innermost ("most local") 3D object has the chance to handle this event first. If the event is not handled, it is passed to other 3D objects (we simply iterate over the <a class="normal" href="Castle3D.TRayCollision.html">TRayCollision</a> list). If nothing on <a class="normal" href="Castle3D.TRayCollision.html">TRayCollision</a> list handled the item, it is eventually passed to main 3D scene (<a class="normal" href="CastleSceneManager.TCastleSceneManager.html#MainScene">TCastleSceneManager.MainScene</a>), if it wasn't already present on <a class="normal" href="Castle3D.TRayCollision.html">TRayCollision</a> list.
<p>Note that when passing this event to <a class="normal" href="CastleSceneManager.TCastleSceneManager.html#MainScene">TCastleSceneManager.MainScene</a>, it is possible that 3D ray simply didn't hit anything (mouse pointer is over the background). In this case, <a class="normal" href="Castle3D.TRayCollisionNode.html#Point">TRayCollisionNode.Point</a> is undefined, <a class="normal" href="Castle3D.TRayCollisionNode.html#Triangle">TRayCollisionNode.Triangle</a> is <code>Nil</code> and Distance is <a class="normal" href="Castle3D.html#MaxSingle">MaxSingle</a>.
<p>This event should be handled only if <a class="normal" href="Castle3D.T3D.html#GetExists">GetExists</a>. Usually, 3D objects with <a class="normal" href="Castle3D.T3D.html#GetExists">GetExists</a> = <code>False</code> will not be returned by <a class="normal" href="Castle3D.T3D.html#RayCollision">RayCollision</a>, so they will not receive this event anyway. However, if 3D object may be equal to <a class="normal" href="CastleSceneManager.TCastleSceneManager.html#MainScene">TCastleSceneManager.MainScene</a>, then it should be secured and check for <a class="normal" href="Castle3D.T3D.html#GetExists">GetExists</a> inside <code>PointingDeviceActivate</code> and <a class="normal" href="Castle3D.T3D.html#PointingDeviceMove">PointingDeviceMove</a>.
<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PointingDeviceMove"></a><code>function <b>PointingDeviceMove</b>(const Pick: <a href="Castle3D.TRayCollisionNode.html">TRayCollisionNode</a>; const Distance: Single): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Update"></a><code>procedure <b>Update</b>(const SecondsPassed: Single; var RemoveMe: <a href="Castle3D.html#TRemoveType">TRemoveType</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Continously occuring event, for various tasks. </p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>RemoveMe</dt>
<dd>Set this to rtRemove or rtRemoveAndFree to remove this item from 3D world (parent list) after Update finished. rtRemoveAndFree additionally will free this item. Initially it's rtNone when this method is called.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="VisibleChangeHere"></a><code>procedure <b>VisibleChangeHere</b>(const Changes: <a href="Castle3D.html#TVisibleChanges">TVisibleChanges</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Something visible changed inside <i>this</i> 3D object. This is usually called by implementation of this 3D object, to notify others that it changed.
<p>Changes is a set describing what changes occurred. It can be [], meaning "something else", we'll still broadcast <a class="normal" href="Castle3D.T3D.html#VisibleChangeNotification">VisibleChangeNotification</a> then. See <a class="normal" href="Castle3D.html#TVisibleChange">TVisibleChange</a> docs for possible values. It must specify all things that possibly changed.
<p>The information about visibility changed is passed upward, to the Parent, and eventually to the <a class="normal" href="CastleSceneManager.TCastleSceneManager.html">TCastleSceneManager</a>, that broadcasts this to all 3D objects by <a class="normal" href="Castle3D.T3D.html#VisibleChangeNotification">VisibleChangeNotification</a>. If you want to <i>react</i> to visibility changes, you should override <a class="normal" href="Castle3D.T3D.html#VisibleChangeNotification">VisibleChangeNotification</a>, not this method.
<p>Be careful when handling this, various changes may cause this, so be prepared to handle this at every time.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="World"></a><code>function <b>World</b>: <a href="Castle3D.T3DWorld.html">T3DWorld</a>; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
World containing this 3D object. In other words, the root of 3D objects tree containing this object. <code>Nil</code> if we are not part of a hierarchy rooted in <a class="normal" href="Castle3D.T3DWorld.html">T3DWorld</a>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="VisibleChangeNotification"></a><code>procedure <b>VisibleChangeNotification</b>(const Changes: <a href="Castle3D.html#TVisibleChanges">TVisibleChanges</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Something visible changed in the 3D world. This is usually called by our container (like <a class="normal" href="CastleSceneManager.TCastleSceneManager.html">TCastleSceneManager</a>), to allow this 3D object to react (e.g. by regenerating mirror textures) to changes in the 3D world (not necessarily in this 3D object, maybe in some other <a class="normal" href="Castle3D.T3D.html">T3D</a> instance).
<p>If you want to <i>react</i> to visibility changes, you should override this.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="GLContextClose"></a><code>procedure <b>GLContextClose</b>; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Called when OpenGL context of the window is destroyed. This will be also automatically called from destructor.
<p>Control should clear here any resources that are tied to the GL context.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="UpdateGeneratedTextures"></a><code>procedure <b>UpdateGeneratedTextures</b>( const RenderFunc: <a href="Castle3D.html#TRenderFromViewFunction">TRenderFromViewFunction</a>; const ProjectionNear, ProjectionFar: Single; const OriginalViewport: <a href="CastleRectangles.TRectangle.html">TRectangle</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Dragging"></a><code>function <b>Dragging</b>: boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Are we in the middle of dragging something by moving the mouse.
<p>This should be set to <code>True</code> to disable camera navigation methods that also use mouse move. In practice, to disable <a class="normal" href="CastleCameras.TExamineCamera.html">TExamineCamera</a> view rotation/movement by moving the mouse, as it makes (comfortable) dragging practically impossible (at each mouse move, view changes...).
<p>In particular, when you operate on active X3D pointing-device sensors (like drag sensors, e.g. PlaneSensor, but also TouchSensor may use it).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Translate"></a><code>procedure <b>Translate</b>(const T: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Unconditionally move this 3D object by given vector. You usually don't want to use this directly, instead use <a class="normal" href="Castle3D.T3D.html#Move">Move</a> method to move checking collisions (and with optional wall sliding).
<p>By default, in <a class="normal" href="Castle3D.T3D.html">T3D</a> class, this does nothing, because the bare <a class="normal" href="Castle3D.T3D.html">T3D</a> class doesn't know how to move itself. But descendants like <a class="normal" href="Castle3D.T3DTransform.html">T3DTransform</a> and <a class="normal" href="Castle3D.T3DOrient.html">T3DOrient</a> (and their descendants like <a class="normal" href="CastlePlayer.TPlayer.html">TPlayer</a>, <a class="normal" href="CastleCreatures.TCreature.html">TCreature</a>, <a class="normal" href="CastleItems.TItemOnWorld.html">TItemOnWorld</a>) override this and can be moved using this.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Middle"></a><code>function <b>Middle</b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Middle point, usually "eye point", of the 3D model. This is used for sphere center (if overriden Sphere returns <code>True</code>) and is the central point from which collisions of this object are checked (Move, <a class="normal" href="Castle3D.T3D.html#MoveAllowed">MoveAllowed</a>, Height, <a class="normal" href="Castle3D.T3D.html#LineOfSight">LineOfSight</a>). For 3D things like level scene this is mostly useless (as you will leave Sphere at default <code>False</code> then, and the scene itself doesn't move), but it's crucial for dynamic 3D things like player and moving creatures.
<p>In short, it's usually most comfortable to think about this as a position of the eye, or the middle of the creature's head.
<p>In an ideal situation, it should not be based on anything dynamic. For example, when this is based on the current bounding box of the animation, there is a risk that a large and sudden change in animation box could make the Middle point to jump to the other side of the wall (breaking collisions, as it changes Middle without a chance to check for collisions by <a class="normal" href="Castle3D.T3D.html#MoveAllowed">MoveAllowed</a>). Ideally, it should remain constant even when the shape of the object changes, and be possible to change only when <a class="normal" href="Castle3D.T3D.html#MoveAllowed">MoveAllowed</a> is checked (so only when <a class="normal" href="Castle3D.T3DOrient.html#Position">T3DOrient.Position</a> or <a class="normal" href="Castle3D.T3DTransform.html#Translation">T3DTransform.Translation</a> can change).
<p>In this class this is simply zero. In the descendant <a class="normal" href="Castle3D.T3DCustomTransform.html">T3DCustomTransform</a> (ancestor of <a class="normal" href="Castle3D.T3DTransform.html">T3DTransform</a>, <a class="normal" href="Castle3D.T3DOrient.html">T3DOrient</a> that in turn are ancestors of normal creatures, items etc.) this is overriden to return something sensible above the bottom of the box. See <a class="normal" href="Castle3D.T3DCustomTransform.html#MiddleHeight">T3DCustomTransform.MiddleHeight</a>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Sector"></a><code>function <b>Sector</b>: <a href="CastleSectors.TSector.html">TSector</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Sector where the middle of this 3D object is. Used for AI. <code>Nil</code> if none (maybe because we're not part of any world, maybe because sectors of the world were not initialized, or maybe simply because we're outside of all sectors).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Sphere"></a><code>function <b>Sphere</b>(out Radius: Single): boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Can the approximate sphere (around Middle point) be used for some collision-detection tasks. If <code>True</code> then Radius (and Middle point) determine the approximate sphere surrounding the 3D object (it does not have to be a perfect bounding sphere around the object), and it may be used for some collisions instead of <a class="normal" href="Castle3D.T3D.html#BoundingBox">BoundingBox</a>. See <a class="normal" href="Castle3D.T3D.html#CollidesWithMoving">CollidesWithMoving</a> and <a class="normal" href="Castle3D.T3D.html#MoveAllowed">MoveAllowed</a> for when it may happen.
<p>Must return <code>False</code> when not <a class="normal" href="Castle3D.T3D.html#GetExists">GetExists</a> (because we can't express "empty sphere" by <a class="normal" href="Castle3D.T3D.html#Sphere">Sphere</a> method for now, but <a class="normal" href="Castle3D.T3D.html#BoundingBox">BoundingBox</a> can express <a class="normal" href="CastleBoxes.html#EmptyBox3D">EmptyBox3D</a>).
<p>By default, in <a class="normal" href="Castle3D.T3D.html">T3D</a> class, this always returns <code>False</code> and <a class="normal" href="Castle3D.T3D.html#Sphere">Sphere</a> is undefined.
<p>The advantages of using a sphere, that does not have to be a perfect bounding sphere (it may be smaller than necessary, and only account e.g. for upper body part of the creature), are:
<p></p>
<ul class="paragraph_spacing">
<li><p>It can have constant radius, even though the actual creature animates. This allows us to perfectly, reliably guarantee that sphere absolutely never collides with level and such.
<p>In case of a tight bounding volume (box or sphere) that animates, this guarantee is not really possible. Simply increasing time changes the animation to the next frame, which may be slightly larger in one dimension because e.g. creature moves a hand in this direction. This means that simply increasing time may change the non-collidable creature into a collidable one, if creature stands close to a wall/other creature and such. And we cannot simply stop/reverse an arbitrary animation at an arbitrary time (to avoid collision), this would look weird for some animations and would require some additional work at preparing animations and designing AI (as then "every action can be interrupted").
<p>Also using a bounding volume large enough to account for all possible positions is not doable, as it would be too large. Consider that for humanoid creatures, walking animation usually has tall and thin bounding box (creature stands) but dead/lying animation usually has flat and wide bounding box.
<p>So, only a bounding volume (like a sphere) that <i>may be smaller than bounding volume</i> can remain constant and easily guarantee the assertion "it never collides".
<p>This means that using such sphere results in simpler collision detection routines, as they may assume that collision doesn't occur. In contrast, detection routines looking at our (possibly animated) <a class="normal" href="Castle3D.T3D.html#BoundingBox">BoundingBox</a> must take into account that collision may already be happening, and they must incorporate code to allow creatures/players to "get unstruck".</p></li>
<li><p>Using smaller sphere also allows to naturally ascend the stairs and upward slopes. Sphere can move forward slightly, and then creature may raise up, to reach it's preferred height. Then sphere can move further forward, and so on. This alllows to allow stair climbing for creatures without any extra effort in the code.
<p>The downside is that creature legs will temporarily "sink into the floor" when climbing up the stairs. But it's not noticeable if "growing up" mechanism works fast enough.</p></li>
</ul>
<p>
<p>Sphere disadvantage:
<p></p>
<ul class="paragraph_spacing">
<li><p>Sphere is far from perfect as a bounding volume — it's too small, sometimes also too large, sometimes both at the same time...
<p>Since the Sphere radius remains always the same, it must be good for many creature animation frames. In cases where the sphere isn't suitable, and you don't need advantages above — you can make <code>Sphere</code> return <code>False</code>. E.g. a dead creature may be stuck in a wall, and it doesn't have to climb stairs. So you don't really need sphere advantages listed above, and <code>Sphere</code> may return <code>False</code> when creature is in dying state.
<p>But still it may be a problem sometimes, if some creature states have entirely different animations and bounding boxes. Then you will be forced to choose one universal Radius for all creature states. And you need constant radius to keep the advantage above of "guarantee".
<p>1. Obviously you can't set radius too small, because if it's much smaller than actual creature's geometry then the creature will noticeably collide with level geometry and other creatures.
<p>2. On the other hand, you can't set radius too large (or move sphere center, Middle, much lower). This would block stair climbing. </p></li>
</ul>
<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Height"></a><code>function <b>Height</b>(const MyPosition: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out AboveHeight: Single): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Get height of my point above the rest of the 3D world.
<p>This ignores the geometry of this 3D object (to not accidentaly collide with your own geometry), and checks collisions with the rest of the world. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Height"></a><code>function <b>Height</b>(const MyPosition: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out AboveHeight: Single; out AboveGround: <a href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="LineOfSight"></a><code>function <b>LineOfSight</b>(const Pos1, Pos2: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MoveAllowed"></a><code>function <b>MoveAllowed</b>(const OldPos, ProposedNewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const BecauseOfGravity: boolean): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Is the move from OldPos to ProposedNewPos possible for me. Returns true and sets NewPos if some move is allowed. Overloaded version without ProposedNewPos doesn't do wall-sliding, and only answers if exactly this move is allowed.
<p>If this 3D object allows to use sphere as the bounding volume (see <a class="normal" href="Castle3D.T3D.html#Sphere">Sphere</a>), then this sphere must be centered around OldPos, not some other point. That is, we assume that <a class="normal" href="Castle3D.T3D.html#Sphere">Sphere</a> returns Center that is equal to OldPos.
<p>This ignores the geometry of this 3D object (to not accidentaly collide with your own geometry), and checks collisions with the rest of the world. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MoveAllowed"></a><code>function <b>MoveAllowed</b>(const OldPos, NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const BecauseOfGravity: boolean): boolean;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Move"></a><code>function <b>Move</b>(const Translation: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const BecauseOfGravity: boolean; const EnableWallSliding: boolean = true): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Move, if possible (no collisions). This is the simplest way to move a 3D object, and a basic building block for artificial intelligence of creatures.
<p>Checks move possibility by <a class="normal" href="Castle3D.T3D.html#MoveAllowed">MoveAllowed</a>, using <a class="normal" href="Castle3D.T3D.html#Middle">Middle</a> point. Actual move is done using <a class="normal" href="Castle3D.T3D.html#Translate">Translate</a>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Ray"></a><code>function <b>Ray</b>(const RayOrigin, RayDirection: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a href="Castle3D.TRayCollision.html">TRayCollision</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Cast a ray from myself to the world, see what is hit.
<p>This ignores the geometry of this 3D object (to not accidentaly collide with your own geometry), and checks collisions with the rest of the world.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Shared"></a><code>function <b>Shared</b>: <a href="Castle3D.T3D.html">T3D</a>; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
In case this scene shares lights with other scenes, this is the source scene. In usual circumstances, this method simply returns <code>Self</code>, which means "no sharing". In case of scenes that are children of <a class="normal" href="CastlePrecalculatedAnimation.TCastlePrecalculatedAnimation.html">TCastlePrecalculatedAnimation</a>, their <code>Shared</code> methods all point to the 1st animation scene.</p>
</td></tr>
</table>
<h3 class="detail">Properties</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Exists"></a><code>property <b>Exists</b>: boolean read FExists write FExists default true;</code></td>
</tr>
<tr><td colspan="2">
<p>
Is this object visible and colliding.
<p>Setting this to <code>False</code> pretty much turns everything of this 3D object to "off". This is useful for objects that disappear completely from the level when something happens. You could just as well remove this object from <a class="normal" href="CastleSceneManager.TCastleSceneManager.html#Items">TCastleSceneManager.Items</a> tree, but sometimes it's more comfortable to simply turn this property to <code>False</code>.
<p>Descendants may also override <a class="normal" href="Castle3D.T3D.html#GetExists">GetExists</a> method.
<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Collides"></a><code>property <b>Collides</b>: boolean read FCollides write FCollides default true;</code></td>
</tr>
<tr><td colspan="2">
<p>
Should this 3D object participate in collision detection. You can turn this off, useful to make e.g. "fake" walls (to some secret places on level).
<p>This describes collision resolution with almost everything — camera, player (in third-person perspective, camera may differ from player), other creatures. That is because everything resolves collisions through our methods <a class="normal" href="Castle3D.T3D.html#MoveCollision">MoveCollision</a> and <a class="normal" href="Castle3D.T3D.html#HeightCollision">HeightCollision</a> (high-level) or <a class="normal" href="Castle3D.T3D.html#SegmentCollision">SegmentCollision</a>, <a class="normal" href="Castle3D.T3D.html#SphereCollision">SphereCollision</a>, <a class="normal" href="Castle3D.T3D.html#BoxCollision">BoxCollision</a> (low-level). (Note that <a class="normal" href="Castle3D.T3D.html#RayCollision">RayCollision</a> is excluded from this, it exceptionally ignores Collides value, as it's primarily used for picking. Same for <a class="normal" href="Castle3D.T3D.html#SegmentCollision">SegmentCollision</a> with <a class="normal" href="Castle3D.T3D.html#LineOfSight">LineOfSight</a>=true.)
<p>The only exception are the collisions with <a class="normal" href="Castle3D.T3DMoving.html">T3DMoving</a> instances (movable world parts like elevators and doors) that have their own detection routines and look at <a class="normal" href="Castle3D.T3D.html#CollidesWithMoving">CollidesWithMoving</a> property of other objects. That is, the <a class="normal" href="Castle3D.T3DMoving.html">T3DMoving</a> instance itself must still have Collides = <code>True</code>, but it interacts with <i>other</i> objects if and only if they have <a class="normal" href="Castle3D.T3D.html#CollidesWithMoving">CollidesWithMoving</a> = <code>True</code> (ignoring their Collides value). This allows items to be moved by elevators, but still player and creatures can pass through them.
<p>Note that if not <a class="normal" href="Castle3D.T3D.html#Exists">Exists</a> then this doesn't matter (not existing objects never participate in collision detection).
<p>Descendants may also override <a class="normal" href="Castle3D.T3D.html#GetCollides">GetCollides</a> method. Sometimes it's more comfortable than changing the property value.
<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Pickable"></a><code>property <b>Pickable</b>: boolean read FPickable write FPickable default true;</code></td>
</tr>
<tr><td colspan="2">
<p>
Is item pickable by <a class="normal" href="Castle3D.T3D.html#RayCollision">RayCollision</a> method. Note that if not <a class="normal" href="Castle3D.T3D.html#Exists">Exists</a> then this doesn't matter (not existing objects are never pickable). This is independent from <a class="normal" href="Castle3D.T3D.html#Collides">Collides</a>, as <a class="normal" href="Castle3D.T3D.html#RayCollision">RayCollision</a> does not look at <a class="normal" href="Castle3D.T3D.html#Collides">Collides</a>, it only looks at <a class="normal" href="Castle3D.T3D.html#Pickable">Pickable</a>.
<p>Descendants may also override <a class="normal" href="Castle3D.T3D.html#GetPickable">GetPickable</a> method. Sometimes it's more comfortable than changing the property value.
<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="CastShadowVolumes"></a><code>property <b>CastShadowVolumes</b>: boolean
read FCastShadowVolumes write FCastShadowVolumes default true;</code></td>
</tr>
<tr><td colspan="2">
<p>
Does the 3D object cast shadows by shadow volumes. See also <a class="normal" href="CastleScene.TCastleScene.html#ReceiveShadowVolumes">TCastleScene.ReceiveShadowVolumes</a>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Parent"></a><code>property <b>Parent</b>: <a href="Castle3D.T3DList.html">T3DList</a> read FParent;</code></td>
</tr>
<tr><td colspan="2">
<p>
Containing 3D list.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Cursor"></a><code>property <b>Cursor</b>: <a href="CastleKeysMouse.html#TMouseCursor">TMouseCursor</a> read FCursor write SetCursor default mcDefault;</code></td>
</tr>
<tr><td colspan="2">
<p>
Mouse cursor over this object.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="CollidesWithMoving"></a><code>property <b>CollidesWithMoving</b>: boolean read FCollidesWithMoving write FCollidesWithMoving default false;</code></td>
</tr>
<tr><td colspan="2">
<p>
Can this object be pushed by (or block movement of) doors, elevators and other moving level parts (<a class="normal" href="Castle3D.T3DMoving.html">T3DMoving</a> instances).
<p>Some 3D moving objects may try to avoid crushing this item. Like an automatic door that stops it's closing animation to not crush things standing in the doorway.
<p>Some other 3D moving objects may push this object. Like elevators (vertical, or horizontal moving platforms). We may use sphere (see <a class="normal" href="Castle3D.T3D.html#Sphere">T3D.Sphere</a>) for checking collisions, or bounding box (<a class="normal" href="Castle3D.T3D.html#BoundingBox">T3D.BoundingBox</a>), depending on need. The item is moved using <a class="normal" href="Castle3D.T3D.html#Translate">T3D.Translate</a>, so make sure it actually does something (for example, by descending from <a class="normal" href="Castle3D.T3DTransform.html">T3DTransform</a>, that provides natural <a class="normal" href="Castle3D.T3D.html#Translate">T3D.Translate</a> implementation).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><a name="ExcludeFromGlobalLights"></a><code>property <b>ExcludeFromGlobalLights</b>: boolean
read FExcludeFromGlobalLights write FExcludeFromGlobalLights default false;</code></td>
</tr>
<tr><td colspan="2">
<p>
If this 3D object is rendered as part of <a class="normal" href="CastleSceneManager.TCastleSceneManager.html">TCastleSceneManager</a>, and TCastleSceneManager.UseGlobalLights is <code>True</code>, then this property allows to make an exception for this 3D object: even though TCastleSceneManager.UseGlobalLights is <code>True</code>, do not use global lights <i>for this 3D object</i>.
<p>Note that this is not applied recursively. Instead, it is checked at each <a class="normal" href="Castle3D.T3D.html">T3D</a> instance that checks <a class="normal" href="Castle3D.TRenderParams.html#BaseLights">TRenderParams.BaseLights</a>. In practice, it is only checked at <a class="normal" href="CastleScene.TCastleScene.html">TCastleScene</a>, unless you do custom rendering on your own.</p>
</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", "1"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:07</em>
</span>
</td></tr></table></body></html>
|