Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 00326 00327 00328 00329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00348 00349 00350 00351 00352 00353 00354 00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 00369 00370 00371 00372 00373 00374 00375 00376 00377 00378 00379 00380 00381 00382 00383 00384 00385 00386 00387 00388 00389 00390 00391 00392 00393 00394 00395 00396 00397 00398 00399 00400 00401 00402 00403 00404 00405 00406 00407 00408 00409 00410 00411 00412 00413 00414 00415 00416 00417 00418 00419 00420 00421 00422 00423 00424 00425 00426 00427 00428 00429 00430 00431 00432 00433 00434 00435 00436 00437 00438 00439 00440 00441 00442 00443 00444 00445 00446 00447 00448 00449 00450 00451 00452 00453 00454 00455 00456 00457 00458 00459 00460 00461 00462 00463 00464 00465 00466 00467 00468 00469 00470 00471 00472 00473 00474 00475 00476 00477 00478 00479 00480 00481 00482 00483 00484 00485 00486 00487 00488 00489 00490 00491 00492 00493 00494 00495 00496 00497 00498 00499 00500 00501 00502 00503 00504 00505 00506 00507 00508 00509 00510 00511 00512 00513 00514 00515 00516 00517 00518 00519 00520 00521 00522 00523 00524 00525 00526 00527 00528 00529 00530 00531 00532 00533 00534 00535 00536 00537 00538 00539 00540 00541 00542 00543 00544 00545 00546 00547 00548 00549 00550 00551 00552 00553 00554 00555 00556 00557 00558 00559 00560 00561 00562 00563 00564 00565 00566 00567 00568 00569 00570 00571 00572 00573 00574 00575 00576 00577 00578 00579 00580 00581 00582 00583 00584 00585 00586 00587 00588 00589 00590 00591 00592 00593 00594 00595 00596 00597 00598 00599 00600 00601 00602 00603 00604 00605 00606 00607 00608 00609 00610 00611 00612 00613 00614 00615 00616 00617 00618 00619 00620 00621 00622 00623 00624 00625 00626 00627 00628 00629 00630 00631 00632 00633 00634 00635 00636 00637 00638 00639 00640 00641 00642 00643 00644 00645 00646 00647 00648 00649 00650 00651 00652 00653 00654 00655 00656 00657 00658 00659 00660 00661 00662 00663 00664 00665 00666 00667 00668 00669 00670 00671 00672 00673 00674 00675 00676 00677 00678 00679 00680 00681 00682 00683 00684 00685 00686 00687 00688 00689 00690 00691 00692 00693 00694 00695 00696 00697 00698 00699 00700 00701 00702 00703 00704 00705 00706 00707 00708 00709 00710 00711 00712 00713 00714 00715 00716 00717 00718 00719 00720 00721 00722 00723 00724 00725 00726 00727 00728 00729 00730 00731 00732 00733 00734 00735 00736 00737 00738 00739 00740 00741 00742 00743 00744 00745 00746 00747 00748 00749 00750 00751 00752 00753 00754 00755 00756 00757 00758 00759 00760 00761 00762 00763 00764 00765 00766 00767 00768 00769 00770 00771 00772 00773 00774 00775 00776 00777 00778 00779 00780 00781 00782 00783 00784 00785 00786 00787 00788 00789 00790 00791 00792 00793 00794 00795 00796 00797 00798 00799 00800 00801 00802 00803 00804 00805 00806 00807 00808 00809 00810 00811 00812 00813 00814 00815 00816 00817 00818 00819 00820 00821 00822 00823 00824 00825 00826 00827 00828 00829 00830 00831 00832 00833 00834 00835 00836 00837 00838 00839 00840 00841 00842 00843 00844 00845 00846 00847 00848 00849 00850 00851 00852 00853 00854 00855 00856 00857 00858 00859 00860 00861 00862 00863 00864 00865 00866 00867 00868 00869 00870 00871 00872 00873 00874 00875 00876 00877 00878 00879 00880 00881 00882 00883 00884 00885 00886 00887 00888 00889 00890 00891 00892 00893 00894 00895 00896 00897 00898 00899 00900 00901 00902 00903 00904 00905 00906 00907 00908 00909 00910 00911 00912 00913 00914 00915 00916 00917 00918 00919 00920 00921 00922 00923 00924 00925 00926 00927 00928 00929 00930 00931 00932 00933 00934 00935 00936 00937 00938 00939 00940 00941 00942 00943 00944 00945 00946 00947 00948 00949 00950 00951 00952 00953 00954 00955 00956 00957 00958 00959 00960 00961 00962 00963 00964 00965 00966 00967 00968 00969 00970 00971 00972 00973 00974 00975 00976 00977 00978 00979 00980 00981 00982 00983 00984 00985 00986 00987 00988 00989 00990 00991 00992 00993 00994 00995 00996 00997 00998 00999 01000 01001 01002 01003 01004 01005 01006 01007 01008 01009 01010 01011 01012 01013 01014 01015 01016 01017 01018 01019 01020 01021 01022 01023 01024 01025 01026 01027 01028 01029 01030 01031 01032 01033 01034 01035 01036 01037 01038 01039 01040 01041 01042 01043 01044 01045 01046 01047 01048 01049 01050 01051 01052 01053 01054 01055 01056 01057 01058 01059 01060 01061 01062 01063 01064 01065 01066 01067 01068 01069 01070 01071 01072 01073 01074 01075 01076 01077 01078 01079 01080 01081 01082 01083 01084 01085 01086 01087 01088 01089 01090 01091 01092 01093 01094 01095 01096 01097 01098 01099 01100 01101 01102 01103 01104 01105 01106 01107 01108 01109 01110 01111 01112 01113 01114 01115 01116 01117 01118 01119 01120 01121 01122 01123 01124 01125 01126 01127 01128 01129 01130 01131 01132 01133 01134 01135 01136 01137 01138 01139 01140 01141 01142 01143 01144 01145 01146 01147 01148 01149 01150 01151 01152 01153 01154 01155 01156 01157 01158 01159 01160 01161 01162 01163 01164 01165 01166 01167 01168 01169 01170 01171 01172 01173 01174 01175 01176 01177 01178 01179 01180 01181 01182 01183 01184 01185 01186 01187 01188 01189 01190 01191 01192 01193 01194 01195 01196 01197 01198 01199 01200 01201 01202 01203 01204 01205 01206 01207 01208 01209 01210 01211 01212 01213 01214 01215 01216 01217 01218 01219 01220 01221 01222 01223 01224 01225 01226 01227 01228 01229 01230 01231 01232 01233 01234 01235 01236 01237 01238 01239 01240 01241 01242 01243 01244 01245 01246 01247 01248 01249 01250 01251 01252 01253 01254 01255 01256 01257 01258 01259 01260 01261 01262 01263 01264 01265 01266 01267 01268 01269 01270 01271 01272 01273 01274 01275 01276 01277 01278 01279 01280 01281 01282 01283 01284 01285 01286 01287 01288 01289 01290 01291 01292 01293 01294 01295 01296 01297 01298 01299 01300 01301 01302 01303 01304 01305 01306 01307 01308 01309 01310 01311 01312 01313 01314 01315 01316 01317 01318 01319 01320 01321 01322 01323 01324 01325 01326 01327 01328 01329 01330 01331 01332 01333 01334 01335 01336 01337 01338 01339 01340 01341 01342 01343 01344 01345 01346 01347 01348 01349 01350 01351 01352 01353 01354 01355 01356 01357 01358 01359 01360 01361 01362 01363 01364 01365 01366 01367 01368 01369 01370 01371 01372 01373 01374 01375 01376 01377 01378 01379 01380 01381 01382 01383 01384 01385 01386 01387 01388 01389 01390 01391 01392 01393 01394 01395 01396 01397 01398 01399 01400 01401 01402 01403 01404 01405 01406 01407 01408 01409 01410 01411 01412 01413 01414 01415 01416 01417 01418 01419 01420 01421 01422 01423 01424 01425 01426 01427 01428 01429 01430 01431 01432 01433 01434 01435 01436 01437 01438 01439 01440 01441 01442 01443 01444 01445 01446 01447 01448 01449 01450 01451 01452 01453 01454 01455 01456 01457 01458 01459 01460 01461 01462 01463 01464 01465 01466 01467 01468 01469 01470 01471 01472 01473 01474 01475 01476 01477 01478 01479 01480 01481 01482 01483 01484 01485 01486 01487 01488 01489 01490 01491 01492 01493 01494 01495 01496 01497 01498 01499 01500 01501 01502 01503 01504 01505 01506 01507 01508 01509 01510 01511 01512 01513 01514 01515 01516 01517 01518 01519 01520 01521 01522 01523 01524 01525 01526 01527 01528 01529 01530 01531 01532 01533 01534 01535 01536 01537 01538 01539 01540 01541 01542 01543 01544 01545 01546 01547 01548 01549 01550 01551 01552 01553 01554 01555 01556 01557 01558 01559 01560 01561 01562 01563 01564 01565 01566 01567 01568 01569 01570 01571 01572 01573 01574 01575 01576 01577 01578 01579 01580 01581 01582 01583 01584 01585 01586 01587 01588 01589 01590 01591 01592 01593 01594 01595 01596 01597 01598 01599 01600 01601 01602 01603 01604 01605 01606 01607 01608 01609 01610 01611 01612 01613 01614 01615 01616 01617 01618 01619 01620 01621 01622 01623 01624 01625 01626 01627 01628 01629 01630 01631 01632 01633 01634 01635 01636 01637 01638 01639 01640 01641 01642 01643 01644 01645 01646 01647 01648 01649 01650 01651 01652 01653 01654 01655 01656 01657 01658 01659 01660 01661 01662 01663 01664 01665 01666 01667 01668 01669 01670 01671 01672 01673 01674 01675 01676 01677 01678 01679 01680 01681 01682 01683 01684 01685 01686 01687 01688 01689 01690 01691 01692 01693 01694 01695 01696 01697 01698 01699 01700 01701 01702 01703 01704 01705 01706 01707 01708 01709 01710 01711 01712 01713 01714 01715 01716 01717 01718 01719 01720 01721 01722 01723 01724 01725 01726 01727 01728 01729 01730 01731 01732 01733 01734 01735 01736 01737 01738 01739 01740 01741 01742 01743 01744 01745 01746 01747 01748 01749 01750 01751 01752 01753 01754 01755 01756 01757 01758 01759 01760 01761 01762 01763 01764 01765 01766 01767 01768 01769 01770 01771 01772 01773 01774 01775 01776 01777 01778 01779 01780 01781 01782 01783 01784 01785 01786 01787 01788 01789 01790 01791 01792 01793 01794 01795 01796 01797 01798 01799 01800 01801 01802 01803 01804 01805 01806 01807 01808 01809 01810 01811 01812 01813 01814 01815 01816 01817 01818 01819 01820 01821 01822 01823 01824 01825 01826 01827 01828 01829 01830 01831 01832 01833 01834 01835 01836 01837 01838 01839 01840 01841 01842 01843 01844 01845 01846 01847 01848 01849 01850 01851 01852 01853 01854 01855 01856 01857 01858 01859 01860 01861 01862 01863 01864 01865 01866 01867 01868 01869 01870 01871 01872 01873 01874 01875 01876 01877 01878 01879 01880 01881 01882 01883 01884 01885 01886 01887 01888 01889 01890 01891 01892 01893 01894 01895 01896 01897 01898 01899 01900 01901 01902 01903 01904 01905 01906 01907 01908 01909 01910 01911 01912 01913 01914 01915 01916 01917 01918 01919 01920 01921 01922 01923 01924 01925 01926 01927 01928 01929 01930 01931 01932 01933 01934 01935 01936 01937 01938 01939 01940 01941 01942 01943 01944 01945 01946 01947 01948 01949 01950 01951 01952 01953 01954 01955 01956 01957 01958 01959 01960 01961 01962 01963 01964 01965 01966 01967 01968 01969 01970 01971 01972 01973 01974 01975 01976 01977 01978 01979 01980 01981 01982 01983 01984 01985 01986 01987 01988 01989 01990 01991 01992 01993 01994 01995 01996 01997 01998 01999 02000 02001 02002 02003 02004 02005 02006 02007 02008 02009 02010 02011 02012 02013 02014 02015 02016 02017 02018 02019 02020 02021 02022 02023 02024 02025 02026 02027 02028 02029 02030 02031 02032 02033 02034 02035 02036 02037 02038 02039 02040 02041 02042 02043 02044 02045 02046 02047 02048 02049 02050 02051 02052 02053 02054 02055 02056 02057 02058 02059 02060 02061 02062 02063 02064 02065 02066 02067 02068 02069 02070 02071 02072 02073 02074 02075 02076 02077 02078 02079 02080 02081 02082 02083 02084 02085 02086 02087 02088 02089 02090 02091 02092 02093 02094 02095 02096 02097 02098 02099 02100 02101 02102 02103 02104 02105 02106 02107 02108 02109 02110 02111 02112 02113 02114 02115 |
/** * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved. */ //============================================================================= // Object: The base class all objects. // This is a built-in Unreal class and it shouldn't be modified by mod authors //============================================================================= class Object abstract native noexport; //============================================================================= // Unreal base structures. // Temporary UnrealScript->C++ mirrors. struct pointer { var native const int Dummy; }; struct {QWORD} qword { var native const int A, B; }; //============================================================================= // UObject variables. // Internal variables. var native private const editconst noexport pointer VfTableObject; var native private const editconst noexport int ObjectInternalInteger; var native private const editconst qword ObjectFlags; // This needs to be 8-byte aligned in 32-bit! var native private const editconst pointer HashNext; var native private const editconst pointer HashOuterNext; var native private const editconst pointer StateFrame; var native private const editconst noexport Object Linker; var native private const editconst noexport pointer LinkerIndex; var native private const editconst noexport int NetIndex; var native const editconst Object Outer; var() native const editconst name Name; var native const editconst class Class; var() native const editconst Object ObjectArchetype; //////////////////////////////////////////////////////////////////////////////////////////////// // IMPORTANT: DO NOT ADD _ANY_ MEMBERS AFTER ObjectArchetype! Add ALL members before it, as the // C++ code expects it to be the final member of UObject! (see UObject::InitProperties) //////////////////////////////////////////////////////////////////////////////////////////////// //============================================================================= // Unreal base structures continued. struct {DOUBLE} double { var native const int A; var native const int B; }; struct ThreadSafeCounter { var native const int Value; }; struct BitArray_Mirror { var native const pointer IndirectData; var native const int InlineData[4]; var native const int NumBits; var native const int MaxBits; }; struct SparseArray_Mirror { var native const array<int> Elements; var native const BitArray_Mirror AllocationFlags; var native const int FirstFreeIndex; var native const int NumFreeIndices; }; struct Set_Mirror { var native const SparseArray_Mirror Elements; var native const pointer Hash; var native const int InlineHash; var native const int HashSize; }; struct Map_Mirror { var native const Set_Mirror Pairs; }; struct MultiMap_Mirror { var native const Set_Mirror Pairs; }; struct UntypedBulkData_Mirror { var native const pointer VfTable; var native const int BulkDataFlags; var native const int ElementCount; var native const int BulkDataOffsetInFile; var native const int BulkDataSizeOnDisk; var native const int SavedBulkDataFlags; var native const int SavedElementCount; var native const int SavedBulkDataOffsetInFile; var native const int SavedBulkDataSizeOnDisk; var native const pointer BulkData; var native const int LockStatus; var native const pointer AttachedAr; var native const int bShouldFreeOnEmpty; }; struct RenderCommandFence_Mirror { var native const transient int NumPendingFences; }; // needs to match FColorVertexBuffer in C++ struct FColorVertexBuffer_Mirror { var native const pointer VfTable; var native const pointer VertexData; var private const int Data; var private const int Stride; var private const int NumVertices; }; struct IndirectArray_Mirror { // FScriptArray var native const pointer Data; var native const int ArrayNum; var native const int ArrayMax; }; struct Array_Mirror { // FScriptArray var native const pointer Data; var native const int ArrayNum; var native const int ArrayMax; }; /** * Structure mirroring an array of pointers using an inline allocator. */ struct InlinePointerArray_Mirror { var private const pointer InlineData; var private const Array_Mirror SecondaryData; }; // A globally unique identifier. struct immutable Guid { var int A, B, C, D; }; // A point or direction vector in 3d space. struct immutable Vector { var() float X, Y, Z; }; struct immutable Vector4 { var() float X, Y, Z, W; }; struct immutable Vector2D { var() float X, Y; }; struct immutable TwoVectors { var() Vector v1, v2; }; // A plane definition in 3d space. struct immutable Plane extends Vector { var() float W; }; // An orthogonal rotation in 3d space. struct immutable Rotator { var() int Pitch, Yaw, Roll; }; // Quaternion struct immutable Quat { var() float X, Y, Z, W; }; /** * Screen coordinates */ struct immutable IntPoint { var() int X, Y; }; /** * A vector of spherical harmonic coefficients. */ struct SHVector { // Note: The number of SH coefficients must match NUM_SH_BASIS in SHMath.h! // The struct must also be padded to be 16-byte aligned. var() float V[9]; var float Padding[3]; }; /** * A vector of spherical harmonic coefficients for each color component. */ struct SHVectorRGB { var() SHVector R; var() SHVector G; var() SHVector B; }; /** * Point Of View type. */ struct TPOV { /** Location */ var() Vector Location; /** Rotation */ var() Rotator Rotation; /** FOV angle */ var() float FOV; structdefaultproperties { FOV=90.f } }; /** Various ways to interpolate TAlphaBlend. */ enum AlphaBlendType { ABT_Linear, ABT_Cubic, ABT_Sinusoidal, ABT_EaseInOutExponent2, ABT_EaseInOutExponent3, ABT_EaseInOutExponent4, ABT_EaseInOutExponent5, }; /** Structure to encompass Alpha Interpolation. */ struct TAlphaBlend { /** Internal Lerped value for Alpha */ var const FLOAT AlphaIn; /** Resulting Alpha value, between 0.f and 1.f */ var const FLOAT AlphaOut; /** Target to reach */ var() FLOAT AlphaTarget; /** Default blend time */ var() FLOAT BlendTime; /** Time left to reach target */ var const FLOAT BlendTimeToGo; /** Type of blending used (Linear, Cubic, etc.) */ var() AlphaBlendType BlendType; structdefaultproperties { BlendTime=0.67f BlendType=ABT_Linear } }; // Generic axis enum. enum EAxis { AXIS_NONE, // = 0 AXIS_X, // = 1 AXIS_Y, // = 2 AXIS_BLANK, // = 3. Need this because AXIS enum is used as bitfield in C++... AXIS_Z // 4 }; enum EInputEvent { IE_Pressed, IE_Released, IE_Repeat, IE_DoubleClick, IE_Axis }; enum EAspectRatioAxisConstraint { AspectRatio_MaintainYFOV, AspectRatio_MaintainXFOV, AspectRatio_MajorAxisFOV }; // A color. struct immutable Color { var() byte B, G, R, A; }; // A linear color. struct immutable LinearColor { var() float R, G, B, A; structdefaultproperties { A=1.f } }; // A bounding box. struct immutable Box { var() vector Min, Max; var byte IsValid; }; // A bounding box and bounding sphere with the same origin. struct BoxSphereBounds { var vector Origin; var vector BoxExtent; var float SphereRadius; }; // a 4x4 matrix struct immutable Matrix { var() Plane XPlane; var() Plane YPlane; var() Plane ZPlane; var() Plane WPlane; }; struct Cylinder { var float Radius, Height; }; // Interpolation data types. enum EInterpCurveMode { CIM_Linear, CIM_CurveAuto, CIM_Constant, CIM_CurveUser, CIM_CurveBreak, CIM_CurveAutoClamped }; // Interpolation data types. enum EInterpMethodType { IMT_UseFixedTangentEvalAndNewAutoTangents, IMT_UseFixedTangentEval, IMT_UseBrokenTangentEval }; struct InterpCurvePointFloat { var() float InVal; var() float OutVal; var() float ArriveTangent; var() float LeaveTangent; var() EInterpCurveMode InterpMode; }; struct InterpCurveFloat { var() array<InterpCurvePointFloat> Points; var EInterpMethodType InterpMethod; }; struct InterpCurvePointVector2D { var() float InVal; var() vector2d OutVal; var() vector2d ArriveTangent; var() vector2d LeaveTangent; var() EInterpCurveMode InterpMode; }; struct InterpCurveVector2D { var() array<InterpCurvePointVector2D> Points; var EInterpMethodType InterpMethod; }; struct InterpCurvePointVector { var() float InVal; var() vector OutVal; var() vector ArriveTangent; var() vector LeaveTangent; var() EInterpCurveMode InterpMode; }; struct InterpCurveVector { var() array<InterpCurvePointVector> Points; var EInterpMethodType InterpMethod; }; struct InterpCurvePointTwoVectors { var() float InVal; var() twovectors OutVal; var() twovectors ArriveTangent; var() twovectors LeaveTangent; var() EInterpCurveMode InterpMode; }; struct InterpCurveTwoVectors { var() array<InterpCurvePointTwoVectors> Points; var EInterpMethodType InterpMethod; }; struct InterpCurvePointQuat { var() float InVal; var() quat OutVal; var() quat ArriveTangent; var() quat LeaveTangent; var() EInterpCurveMode InterpMode; }; struct InterpCurveQuat { var() array<InterpCurvePointQuat> Points; var EInterpMethodType InterpMethod; }; struct InterpCurvePointLinearColor { var() float InVal; var() linearcolor OutVal; var() linearcolor ArriveTangent; var() linearcolor LeaveTangent; var() EInterpCurveMode InterpMode; }; struct InterpCurveLinearColor { var() array<InterpCurvePointLinearColor> Points; var EInterpMethodType InterpMethod; }; // Base class for raw (baked out) Distribution type struct RawDistribution { var byte Type; var byte Op; var byte LookupTableNumElements; var byte LookupTableChunkSize; var array<float> LookupTable; var float LookupTableTimeScale; var float LookupTableStartTime; }; /** A fence used to track rendering thread command execution. */ struct RenderCommandFence { var private native const int NumPendingFences; }; /** Mirror for FElementId used in generic Octree */ struct OctreeElementId { var private native const pointer Node; var private native const int ElementIndex; }; /** Bone Atom definition */ struct BoneAtom { var quat Rotation; var vector Translation; var float Scale; }; //============================================================================= // Constants. const MaxInt = 0x7fffffff; const Pi = 3.1415926535897932; const RadToDeg = 57.295779513082321600; // 180 / Pi const DegToRad = 0.017453292519943296; // Pi / 180 const UnrRotToRad = 0.00009587379924285; // Pi / 32768 const RadToUnrRot = 10430.3783504704527; // 32768 / Pi const DegToUnrRot = 182.0444; const UnrRotToDeg = 0.00549316540360483; const INDEX_NONE = -1; // Aspect ratio constants const AspectRatio4x3 = 1.33333; const AspectRatio5x4 = 1.25; const AspectRatio16x9 = 1.77778; const InvAspectRatio4x3 = 0.75; const InvAspectRatio5x4 = 0.8; const InvAspectRatio16x9 = 0.56249; //============================================================================= // Logging Severity Levels. /** * Determines which ticking group an Actor/Component belongs to */ enum ETickingGroup { /** * Any item that needs to be updated before asynchronous work is done */ TG_PreAsyncWork, /** * Any item that can be run in parallel of our async work */ TG_DuringAsyncWork, /** * Any item that needs the async work to be done before being updated */ TG_PostAsyncWork, /** * Any item that needs the update work to be done before being ticked */ TG_PostUpdateWork, /** Special effects that need to be updated last */ TG_EffectsUpdateWork }; /** * These are the types of PerfMem RunResults you the system understands and can achieve. They are stored in the table as we * will get "valid" numbers but we ran OOM. We want to list the numbers in the OOM case because there is probably something that * jumped up to cause the OOM (e.g. vertex lighting). **/ enum EAutomatedRunResult { ARR_Unknown, ARR_OOM, ARR_Passed, }; /** * Different modes for the DebugBreak() method. */ enum EDebugBreakType { DEBUGGER_NativeOnly, /** not yet implemented */ DEBUGGER_ScriptOnly, /** not yet implemented */ DEBUGGER_Both, }; //============================================================================= // Basic native operators and functions. // // Bool operators. // native(129) static final preoperator bool ! ( bool A ); native(242) static final k2pure operator(24) bool == ( bool A, bool B ); native(243) static final operator(26) bool != ( bool A, bool B ); native(130) static final operator(30) bool && ( bool A, skip bool B ); native(131) static final operator(30) bool ^^ ( bool A, bool B ); native(132) static final operator(32) bool || ( bool A, skip bool B ); // // Byte operators. // native(133) static final operator(34) byte *= ( out byte A, byte B ); native(198) static final operator(34) byte *= ( out byte A, float B ); native(134) static final operator(34) byte /= ( out byte A, byte B ); native(135) static final operator(34) byte += ( out byte A, byte B ); native(136) static final operator(34) byte -= ( out byte A, byte B ); native(137) static final preoperator byte ++ ( out byte A ); native(138) static final preoperator byte -- ( out byte A ); native(139) static final postoperator byte ++ ( out byte A ); native(140) static final postoperator byte -- ( out byte A ); // // Integer operators. // native(141) static final preoperator int ~ ( int A ); native(143) static final preoperator int - ( int A ); native(144) static final k2pure operator(16) int * ( int A, int B ); native(145) static final k2pure operator(16) int / ( int A, int B ); native(253) static final operator(18) int % ( int A, int B ); native(146) static final k2pure operator(20) int + ( int A, int B ); native(147) static final k2pure operator(20) int - ( int A, int B ); native(148) static final operator(22) int << ( int A, int B ); native(149) static final operator(22) int >> ( int A, int B ); native(196) static final operator(22) int >>>( int A, int B ); native(150) static final k2pure operator(24) bool < ( int A, int B ); native(151) static final operator(24) bool > ( int A, int B ); native(152) static final k2pure operator(24) bool <= ( int A, int B ); native(153) static final operator(24) bool >= ( int A, int B ); native(154) static final k2pure operator(24) bool == ( int A, int B ); native(155) static final operator(26) bool != ( int A, int B ); native(156) static final operator(28) int & ( int A, int B ); native(157) static final operator(28) int ^ ( int A, int B ); native(158) static final operator(28) int | ( int A, int B ); native(159) static final operator(34) int *= ( out int A, float B ); native(160) static final operator(34) int /= ( out int A, float B ); native(161) static final operator(34) int += ( out int A, int B ); native(162) static final operator(34) int -= ( out int A, int B ); native(163) static final preoperator int ++ ( out int A ); native(164) static final preoperator int -- ( out int A ); native(165) static final postoperator int ++ ( out int A ); native(166) static final postoperator int -- ( out int A ); // // Integer functions. // /** Rand will give you a value between 0 and Max -1 **/ native(167) static final k2pure Function int Rand ( int Max ); native(249) static final function int Min ( int A, int B ); native(250) static final function int Max ( int A, int B ); native(251) static final function int Clamp ( int V, int A, int B ); native static final function string ToHex ( int A ); // // Float operators. // native(169) static final preoperator float - ( float A ); native(170) static final operator(12) float ** ( float Base, float Exp ); native(171) static final k2pure operator(16) float * ( float A, float B ); native(172) static final k2pure operator(16) float / ( float A, float B ); native(173) static final operator(18) float % ( float A, float B ); native(174) static final k2pure operator(20) float + ( float A, float B ); native(175) static final k2pure operator(20) float - ( float A, float B ); native(176) static final k2pure operator(24) bool < ( float A, float B ); native(177) static final operator(24) bool > ( float A, float B ); native(178) static final k2pure operator(24) bool <= ( float A, float B ); native(179) static final operator(24) bool >= ( float A, float B ); native(180) static final k2pure operator(24) bool == ( float A, float B ); native(210) static final operator(24) bool ~= ( float A, float B ); native(181) static final operator(26) bool != ( float A, float B ); native(182) static final operator(34) float *= ( out float A, float B ); native(183) static final operator(34) float /= ( out float A, float B ); native(184) static final operator(34) float += ( out float A, float B ); native(185) static final operator(34) float -= ( out float A, float B ); // // Float functions. // native(186) static final k2pure function float Abs ( float A ); native(187) static final k2pure function float Sin ( float A ); native static final function float Asin ( float A ); native(188) static final k2pure function float Cos ( float A ); native static final function float Acos ( float A ); native(189) static final function float Tan ( float A ); native(190) static final function float Atan ( float A ); native static final function float Atan2 ( float A, float B ); native(191) static final function float Exp ( float A ); native(192) static final function float Loge ( float A ); native(193) static final function float Sqrt ( float A ); native(194) static final function float Square( float A ); native(195) static final k2pure function float FRand (); native(244) static final function float FMin ( float A, float B ); native(245) static final function float FMax ( float A, float B ); native(246) static final k2pure function float FClamp( float V, float A, float B ); native(247) static final function float Lerp ( float A, float B, float Alpha ); native(199) static final k2pure function int Round ( float A ); native static final function int FFloor ( float A ); native static final function int FCeil(float A); /** * Cubic Spline interpolation. * @param P end points * @param T tangent directions at end points * @param Alpha distance along spline * @return evaluated value. */ native static final function float FCubicInterp(float P0, float T0, float P1, float T1, float A); /** * Interpolates with ease-in (smoothly approaches B). * @param A Value to interpolate from. * @param B Value to interpolate to. * @param Alpha Interpolant. * @param Exp Exponent. Higher values result in more rapid deceleration. * @return Interpolated value. */ static final function float FInterpEaseIn(float A, float B, float Alpha, float Exp) { return Lerp(A, B, Alpha**Exp); } /** * Interpolates with ease-out (smoothly departs A). * @param A Value to interpolate from. * @param B Value to interpolate to. * @param Alpha Interpolant. * @param Exp Exponent. Higher values result in more rapid acceleration. * @return Interpolated value. */ static final function float FInterpEaseOut(float A, float B, float Alpha, float Exp) { return Lerp(A, B, Alpha**(1/Exp)); } /** * Interpolates with both ease-in and ease-out (smoothly departs A, smoothly approaches B). * @param A Value to interpolate from. * @param B Value to interpolate to. * @param Alpha Interpolant. * @param Exp Exponent. Higher values result in more rapid acceleration adn deceleration. * @return Interpolated value. */ native static final function float FInterpEaseInOut(float A, float B, float Alpha, float Exp); /** Return a random number within the given range. */ static final simulated function k2pure float RandRange( float InMin, float InMax ) { return InMin + (InMax - InMin) * FRand(); } /** * Returns the relative percentage position Value is in the range [Min,Max]. * Examples: * - GetRangeValueByPct( 2, 4, 2 ) == 0 * - GetRangeValueByPct( 2, 4, 4 ) == 1 * - GetRangeValueByPct( 2, 4, 3 ) == 0.5 * * @param Min Min limit * @param Max Max limit * @param Value Value between Range. * * @return relative percentage position Value is in the range [Min,Max]. */ static final simulated function float FPctByRange( float Value, float InMin, float InMax ) { return (Value - InMin) / (InMax - InMin); } /** * Tries to reach Target based on distance from Current position, * giving a nice smooth feeling when tracking a position. * (Doesn't work well when target teleports) * * @param Current Actual position * @param Target Target position * @param DeltaTime time since last tick * @param InterpSpeed Interpolation speed * @return new interpolated position */ native static final function float FInterpTo( float Current, float Target, float DeltaTime, float InterpSpeed ); /** Same as above, but using a constant step */ native static final function float FInterpConstantTo( float Current, float Target, float DeltaTime, float InterpSpeed ); // // Vector operators. // native(211) static final preoperator vector - ( vector A ); native(212) static final k2pure operator(16) vector * ( vector A, float B ); native(213) static final k2pure operator(16) vector * ( float A, vector B ); native(296) static final k2pure operator(16) vector * ( vector A, vector B ); native(214) static final k2pure operator(16) vector / ( vector A, float B ); native(215) static final k2pure operator(20) vector + ( vector A, vector B ); native(216) static final k2pure operator(20) vector - ( vector A, vector B ); native(275) static final operator(22) vector << ( vector A, rotator B ); native(276) static final operator(22) vector >> ( vector A, rotator B ); native(217) static final operator(24) bool == ( vector A, vector B ); native(218) static final operator(26) bool != ( vector A, vector B ); native(219) static final operator(16) float Dot ( vector A, vector B ); native(220) static final operator(16) vector Cross ( vector A, vector B ); native(221) static final operator(34) vector *= ( out vector A, float B ); native(297) static final operator(34) vector *= ( out vector A, vector B ); native(222) static final operator(34) vector /= ( out vector A, float B ); native(223) static final operator(34) vector += ( out vector A, vector B ); native(224) static final operator(34) vector -= ( out vector A, vector B ); // // Vector functions. // native(225) static final k2pure function float VSize ( vector A ); native static final function float VSize2D ( vector A ); native(228) static final function float VSizeSq ( vector A ); native static final function float VSizeSq2D ( vector A ); native(226) static final k2pure function vector Normal ( vector A ); native static final k2pure function vector VLerp ( vector A, vector B, float Alpha ); native static final function vector VSmerp ( vector A, vector B, float Alpha ); native(252) static final k2pure function vector VRand ( ); native static final function vector VRandCone ( vector Dir, float ConeHalfAngleRadians ); native static final function vector VRandCone2 ( vector Dir, float HorizontalConeHalfAngleRadians, float VerticalConeHalfAngleRadians ); native(300) static final function vector MirrorVectorByNormal( vector InVect, vector InNormal ); native(1500) static final function Vector ProjectOnTo( Vector x, Vector y ); native(1501) static final function bool IsZero( Vector A ); /** * Tries to reach Target based on distance from Current position, * giving a nice smooth feeling when tracking a location. * (Doesn't work well when target teleports) * * @param Current Actual location * @param Target Target location * @param DeltaTime time since last tick * @param InterpSpeed Interpolation speed * @return new interpolated position */ native static final function vector VInterpTo( vector Current, vector Target, float DeltaTime, float InterpSpeed ); /** Clamps a vector to not be longer than MaxLength. */ native static final function vector ClampLength( vector V, float MaxLength ); /** Returns dot product of two vectors while ignoring the Z component. */ native static final function float NoZDot( vector A, vector B ); simulated final function bool InCylinder( Vector Origin, Rotator Dir, float Width, Vector A, optional bool bIgnoreZ ) { local Vector B; local Vector VDir; if( bIgnoreZ ) { Origin.Z = 0; Dir.Pitch = 0; A.Z = 0; } VDir = Vector(Dir); B = (((A - Origin) DOT VDir) * VDir) + Origin; if( VSizeSq(B-A) <= Width * Width ) { return TRUE; } return FALSE; } // // Rotator operators and functions. // native(142) static final operator(24) bool == ( rotator A, rotator B ); native(203) static final operator(26) bool != ( rotator A, rotator B ); native(287) static final operator(16) rotator * ( rotator A, float B ); native(288) static final operator(16) rotator * ( float A, rotator B ); native(289) static final operator(16) rotator / ( rotator A, float B ); native(290) static final operator(34) rotator *= ( out rotator A, float B ); native(291) static final operator(34) rotator /= ( out rotator A, float B ); native(316) static final operator(20) rotator + ( rotator A, rotator B ); native(317) static final operator(20) rotator - ( rotator A, rotator B ); native(318) static final operator(34) rotator += ( out rotator A, rotator B ); native(319) static final operator(34) rotator -= ( out rotator A, rotator B ); native static final operator(24) bool ClockwiseFrom( int A, int B ); native(229) static final k2pure function GetAxes( rotator A, out vector X, out vector Y, out vector Z ); native(230) static final function GetUnAxes( rotator A, out vector X, out vector Y, out vector Z ); native static final function vector GetRotatorAxis( rotator A, int Axis ); native(320) static final k2pure function Rotator RotRand( optional bool bRoll ); native static final function Rotator OrthoRotation( vector X, vector Y, vector Z ); native static final function Rotator Normalize( rotator Rot ); native static final function Rotator RLerp( Rotator A, Rotator B, float Alpha, optional bool bShortestPath ); native static final function Rotator RSmerp( Rotator A, Rotator B, float Alpha, optional bool bShortestPath ); /** Given rotation R in the space defined by RBasis, return R in "world" space */ native static final function Rotator RTransform(rotator R, rotator RBasis); /** * Tries to reach Target based on distance from Current position, * giving a nice smooth feeling when tracking a position. * (Doesn't work well when target teleports) * * @param Current Actual position * @param Target Target position * @param DeltaTime time since last tick * @param InterpSpeed Interpolation speed, if !bConstantInterpSpeed will perform a continuous lerp, otherwise will interp at constant speed * @return new interpolated position */ native static final function Rotator RInterpTo( rotator Current, rotator Target, float DeltaTime, float InterpSpeed, optional bool bConstantInterpSpeed ); /** * Returns a Rotator axis within the [-32768,+32767] range in float * * @param RotAxis, axis of the rotator * @return Normalized axis value, within the [-32768,+32767] range. */ native static final function int NormalizeRotAxis(int Angle); /** Gives the rotation difference between two Rotators, taking the shortest route between them (in degrees). */ native static final function float RDiff( Rotator A, Rotator B ); /** * returns Rotator Size (vector definition applied to rotators) * @param Rotator R * @returns mathematical vector length: Sqrt(Pitch^2 + Yaw^2 + Roll^2) */ native static final function float RSize(rotator R); /** * Clamp a rotation Axis. * The ViewAxis rotation component must be normalized (within the [-32768,+32767] range). * This function will set out_DeltaViewAxis to the delta needed to bring ViewAxis within the [MinLimit,MaxLimit] range. * * @param ViewAxis Rotation Axis to clamp * @input out_DeltaViewAxis Delta Rotation Axis to be added to ViewAxis rotation (from ProcessViewRotation). * Set to be the Delta to bring ViewAxis within the [MinLimit,MaxLimit] range. * @param MaxLimit Maximum for Clamp. ViewAxis will not exceed this. * @param MinLimit Minimum for Clamp. ViewAxis will not go below this. */ static final simulated function ClampRotAxis ( int ViewAxis, out int out_DeltaViewAxis, int MaxLimit, int MinLimit ) { local int DesiredViewAxis; ViewAxis = NormalizeRotAxis( ViewAxis ); DesiredViewAxis = ViewAxis + out_DeltaViewAxis; if( DesiredViewAxis > MaxLimit ) { DesiredViewAxis = MaxLimit; } if( DesiredViewAxis < MinLimit ) { DesiredViewAxis = MinLimit; } out_DeltaViewAxis = DesiredViewAxis - ViewAxis; } /** * Clamp Rotator Axis. * * @param Current Input axis angle. * @param Center Center of allowed angle. * @param MaxDelta Maximum delta allowed. * @return axis angle clamped between [Center-MaxDelta, Center+MaxDelta] */ static final simulated function int ClampRotAxisFromBase(int Current, int Center, int MaxDelta) { local int DeltaFromCenter; DeltaFromCenter = NormalizeRotAxis(Current - Center); if( DeltaFromCenter > MaxDelta ) { Current = Center + MaxDelta; } else if( DeltaFromCenter < -MaxDelta ) { Current = Center - MaxDelta; } return Current; }; /** * Clamp Rotator Axis. * * @param Current Input axis angle. * @param Min Min allowed angle. * @param Max Max allowed angle. * @return axis angle clamped between [Min, Max] */ static final simulated function int ClampRotAxisFromRange(int Current, int Min, int Max) { local int Delta, Center; Delta = NormalizeRotAxis(Max - Min) / 2; Center = NormalizeRotAxis(Max + Min) / 2; return ClampRotAxisFromBase(Current, Center, Delta); }; /** * Smooth clamp a rotator axis. * This is mainly used to bring smoothly a rotator component within a certain range [MinLimit,MaxLimit]. * For example to limit smoothly the player's ViewRotation Pitch or Yaw component. * * @param fDeltaTime Elapsed time since this function was last called, for interpolation. * @param ViewAxis Rotator's Axis' current angle. * @input out_DeltaViewAxis Delta Value of Axis to be added to ViewAxis (through PlayerController::ProcessViewRotation(). * This value gets modified. * @param MaxLimit Up angle limit. * @param MinLimit Negative angle limit (value must be negative) * @param InterpolationSpeed Interpolation Speed to bring ViewAxis within the [MinLimit,MaxLimit] range. */ static final simulated function bool SClampRotAxis ( float DeltaTime, int ViewAxis, out int out_DeltaViewAxis, int MaxLimit, int MinLimit, float InterpolationSpeed ) { local bool bClamped; // make sure rotation components are normalized out_DeltaViewAxis = NormalizeRotAxis( out_DeltaViewAxis ); ViewAxis = NormalizeRotAxis( ViewAxis ); // forbid player from going beyond limits through fDeltaViewAxis if( ViewAxis <= MaxLimit && (ViewAxis + out_DeltaViewAxis) >= MaxLimit ) { out_DeltaViewAxis = MaxLimit - ViewAxis; bClamped = TRUE; } else if( ViewAxis > MaxLimit ) { // if players goes counter interpolation, ignore input if( out_DeltaViewAxis > 0 ) { out_DeltaViewAxis = 0.f; } // if above limit, interpolate back to within limits if( (ViewAxis + out_DeltaViewAxis) > MaxLimit ) { out_DeltaViewAxis = FInterpTo(ViewAxis, MaxLimit, DeltaTime, InterpolationSpeed ) - ViewAxis - 1; } } // forbid player from going beyond limits through fDeltaViewAxis else if( ViewAxis >= MinLimit && (ViewAxis + out_DeltaViewAxis) <= MinLimit ) { out_DeltaViewAxis = MinLimit - ViewAxis; bClamped = TRUE; } else if( ViewAxis < MinLimit ) { // if players goes counter interpolation, ignore input if( out_DeltaViewAxis < 0 ) { out_DeltaViewAxis = 0.f; } // if above limit, interpolate back to within limits if( (ViewAxis + out_DeltaViewAxis) < MinLimit ) { out_DeltaViewAxis += FInterpTo(ViewAxis, MinLimit, DeltaTime, InterpolationSpeed ) - ViewAxis + 1; } } return bClamped; } /** Create a Rotation from independant Pitch, Yaw, Roll */ static final function Rotator MakeRotator(int Pitch, int Yaw, int Roll) { local rotator R; R.Pitch = Pitch; R.Yaw = Yaw; R.Roll = Roll; return R; } // // String operators. // native(112) static final operator(40) string $ ( coerce string A, coerce string B ); native(168) static final k2pure operator(40) string @ ( coerce string A, coerce string B ); native(115) static final operator(24) bool < ( string A, string B ); native(116) static final operator(24) bool > ( string A, string B ); native(120) static final operator(24) bool <= ( string A, string B ); native(121) static final operator(24) bool >= ( string A, string B ); native(122) static final operator(24) bool == ( string A, string B ); native(123) static final operator(26) bool != ( string A, string B ); native(124) static final operator(24) bool ~= ( string A, string B ); native(322) static final operator(44) string $= ( out string A, coerce string B ); native(323) static final operator(44) string @= ( out string A, coerce string B ); native(324) static final operator(45) string -= ( out string A, coerce string B ); // // String functions. // native(125) static final function int Len ( coerce string S ); native(126) static final function int InStr ( coerce string S, coerce string t, optional bool bSearchFromRight, optional bool bIgnoreCase, optional int StartPos ); native(127) static final function string Mid ( coerce string S, int i, optional int j ); native(128) static final function string Left ( coerce string S, int i ); native(234) static final function string Right ( coerce string S, int i ); native(235) static final function string Caps ( coerce string S ); native(238) static final function string Locs ( coerce string S); native(236) static final function string Chr ( int i ); native(237) static final function int Asc ( string S ); native(201) static final function string Repl ( coerce string Src, coerce string Match, coerce string With, optional bool bCaseSensitive ); /** * Splits Text on the first Occurrence of Split and returns the remaining * part of Text. */ static final function string Split(coerce string Text, coerce string SplitStr, optional bool bOmitSplitStr) { local int pos; pos = InStr(Text,SplitStr); if (pos != -1) { if (bOmitSplitStr) { return Mid(Text,pos+Len(SplitStr)); } return Mid(Text,pos); } else { return Text; } } /** Get right most number from an actor name (ie Text == "CoverLink_45" returns "45") */ static final function string GetRightMost( coerce string Text ) { local int Idx; Idx = InStr(Text,"_"); while (Idx != -1) { Text = Mid(Text,Idx+1,Len(Text)); Idx = InStr(Text,"_"); } return Text; } /** * Create a single string from an array of strings, using the delimiter specified, optionally ignoring blank members * * @param StringArray the array of strings to join into the single string * @param out_Result [out] will contain a single string containing all elements of the array, separated by the delimiter specified * @param Delim the delimiter to insert where array elements are concatenated * @param bIgnoreBlanks TRUE to skip elements which contain emtpy strings */ static final function JoinArray(array<string> StringArray, out string out_Result, optional string delim = ",", optional bool bIgnoreBlanks = true) { local int i; out_Result = ""; for (i = 0; i < StringArray.Length; i++) { if ( (StringArray[i] != "") || (!bIgnoreBlanks) ) { if (out_Result != "" || (!bIgnoreBlanks && i > 0) ) out_Result $= delim; out_Result $= StringArray[i]; } } } /** * Breaks up a delimited string into elements of a string array. * * @param BaseString - The string to break up * @param Pieces - The array to fill with the string pieces * @param Delim - The string to delimit on * @param bCullEmpty - If true, empty strings are not added to the array */ native static final function ParseStringIntoArray(string BaseString, out array<string> Pieces, string Delim, bool bCullEmpty); /** * Wrapper for splitting a string into an array of strings using a single expression. */ static final function array<string> SplitString( string Source, optional string Delimiter=",", optional bool bCullEmpty ) { local array<string> Result; ParseStringIntoArray(Source, Result, Delimiter, bCullEmpty); return Result; } /** * Returns the full path name of the specified object (including package and groups), ie CheckObject::GetPathName(). */ native static final function string PathName(Object CheckObject); // // Object operators and functions. // native(114) static final operator(24) bool == ( Object A, Object B ); native(119) static final operator(26) bool != ( Object A, Object B ); native static final operator(24) bool == ( Interface A, Interface B ); native static final operator(26) bool != ( Interface A, Interface B ); /** * Determine if a class is a child of another class. * * @return TRUE if TestClass == ParentClass, or if TestClass is a child of ParentClass; FALSE otherwise, or if either * the value for either parameter is 'None'. */ native(258) static final function bool ClassIsChildOf( class TestClass, class ParentClass ); native(197) final function bool IsA( name ClassName ); // // Name operators. // native(254) static final operator(24) bool == ( name A, name B ); native(255) static final operator(26) bool != ( name A, name B ); // // Matrix operators and functions // native static final operator(34) matrix * (Matrix A, Matrix B); native static final function vector TransformVector(Matrix TM, vector A); native static final function vector InverseTransformVector(Matrix TM, vector A); native static final function vector TransformNormal(Matrix TM, vector A); native static final function vector InverseTransformNormal(Matrix TM, vector A); native static final function matrix MakeRotationTranslationMatrix(vector Translation, Rotator Rotation); native static final function matrix MakeRotationMatrix(Rotator Rotation); native static final function rotator MatrixGetRotator(Matrix TM); native static final function vector MatrixGetOrigin(Matrix TM); native static final function vector MatrixGetAxis(Matrix TM, EAxis Axis); // // Quaternion functions // native static final function Quat QuatProduct( Quat A, Quat B ); native static final function float QuatDot( Quat A, Quat B ); native static final function Quat QuatInvert( Quat A ); native static final function vector QuatRotateVector( Quat A, vector B ); native static final function Quat QuatFindBetween( Vector A, Vector B ); native static final function Quat QuatFromAxisAndAngle( Vector Axis, Float Angle ); native static final function Quat QuatFromRotator( rotator A ); native static final function rotator QuatToRotator( Quat A ); native static final function Quat QuatSlerp( Quat A, Quat B, float Alpha, optional bool bShortestPath ); native(270) static final operator(16) Quat + (Quat A, Quat B); native(271) static final operator(16) Quat - (Quat A, Quat B); // // Vector2D functions // native static final operator(16) vector2d + (vector2d A, vector2d B); native static final operator(16) vector2d - (vector2d A, vector2d B); native static final operator(16) vector2d * (vector2d A, float B); native static final operator(16) vector2d / (vector2d A, float B ); native static final operator(34) vector2d *= (out vector2d A, float B); native static final operator(34) vector2d /= (out vector2d A, float B); native static final operator(34) vector2d += (out vector2d A, vector2d B); native static final operator(34) vector2d -= (out vector2d A, vector2d B); /** * Returns the value in the Range, relative to Pct. * Examples: * - GetRangeValueByPct( Range, 0.f ) == Range.X * - GetRangeValueByPct( Range, 1.f ) == Range.Y * - GetRangeValueByPct( Range, 0.5 ) == (Range.X+Range.Y)/2 * * @param Range Range of values. [Range.X,Range.Y] * @param Pct Relative position in range in percentage. [0,1] * * @return the value in the Range, relative to Pct. */ static final simulated function float GetRangeValueByPct( Vector2D Range, float Pct ) { return ( Range.X + (Range.Y-Range.X) * Pct ); } /** * Returns the relative percentage position Value is in the Range. * Examples: * - GetRangeValueByPct( Range, Range.X ) == 0 * - GetRangeValueByPct( Range, Range.Y ) == 1 * - GetRangeValueByPct( Range, (Range.X+Range.Y)/2 ) == 0.5 * * @param Range Range of values. [Range.X,Range.Y] * @param Value Value between Range. * * @return relative percentage position Value is in the Range. */ static final simulated function float GetRangePctByValue( Vector2D Range, float Value ) { return (Range.Y == Range.X) ? Range.X : (Value - Range.X) / (Range.Y - Range.X); } /** * Useful for mapping a value in one value range to a different value range. Output is clamped to the OutputRange. * e.g. given that velocities [50..100] correspond to a sound volume of [0.2..1.4], find the * volume for a velocity of 77. */ static final simulated native function float GetMappedRangeValue(vector2d InputRange, vector2d OutputRange, float Value); /** Construct a vector2d variable */ static final function vector2d vect2d( float InX, float InY ) { local vector2d NewVect2d; NewVect2d.X = InX; NewVect2d.Y = InY; return NewVect2d; } /** Evaluate a float curve for an input of InVal */ native final function float EvalInterpCurveFloat(InterpCurveFloat FloatCurve, float InVal); /** Evaluate a vector curve for an input of InVal */ native final function vector EvalInterpCurveVector(InterpCurveVector VectorCurve, float InVal); /** Evaluate a vector2D curve for an input of InVal */ native final function vector2D EvalInterpCurveVector2D(InterpCurveVector2D Vector2DCurve, float InVal); // // Color functions // static final operator(20) color - (color A, color B) { A.R -= B.R; A.G -= B.G; A.B -= B.B; return A; } static final operator(16) color * (float A, color B) { B.R *= A; B.G *= A; B.B *= A; return B; } static final operator(16) color * (color A, float B) { A.R *= B; A.G *= B; A.B *= B; return A; } static final operator(20) color + (color A, color B) { A.R += B.R; A.G += B.G; A.B += B.B; return A; } /** Create a Color from independant RGBA components */ static final function Color MakeColor(byte R, byte G, byte B, optional byte A) { local Color C; C.R = R; C.G = G; C.B = B; C.A = A; return C; } /** Util to interpolate between two colors */ static final function Color LerpColor(Color A, Color B, float Alpha) { local vector FloatA, FloatB, FloatResult; local float AlphaA, AlphaB, FloatResultAlpha; local color Result; FloatA.X = A.R; FloatA.Y = A.G; FloatA.Z = A.B; AlphaA = A.A; FloatB.X = B.R; FloatB.Y = B.G; FloatB.Z = B.B; AlphaB = B.A; FloatResult = FloatA + ((FloatB - FloatA) * FClamp(Alpha, 0.0, 1.0)); FloatResultAlpha = AlphaA + ((AlphaB - AlphaA) * FClamp(Alpha, 0.0, 1.0)); Result.R = FloatResult.X; Result.G = FloatResult.Y; Result.B = FloatResult.Z; Result.A = FloatResultAlpha; return Result; } // // Linear Color Functions // /** Create a LinearColor from independant RGBA components. */ static final function LinearColor MakeLinearColor( float R, float G, float B, float A ) { local LinearColor LC; LC.R = R; LC.G = G; LC.B = B; LC.A = A; return LC; } /** converts a color to a LinearColor * @param OldColor the color to convert * @return the matching LinearColor */ static final function LinearColor ColorToLinearColor(color OldColor) { return MakeLinearColor(float(OldColor.R) / 255.0, float(OldColor.G) / 255.0, float(OldColor.B) / 255.0, float(OldColor.A) / 255.0); } /** multiply the RGB components of a LinearColor by a float */ static final operator(16) LinearColor * (LinearColor LC, float Mult) { LC.R *= Mult; LC.G *= Mult; LC.B *= Mult; return LC; } /** subtract the RGB components of B from the RGB components of A */ static final operator(20) LinearColor - (LinearColor A, LinearColor B) { A.R -= B.R; A.G -= B.G; A.B -= B.B; return A; } //============================================================================= // General functions. // this define allows us to detect code that is directly calling functions that should only be called through a macro, such as // LogInternal & WarnInternal `if(`isdefined(FINAL_RELEASE)) `if(`isdefined(FINAL_RELEASE_DEBUGCONSOLE)) `define prevent_direct_calls `else `define prevent_direct_calls private `endif `else `define prevent_direct_calls `endif // // Logging. // /** * Writes a message to the log. This function should never be called directly - use the `log macro instead, which has the following signature: * * log( coerce string Msg, optional bool bCondition=true, optional name LogTag='ScriptLog' ); * * @param Msg the string to print to the log * @param bCondition if specified, the message is only printed to the log if this condition is satisfied. * @param LogTag if specified, the message will be prepended with this tag in the log file * */ native(231) final static `{prevent_direct_calls} function LogInternal( coerce string S, optional name Tag ); /** * Same as calling LogInternal(SomeMsg, 'Warning'); This function should never be called directly - use the `warn macro instead, which has the following signature: * * warn( coerce string Msg, optional bool bCondition=true ); */ native(232) final static `{prevent_direct_calls} function WarnInternal( coerce string S ); native static function string Localize( string SectionName, string KeyName, string PackageName ); /** given a path to a localized key of the form "Package.Section.Name", * return the appropriate value from the localization file for the current language */ static final function string ParseLocalizedPropertyPath(string PathName) { local array<string> Pieces; ParseStringIntoArray(PathName, Pieces, ".", false); if (Pieces.length >= 3) { return Localize(Pieces[1], Pieces[2], Pieces[0]); } else { return ""; } } /** * Dumps the current script function stack to the log file, useful * for debugging. */ native static final function ScriptTrace(); /** * Gets the current script function stack back so you can log it to a specific log location (e.g. AILog). */ native static final function String GetScriptTrace(); /** * Script-induced breakpoint. Useful for examining state with the debugger at a particular point in script. * * @param UserFlags user-defined flags to be used for e.g. indentifying different calls to DebugBreak in the same session * @param DebuggerType C++ debugger, UScript debugger, or both */ native static final function DebugBreak( optional int UserFlags, optional EDebugBreakType DebuggerType=DEBUGGER_NativeOnly ); /** * Returns the current calling function's name, useful for * debugging. */ native static final function Name GetFuncName(); /** * Enables/disables script function call trace logging. */ native static final function SetUTracing( bool bShouldUTrace ); /** * Returns whether script function call trace logging is currently enabled. */ native static final function bool IsUTracing(); // // Goto state and label. // /** * Transitions to the desired state and label if specified, * generating the EndState event in the current state if applicable * and BeginState in the new state, unless transitioning to the same * state. * * @param NewState - new state to transition to * * @param Label - optional Label to jump to * * @param bForceEvents - optionally force EndState/BeginState to be * called even if transitioning to the same state. * * @param bKeepStack - prevents state stack from being cleared */ native(113) final function GotoState( optional name NewState, optional name Label, optional bool bForceEvents, optional bool bKeepStack ); /** * Checks the current state and determines whether or not this object * is actively in the specified state. Note: This does work with * inherited states. * * @param TestState - state to check for * @param bTestStateStack - check the state stack? (does *NOT* work with inherited states in the stack) * * @return True if currently in TestState */ native(281) final function bool IsInState( name TestState, optional bool bTestStateStack ); /** * Returns true if TestState derives from TestParentState. */ native final function bool IsChildState(Name TestState, Name TestParentState); /** * Returns the current state name, useful for determining current * state similar to IsInState. Note: This *doesn't* work with * inherited states, in that it will only compare at the lowest * state level. * * @return Name of the current state */ native(284) final function name GetStateName(); /** * Pushes the new state onto the state stack, setting it as the * current state until a matching PopState() is called. Note that * multiple states may be pushed on top of each other. * You may not push the same state multiple times. * * This will call PushedState when entering the state that was just * pushed on the state stack. It will not call BeginState. * @see event PushedState * @see event ContinuedState * * @param NewState - name of the state to push on the stack * * @param NewLabel - optional name of the state label to jump to */ native final function PushState(Name NewState, optional Name NewLabel); /** * Pops the current pushed state, returning execution to the previous * state at the same code point. Note: PopState() will have no effect * if no state has been pushed onto the stack. * * This will call PoppedState when entering the state that was just * pushed on the state stack. It will not call EndState. * @see event PoppedState * @see event PausedState * * @param bPopAll - optionally pop all states on the stack to the * originally executing one */ native final function PopState(optional bool bPopAll); /** * Logs the current state stack for debugging purposes. */ native final function DumpStateStack(); // // State notification events // /** * Called immediately when entering a state, while within the * GotoState() call that caused the state change (before any * state code is executed). */ event BeginState(Name PreviousStateName); /** * Called immediately before going out of the current state, while * within the GotoState() call that caused the state change, and * before BeginState() is called within the new state. */ event EndState(Name NextStateName); /** * Called immediately in the new state that was pushed onto the * state stack, before any state code is executed. */ event PushedState(); /** * Called immediately in the current state that is being popped off * of the state stack, before the new state is activated. */ event PoppedState(); /** * Called on the state that is being paused because of a PushState(). */ event PausedState(); /** * Called on the state that is no longer paused because of a PopState(). */ event ContinuedState(); // // Probe messages. // native(117) final function Enable( name ProbeFunc ); native(118) final function Disable( name ProbeFunc ); // // Object handling. // native static final function name GetEnum( object E, coerce int i ); native static final function object DynamicLoadObject( string ObjectName, class ObjectClass, optional bool MayFail ); native static final function object FindObject( string ObjectName, class ObjectClass ); // // Configuration. // native(536) final function SaveConfig(); native static final function StaticSaveConfig(); /* /** * Saves the current value for all configurable properties in this object to the .ini file. The values for any global config * properties will be propagated to all child classes. * * @param bRefreshInstances if TRUE, all instances of this class will re-load the values for their configurable properties * from the .ini. THIS WILL CLOBBER ANY EXISTING VALUES! * @param PropertyName if specified, only this property's value will be saved. */ native(536) final function SaveConfig( optional bool bRefreshInstances, optional string PropertyName ); /** * Saves the default values for all configurable properties in this object's class to the .ini file. The values for any global config * properties will be propagated to all child classes. * * @param bRefreshInstances if TRUE, all instances of this class will re-load the values for their configurable properties * from the .ini. THIS WILL CLOBBER ANY EXISTING VALUES! * @param PropertyName if specified, only this property's value will be saved. */ native static final function StaticSaveConfig( optional bool bRefreshInstances, optional string PropertyName ); /** * Resets the values for configurable properties in this object's class back to the values in the corresponding Default*.ini file. * * @param bRefreshInstances if TRUE, all instances of this class will re-load the values for their configurable properties * from the .ini. THIS WILL CLOBBER ANY EXISTING VALUES! * @param PropertyName if specified, only this property's value will be reset. */ native static final function ResetConfig( optional bool bRefreshInstances, optional string PropertyName ); /** * Removes the values for all configurable properties in this object's class from the .ini file. * * @param PropertyName if specified, only this property's value will be removed. */ native(537) final function ClearConfig( optional string PropertyName ); /** * Removes the values for all configurable properties in this object's class from the .ini file. * * @param PropertyName if specified, only this property's value will be removed. */ native static final function StaticClearConfig( optional string PropertyName ); */ /** * Retrieve the names of sections which contain data for the specified PerObjectConfig class. * * @param SearchClass the PerObjectConfig class to retrieve sections for. * @param out_SectionNames will receive the list of section names that correspond to PerObjectConfig sections of the specified class * @param ObjectOuter the Outer to use for determining which file to look in. Specify the same object that is used when creating the PerObjectConfig * objects that sections are being retrieved for. (PerObjectConfig data is generally stored in a file named after the Outer used when * creating those objects, unless the PerObjectConfig class specifies a config file in its class declaration); * specify None to use the transient package as the Outer. * @param MaxResults the maximum number of section names to retrieve * * @return TRUE if the file specified was found and it contained at least 1 section for the specified class */ native static final function bool GetPerObjectConfigSections( class SearchClass, out array<string> out_SectionNames, optional Object ObjectOuter, optional int MaxResults=1024 ); // // Maths // /** * Calculates the distance of a given Point in world space to a given line, * defined by the vector couple (Origin, Direction). * * @param Point point to check distance to Axis * @param Line unit vector indicating the direction to check against * @param Origin point of reference used to calculate distance * @param OutClosestPoint optional point that represents the closest point projected onto Axis * * @return distance of Point from line defined by (Origin, Direction) */ native final function float PointDistToLine(vector Point, vector Line, vector Origin, optional out vector OutClosestPoint); /** * Returns closest distance from a point to a segment. * * @param Point point to check distance for * @param StartPoint StartPoint of segment * @param EndPoint EndPoint of segment * @param OutClosestPoint Closest point on segment. * * @return closest distance from Point to segment defined by (StartPoint, EndPoint). */ native final function float PointDistToSegment(Vector Point, Vector StartPoint, Vector EndPoint, optional out Vector OutClosestPoint); /** * Calculates the distance of a given point to the given plane. (defined by a combination of vector and rotator) * Rotator.AxisX = U, Rotator.AxisY = Normal, Rotator.AxisZ = V * * @param Point Point to check distance to Orientation * @param Orientation Rotator indicating the direction to check against * @param Origin Point of reference used to calculate distance * @param out_ClosestPoint Optional point that represents the closest point projected onto Plane defined by the couple (Origin, Orientation) * * @return distance of Point to plane */ simulated final function float PointDistToPlane( Vector Point, Rotator Orientation, Vector Origin, optional out vector out_ClosestPoint ) { local vector AxisX, AxisY, AxisZ, PointNoZ, OriginNoZ; local float fPointZ, fProjDistToAxis; // Get orientation axis' GetAxes(Orientation, AxisX, AxisY, AxisZ); // Remove Z component of Point Location fPointZ = Point dot AxisZ; PointNoZ = Point - fPointZ * AxisZ; // Remove Z component of Origin OriginNoZ = Origin - (Origin dot AxisZ) * AxisZ; // Projected distance of Point onto AxisX. fProjDistToAxis = (PointNoZ - OriginNoZ) Dot AxisX; out_ClosestPoint = OriginNoZ + fProjDistToAxis * AxisX + fPointZ * AxisZ; // return distance to closest point return VSize(out_ClosestPoint-Point); } /** * Calculates a point's projection onto a plane * @param Point point to project onto the plane * @param A point on plane * @param B point on plane * @param C point on plane * @return projection of point onto the plane defined by ABC */ native static final function Vector PointProjectToPlane(Vector Point, Vector A, Vector B, Vector C); /** * Calculates the dotted distance of vector 'Direction' to coordinate system O(AxisX,AxisY,AxisZ). * * Orientation: (consider 'O' the first person view of the player, and 'Direction' a vector pointing to an enemy) * - positive azimuth means enemy is on the right of crosshair. (negative means left). * - positive elevation means enemy is on top of crosshair, negative means below. * * @Note: 'Azimuth' (.X) sign is changed to represent left/right and not front/behind. front/behind is the funtion's return value. * * @param OutDotDist .X = 'Direction' dot AxisX relative to plane (AxisX,AxisZ). (== Cos(Azimuth)) * .Y = 'Direction' dot AxisX relative to plane (AxisX,AxisY). (== Sin(Elevation)) * @param Direction direction of target. * @param AxisX X component of reference system. * @param AxisY Y component of reference system. * @param AxisZ Z component of reference system. * * @return true if 'Direction' is facing AxisX (Direction dot AxisX >= 0.f) */ native static final function bool GetDotDistance ( out Vector2D OutDotDist, Vector Direction, Vector AxisX, Vector AxisY, Vector AxisZ ); /** * Calculates the angular distance of vector 'Direction' to coordinate system O(AxisX,AxisY,AxisZ). * * Orientation: (consider 'O' the first person view of the player, and 'Direction' a vector pointing to an enemy) * - positive azimuth means enemy is on the right of crosshair. (negative means left). * - positive elevation means enemy is on top of crosshair, negative means below. * * @param out_AngularDist .X = Azimuth angle (in radians) of 'Direction' vector compared to plane (AxisX,AxisZ). * .Y = Elevation angle (in radians) of 'Direction' vector compared to plane (AxisX,AxisY). * @param Direction Direction of target. * @param AxisX X component of reference system. * @param AxisY Y component of reference system. * @param AxisZ Z component of reference system. * * @output true if 'Direction' is facing AxisX (Direction dot AxisX >= 0.f) */ native static final function bool GetAngularDistance ( out Vector2D OutAngularDist, Vector Direction, Vector AxisX, Vector AxisY, Vector AxisZ ); /** * Converts Dot distance to angular distance. * @see GetAngularDistance() and GetDotDistance(). * * @param OutAngDist Angular distance in radians. * @param DotDist Dot distance. */ native static final function GetAngularFromDotDist( out Vector2D OutAngDist, Vector2D DotDist ); /* transforms angular distance in radians to degrees */ static final simulated function GetAngularDegreesFromRadians( out Vector2D OutFOV ) { OutFOV.X = OutFOV.X*RadToDeg; OutFOV.Y = OutFOV.Y*RadToDeg; } /** * Returns world space angle (in radians) of given vector * * @param Dir Vector to be converted into heading angle */ static final simulated function float GetHeadingAngle( Vector Dir ) { local float Angle; Angle = Acos( FClamp( Dir.X, -1.f, 1.f ) ); if( Dir.Y < 0.f ) { Angle *= -1.f; } return Angle; } /** * Gets the difference in world space angles in [-PI,PI] range * * @param A1 First angle * @param A2 Second angle */ static final simulated function float FindDeltaAngle( float A1, float A2 ) { local float Delta; // Find the difference Delta = A2 - A1; // If change is larger than PI if( Delta > PI ) { // Flip to negative equivalent Delta = Delta - (PI * 2.f); } else if( delta < -PI ) { // Otherwise, if change is smaller than -PI // Flip to positive equivalent Delta = Delta + (PI * 2.f); } // Return delta in [-PI,PI] range return Delta; } static final simulated function float UnwindHeading( float a ) { while( a > PI ) { a -= (PI * 2.0f); } while( a < -PI ) { a += (PI * 2.0f); } return a; } /** * Converts a float value to a 0-255 byte, assuming a range of * 0.f to 1.f. * * @param inputFloat - float to convert * * @param bSigned - optional, assume a range of -1.f to 1.f * * @return byte value 0-255 */ simulated final function byte FloatToByte(float inputFloat, optional bool bSigned) { if (bSigned) { // handle a 0.02f threshold so we can guarantee valid 0/255 values if (inputFloat > 0.98f) { return 255; } else if (inputFloat < -0.98f) { return 0; } else { return byte((inputFloat+1.f)*128.f); } } else { if (inputFloat > 0.9961f) { return 255; } else if (inputFloat < 0.004f) { return 0; } else { return byte(inputFloat*255.f); } } } /** * Converts a 0-255 byte to a float value, to a range of 0.f * to 1.f. * * @param inputByte - byte to convert * * @param bSigned - optional, spit out -1.f to 1.f instead * * @return newly converted value */ simulated final function float ByteToFloat(byte inputByte, optional bool bSigned) { if( bSigned ) { return ((float(inputByte)/128.f)-1.f); } else { return (float(inputByte)/255.f); } } /** * Returns whether the object is pending kill and about to have references to it NULLed by * the garbage collector. * * @return TRUE if object is pending kill, FALSE otherwise */ native final function bool IsPendingKill(); /** @return the name of the package this object resides in */ final function name GetPackageName() { local Object O; O = self; while (O.Outer != None) { O = O.Outer; } return O.Name; } /** * Script hook to FRotationMatrix::TransformFVector(). */ native final function vector TransformVectorByRotation(rotator SourceRotation, vector SourceVector, optional bool bInverse); /** * Returns a string containing a system timestamp */ native final function string TimeStamp(); /** * Return the system time components. */ native final function GetSystemTime( out int Year, out int Month, out int DayOfWeek, out int Day, out int Hour, out int Min, out int Sec, out int MSec ); /** @return the current engine version number for this build */ native final function int GetEngineVersion(); /** @return the changelist number that was used when generating this build */ native final function int GetBuildChangelistNumber(); defaultproperties { } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |