home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Core / Classes / Object.uc < prev    next >
Text File  |  2003-08-27  |  17KB  |  409 lines

  1. //=============================================================================
  2. // Object: The base class all objects.
  3. // This is a built-in Unreal class and it shouldn't be modified.
  4. //=============================================================================
  5. class Object
  6.     native
  7.     noexport;
  8.  
  9. //=============================================================================
  10. // UObject variables.
  11.  
  12. // Internal variables.
  13. var native private const int ObjectInternal[6];
  14. var native const object Outer;
  15. var native const int ObjectFlags;
  16. var(Object) native const editconst name Name;
  17. var native const editconst class Class;
  18.  
  19. //=============================================================================
  20. // Unreal base structures.
  21.  
  22. // Object flags.
  23. const RF_Transactional    = 0x00000001; // Supports editor undo/redo.
  24. const RF_Public         = 0x00000004; // Can be referenced by external package files.
  25. const RF_Transient      = 0x00004000; // Can't be saved or loaded.
  26. const RF_NotForClient    = 0x00100000; // Don't load for game client.
  27. const RF_NotForServer    = 0x00200000; // Don't load for game server.
  28. const RF_NotForEdit        = 0x00400000; // Don't load for editor.
  29.  
  30. // A globally unique identifier.
  31. struct Guid
  32. {
  33.     var int A, B, C, D;
  34. };
  35.  
  36. // A point or direction vector in 3d space.
  37. struct Vector
  38. {
  39.     var() config float X, Y, Z;
  40. };
  41.  
  42. // A plane definition in 3d space.
  43. struct Plane extends Vector
  44. {
  45.     var() config float W;
  46. };
  47.  
  48. // An orthogonal rotation in 3d space.
  49. struct Rotator
  50. {
  51.     var() config int Pitch, Yaw, Roll;
  52. };
  53.  
  54. // An arbitrary coordinate system in 3d space.
  55. struct Coords
  56. {
  57.     var() config vector Origin, XAxis, YAxis, ZAxis;
  58. };
  59.  
  60. // Quaternion
  61. struct Quat
  62. {
  63.     var() config float X, Y, Z, W;
  64. };
  65.  
  66. // Used to generate random values between Min and Max
  67. struct Range
  68. {
  69.     var() config float Min;
  70.     var() config float Max;
  71. };
  72.  
  73. // Vector of Ranges
  74. struct RangeVector
  75. {
  76.     var() config range X;
  77.     var() config range Y;
  78.     var() config range Z;
  79. };
  80.  
  81. // A scale and sheering.
  82. struct Scale
  83. {
  84.     var() config vector Scale;
  85.     var() config float SheerRate;
  86.     var() config enum ESheerAxis
  87.     {
  88.         SHEER_None,
  89.         SHEER_XY,
  90.         SHEER_XZ,
  91.         SHEER_YX,
  92.         SHEER_YZ,
  93.         SHEER_ZX,
  94.         SHEER_ZY,
  95.     } SheerAxis;
  96. };
  97.  
  98. // Camera orientations for Matinee
  99. enum ECamOrientation
  100. {
  101.     CAMORIENT_None,
  102.     CAMORIENT_LookAtActor,
  103.     CAMORIENT_FacePath,
  104.     CAMORIENT_Interpolate,
  105.     CAMORIENT_Dolly,
  106. };
  107.  
  108. // Generic axis enum.
  109. enum EAxis
  110. {
  111.     AXIS_X,
  112.     AXIS_Y,
  113.     AXIS_Z
  114. };
  115.  
  116. // A color.
  117. struct Color
  118. {
  119.     var() config byte B, G, R, A;
  120. };
  121.  
  122. // A bounding box.
  123. struct Box
  124. {
  125.     var vector Min, Max;
  126.     var byte IsValid;
  127. };
  128.  
  129. // A bounding box sphere together.
  130. struct BoundingVolume extends Box
  131. {
  132.     var plane Sphere;
  133. };
  134.  
  135. // a 4x4 matrix
  136. struct Matrix
  137. {
  138.     var() Plane XPlane;
  139.     var() Plane YPlane;
  140.     var() Plane ZPlane;
  141.     var() Plane WPlane;
  142. };
  143.  
  144. // A interpolated function
  145. struct InterpCurvePoint
  146. {
  147.     var() float InVal;
  148.     var() float OutVal;
  149. };
  150.  
  151. struct InterpCurve
  152. {
  153.     var() array<InterpCurvePoint>    Points;
  154. };
  155.  
  156. struct CompressedPosition
  157. {
  158.     var vector Location;
  159.     var rotator Rotation;
  160.     var vector Velocity;
  161. };
  162.  
  163. //=============================================================================
  164. // Constants.
  165.  
  166. const MaxInt = 0x7fffffff;
  167. const Pi     = 3.1415926535897932;
  168.  
  169. //=============================================================================
  170. // Basic native operators and functions.
  171.  
  172. // Bool operators.
  173. native(129) static final preoperator  bool  !  ( bool A );
  174. native(242) static final operator(24) bool  == ( bool A, bool B );
  175. native(243) static final operator(26) bool  != ( bool A, bool B );
  176. native(130) static final operator(30) bool  && ( bool A, skip bool B );
  177. native(131) static final operator(30) bool  ^^ ( bool A, bool B );
  178. native(132) static final operator(32) bool  || ( bool A, skip bool B );
  179.  
  180. // Byte operators.
  181. native(133) static final operator(34) byte *= ( out byte A, byte B );
  182. native(134) static final operator(34) byte /= ( out byte A, byte B );
  183. native(135) static final operator(34) byte += ( out byte A, byte B );
  184. native(136) static final operator(34) byte -= ( out byte A, byte B );
  185. native(137) static final preoperator  byte ++ ( out byte A );
  186. native(138) static final preoperator  byte -- ( out byte A );
  187. native(139) static final postoperator byte ++ ( out byte A );
  188. native(140) static final postoperator byte -- ( out byte A );
  189.  
  190. // Integer operators.
  191. native(141) static final preoperator  int  ~  ( int A );
  192. native(143) static final preoperator  int  -  ( int A );
  193. native(144) static final operator(16) int  *  ( int A, int B );
  194. native(145) static final operator(16) int  /  ( int A, int B );
  195. native(146) static final operator(20) int  +  ( int A, int B );
  196. native(147) static final operator(20) int  -  ( int A, int B );
  197. native(148) static final operator(22) int  << ( int A, int B );
  198. native(149) static final operator(22) int  >> ( int A, int B );
  199. native(196) static final operator(22) int  >>>( int A, int B );
  200. native(150) static final operator(24) bool <  ( int A, int B );
  201. native(151) static final operator(24) bool >  ( int A, int B );
  202. native(152) static final operator(24) bool <= ( int A, int B );
  203. native(153) static final operator(24) bool >= ( int A, int B );
  204. native(154) static final operator(24) bool == ( int A, int B );
  205. native(155) static final operator(26) bool != ( int A, int B );
  206. native(156) static final operator(28) int  &  ( int A, int B );
  207. native(157) static final operator(28) int  ^  ( int A, int B );
  208. native(158) static final operator(28) int  |  ( int A, int B );
  209. native(159) static final operator(34) int  *= ( out int A, float B );
  210. native(160) static final operator(34) int  /= ( out int A, float B );
  211. native(161) static final operator(34) int  += ( out int A, int B );
  212. native(162) static final operator(34) int  -= ( out int A, int B );
  213. native(163) static final preoperator  int  ++ ( out int A );
  214. native(164) static final preoperator  int  -- ( out int A );
  215. native(165) static final postoperator int  ++ ( out int A );
  216. native(166) static final postoperator int  -- ( out int A );
  217.  
  218. // Integer functions.
  219. native(167) static final Function     int  Rand  ( int Max );
  220. native(249) static final function     int  Min   ( int A, int B );
  221. native(250) static final function     int  Max   ( int A, int B );
  222. native(251) static final function     int  Clamp ( int V, int A, int B );
  223.  
  224. // Float operators.
  225. native(169) static final preoperator  float -  ( float A );
  226. native(170) static final operator(12) float ** ( float A, float B );
  227. native(171) static final operator(16) float *  ( float A, float B );
  228. native(172) static final operator(16) float /  ( float A, float B );
  229. native(173) static final operator(18) float %  ( float A, float B );
  230. native(174) static final operator(20) float +  ( float A, float B );
  231. native(175) static final operator(20) float -  ( float A, float B );
  232. native(176) static final operator(24) bool  <  ( float A, float B );
  233. native(177) static final operator(24) bool  >  ( float A, float B );
  234. native(178) static final operator(24) bool  <= ( float A, float B );
  235. native(179) static final operator(24) bool  >= ( float A, float B );
  236. native(180) static final operator(24) bool  == ( float A, float B );
  237. native(210) static final operator(24) bool  ~= ( float A, float B );
  238. native(181) static final operator(26) bool  != ( float A, float B );
  239. native(182) static final operator(34) float *= ( out float A, float B );
  240. native(183) static final operator(34) float /= ( out float A, float B );
  241. native(184) static final operator(34) float += ( out float A, float B );
  242. native(185) static final operator(34) float -= ( out float A, float B );
  243.  
  244. // Float functions.
  245. native(186) static final function     float Abs   ( float A );
  246. native(187) static final function     float Sin   ( float A );
  247. native      static final function      float Asin  ( float A );
  248. native(188) static final function     float Cos   ( float A );
  249. native      static final function     float Acos  ( float A );
  250. native(189) static final function     float Tan   ( float A );
  251. native(190) static final function     float Atan  ( float A, float B ); 
  252. native(191) static final function     float Exp   ( float A );
  253. native(192) static final function     float Loge  ( float A );
  254. native(193) static final function     float Sqrt  ( float A );
  255. native(194) static final function     float Square( float A );
  256. native(195) static final function     float FRand ();
  257. native(244) static final function     float FMin  ( float A, float B );
  258. native(245) static final function     float FMax  ( float A, float B );
  259. native(246) static final function     float FClamp( float V, float A, float B );
  260. native(247) static final function     float Lerp  ( float Alpha, float A, float B );
  261. native(248) static final function     float Smerp ( float Alpha, float A, float B );
  262.  
  263. // Vector operators.
  264. native(211) static final preoperator  vector -     ( vector A );
  265. native(212) static final operator(16) vector *     ( vector A, float B );
  266. native(213) static final operator(16) vector *     ( float A, vector B );
  267. native(296) static final operator(16) vector *     ( vector A, vector B );
  268. native(214) static final operator(16) vector /     ( vector A, float B );
  269. native(215) static final operator(20) vector +     ( vector A, vector B );
  270. native(216) static final operator(20) vector -     ( vector A, vector B );
  271. native(275) static final operator(22) vector <<    ( vector A, rotator B );
  272. native(276) static final operator(22) vector >>    ( vector A, rotator B );
  273. native(217) static final operator(24) bool   ==    ( vector A, vector B );
  274. native(218) static final operator(26) bool   !=    ( vector A, vector B );
  275. native(219) static final operator(16) float  Dot   ( vector A, vector B );
  276. native(220) static final operator(16) vector Cross ( vector A, vector B );
  277. native(221) static final operator(34) vector *=    ( out vector A, float B );
  278. native(297) static final operator(34) vector *=    ( out vector A, vector B );
  279. native(222) static final operator(34) vector /=    ( out vector A, float B );
  280. native(223) static final operator(34) vector +=    ( out vector A, vector B );
  281. native(224) static final operator(34) vector -=    ( out vector A, vector B );
  282.  
  283. // Vector functions.
  284. native(225) static final function float  VSize  ( vector A );
  285. native(226) static final function vector Normal ( vector A );
  286. native(227) static final function        Invert ( out vector X, out vector Y, out vector Z );
  287. native(252) static final function vector VRand  ( );
  288. native(300) static final function vector MirrorVectorByNormal( vector Vect, vector Normal );
  289.  
  290. // Rotator operators and functions.
  291. native(142) static final operator(24) bool ==     ( rotator A, rotator B );
  292. native(203) static final operator(26) bool !=     ( rotator A, rotator B );
  293. native(287) static final operator(16) rotator *   ( rotator A, float    B );
  294. native(288) static final operator(16) rotator *   ( float    A, rotator B );
  295. native(289) static final operator(16) rotator /   ( rotator A, float    B );
  296. native(290) static final operator(34) rotator *=  ( out rotator A, float B  );
  297. native(291) static final operator(34) rotator /=  ( out rotator A, float B  );
  298. native(316) static final operator(20) rotator +   ( rotator A, rotator B );
  299. native(317) static final operator(20) rotator -   ( rotator A, rotator B );
  300. native(318) static final operator(34) rotator +=  ( out rotator A, rotator B );
  301. native(319) static final operator(34) rotator -=  ( out rotator A, rotator B );
  302. native(229) static final function GetAxes         ( rotator A, out vector X, out vector Y, out vector Z );
  303. native(230) static final function GetUnAxes       ( rotator A, out vector X, out vector Y, out vector Z );
  304. native(320) static final function rotator RotRand ( optional bool bRoll );
  305. native      static final function rotator OrthoRotation( vector X, vector Y, vector Z );
  306. native      static final function rotator Normalize( rotator Rot );
  307. native        static final operator(24) bool ClockwiseFrom( int A, int B );
  308.  
  309. // String operators.
  310. native(112) static final operator(40) string $  ( coerce string A, coerce string B );
  311. native(168) static final operator(40) string @  ( coerce string A, coerce string B );
  312. native(115) static final operator(24) bool   <  ( string A, string B );
  313. native(116) static final operator(24) bool   >  ( string A, string B );
  314. native(120) static final operator(24) bool   <= ( string A, string B );
  315. native(121) static final operator(24) bool   >= ( string A, string B );
  316. native(122) static final operator(24) bool   == ( string A, string B );
  317. native(123) static final operator(26) bool   != ( string A, string B );
  318. native(124) static final operator(24) bool   ~= ( string A, string B );
  319.  
  320. // String functions.
  321. native(125) static final function int    Len    ( coerce string S );
  322. native(126) static final function int    InStr  ( coerce string S, coerce string t );
  323. native(127) static final function string Mid    ( coerce string S, int i, optional int j );
  324. native(128) static final function string Left   ( coerce string S, int i );
  325. native(234) static final function string Right  ( coerce string S, int i );
  326. native(235) static final function string Caps   ( coerce string S );
  327. native(236) static final function string Chr    ( int i );
  328. native(237) static final function int    Asc    ( string S );
  329.  
  330. // Object operators.
  331. native(114) static final operator(24) bool == ( Object A, Object B );
  332. native(119) static final operator(26) bool != ( Object A, Object B );
  333.  
  334. // Name operators.
  335. native(254) static final operator(24) bool == ( name A, name B );
  336. native(255) static final operator(26) bool != ( name A, name B );
  337.  
  338. // InterpCurve operator
  339. native        static final function float InterpCurveEval( InterpCurve curve, float input );
  340. native        static final function InterpCurveGetOutputRange( InterpCurve curve, out float min, out float max );
  341. native        static final function InterpCurveGetInputDomain( InterpCurve curve, out float min, out float max );
  342.  
  343. // Quaternion functions
  344. native        static final function Quat QuatProduct( Quat A, Quat B );
  345. native        static final function Quat QuatInvert( Quat A );
  346. native        static final function vector QuatRotateVector( Quat A, vector B );
  347. native        static final function Quat QuatFindBetween( Vector A, Vector B );
  348. native        static final function Quat QuatFromAxisAndAngle( Vector Axis, Float Angle );
  349. native        static final function Quat QuatFromRotator( rotator A );
  350. native        static final function rotator QuatToRotator( Quat A );
  351.  
  352. //=============================================================================
  353. // General functions.
  354.  
  355. // Logging.
  356. native(231) final static function Log( coerce string S, optional name Tag );
  357. native(232) final static function Warn( coerce string S );
  358. native static function string Localize( string SectionName, string KeyName, string PackageName );
  359.  
  360. // Goto state and label.
  361. native(113) final function GotoState( optional name NewState, optional name Label );
  362. native(281) final function bool IsInState( name TestState );
  363. native(284) final function name GetStateName();
  364.  
  365. // Objects.
  366. native(258) static final function bool ClassIsChildOf( class TestClass, class ParentClass );
  367. native(303) final function bool IsA( name ClassName );
  368.  
  369. // Probe messages.
  370. native(117) final function Enable( name ProbeFunc );
  371. native(118) final function Disable( name ProbeFunc );
  372.  
  373. // Properties.
  374. native final function string GetPropertyText( string PropName );
  375. native final function SetPropertyText( string PropName, string PropValue );
  376. native static final function name GetEnum( object E, int i );
  377. native static final function object DynamicLoadObject( string ObjectName, class ObjectClass, optional bool MayFail );
  378. native static final function object FindObject( string ObjectName, class ObjectClass );
  379.  
  380. // Configuration.
  381. native(536) final function SaveConfig();
  382. native static final function StaticSaveConfig();
  383. native static final function ResetConfig();
  384.  
  385. // Return a random number within the given range.
  386. final function float RandRange( float Min, float Max )
  387. {
  388.     return Min + (Max - Min) * FRand();
  389. }
  390.  
  391. //=============================================================================
  392. // Engine notification functions.
  393.  
  394. //
  395. // Called immediately when entering a state, while within
  396. // the GotoState call that caused the state change.
  397. //
  398. event BeginState();
  399.  
  400. //
  401. // Called immediately before going out of the current state,
  402. // while within the GotoState call that caused the state change.
  403. // 
  404. event EndState();
  405.  
  406. defaultproperties
  407. {
  408. }
  409.