Core
Class Object

source: c:\runehov\Core\Classes\Object.uc
Direct Known Subclasses:Commandlet, Locale, Subsystem, Time, BrushBuilder, Actor, Bitmap, Canvas, Console, LevelSummary, Palette, Player, TestObj, ListItem, WebApplication, WebRequest, WebResponse, UWindowBase

class Object

//============================================================================= // Object: The base class all objects. // This is a built-in Unreal class and it shouldn't be modified. //=============================================================================
Variables
 int ObjectFlags
 int ObjectInternal[6]
 Object Outer


Function Summary
 float Abs(float A)
     
// Float functions.
 int Asc(string S)
 float Atan(float A)
 string Caps(string S)
 string Chr(int i)
 int Clamp(int V, int A, int B)
 bool ClassIsChildOf(class TestClass, class ParentClass)
     
// Objects.
 float Cos(float A)
 void Disable(name ProbeFunc)
 Object DynamicLoadObject(string ObjectName, class ObjectClass, optional bool)
 void Enable(name ProbeFunc)
     
// Probe messages.
 float Exp(float A)
 float FClamp(float V, float A, float B)
 float FMax(float A, float B)
 float FMin(float A, float B)
 float FRand()
 void GetAxes(rotator A, out vector, out vector, out vector)
     
// Rotator operators and functions.
 name GetEnum(Object E, int i)
 string GetPropertyText(string PropName)
     
// Properties.
 name GetStateName()
 string GetToken(out string)
 void GetUnAxes(rotator A, out vector, out vector, out vector)
 void GotoState(optional name, optional name)
     
// Goto state and label.
 int InStr(string S, string t)
 void Invert(out vector, out vector, out vector)
 bool IsA(name ClassName)
 bool IsInState(name TestState)
 string Left(string S, int i)
 int Len(string S)
     
// String functions.
 float Lerp(float Alpha, float A, float B)
 string Localize(string SectionName, string KeyName, string PackageName)
 void Log(string S, optional name)
     
// Logging.
 float Loge(float A)
 int Max(int A, int B)
 string Mid(string S, int i, optional int)
 int Min(int A, int B)
 vector MirrorVectorByNormal(vector Vect, vector Normal)
 vector Normal(vector A)
 rotator Normalize(rotator Rot)
 rotator OrthoRotation(vector X, vector Y, vector Z)
 float Radians(int theta)
 int Rand(int Max)
     
// Integer functions.
 float RandRange(float Min, float Max)
     
// Return a random number within the given range.
 void ResetConfig()
 string Right(string S, int i)
 rotator RotRand(optional bool)
 void SaveConfig()
     
// Configuration.
 void SetPropertyText(string PropName, string PropValue)
 float Sin(float A)
 float Smerp(float Alpha, float A, float B)
 float Sqrt(float A)
 float Square(float A)
 void StaticSaveConfig()
 float Tan(float A)
 vector VRand( )
 float VSize(vector A)
     
// Vector functions.
 float VSize2D(vector A)
 void Warn(string S)



Source Code


00001	//=============================================================================
00002	// Object: The base class all objects.
00003	// This is a built-in Unreal class and it shouldn't be modified.
00004	//=============================================================================
00005	class Object
00006		native
00007		noexport;
00008	
00009	//=============================================================================
00010	// UObject variables.
00011	
00012	// Internal variables.
00013	var native private const int ObjectInternal[6];
00014	var native const object Outer;
00015	var native const int ObjectFlags;
00016	var(Object) native const editconst name Name;
00017	var(Object) native const editconst class Class;
00018	
00019	//=============================================================================
00020	// Unreal base structures.
00021	
00022	// Object flags.
00023	const RF_Transactional	= 0x00000001; // Supports editor undo/redo.
00024	const RF_Public         = 0x00000004; // Can be referenced by external package files.
00025	const RF_Transient      = 0x00004000; // Can't be saved or loaded.
00026	const RF_NotForClient	= 0x00100000; // Don't load for game client.
00027	const RF_NotForServer	= 0x00200000; // Don't load for game server.
00028	const RF_NotForEdit		= 0x00400000; // Don't load for editor.
00029	
00030	// RUNE:  
00031	// Matter types -- Stored in Object.uc because both Actors and Texture have matter types
00032	enum EMatterType
00033	{
00034		MATTER_NONE,
00035		MATTER_WOOD,
00036		MATTER_METAL,
00037		MATTER_STONE,
00038		MATTER_FLESH,
00039		MATTER_ICE,
00040		MATTER_WATER,
00041		MATTER_EARTH,
00042		MATTER_SNOW,
00043		MATTER_BREAKABLEWOOD,
00044		MATTER_BREAKABLESTONE,
00045		MATTER_SHIELD,
00046		MATTER_WEAPON,
00047		MATTER_MUD,
00048		MATTER_LAVA,
00049	};
00050	
00051	// A globally unique identifier.
00052	struct Guid
00053	{
00054		var int A, B, C, D;
00055	};
00056	
00057	// A point or direction vector in 3d space.
00058	struct Vector
00059	{
00060		var() config float X, Y, Z;
00061	};
00062	
00063	// A plane definition in 3d space.
00064	struct Plane extends Vector
00065	{
00066		var() config float W;
00067	};
00068	
00069	// An orthogonal rotation in 3d space.
00070	struct Rotator
00071	{
00072		var() config int Pitch, Yaw, Roll;
00073	};
00074	
00075	// An arbitrary coordinate system in 3d space.
00076	struct Coords
00077	{
00078		var() config vector Origin, XAxis, YAxis, ZAxis;
00079	};
00080	
00081	// A scale and sheering.
00082	struct Scale
00083	{
00084		var() config vector Scale;
00085		var() config float SheerRate;
00086		var() config enum ESheerAxis
00087		{
00088			SHEER_None,
00089			SHEER_XY,
00090			SHEER_XZ,
00091			SHEER_YX,
00092			SHEER_YZ,
00093			SHEER_ZX,
00094			SHEER_ZY,
00095		} SheerAxis;
00096	};
00097	
00098	// A color.
00099	struct Color
00100	{
00101		var() config byte R, G, B, A;
00102	};
00103	
00104	// A bounding box.
00105	struct BoundingBox
00106	{
00107		var vector Min, Max;
00108		var byte IsValid;
00109	};
00110	
00111	// A bounding box sphere together.
00112	struct BoundingVolume extends boundingbox
00113	{
00114		var plane Sphere;
00115	};
00116	
00117	//=============================================================================
00118	// Constants.
00119	
00120	const MaxInt = 0x7fffffff;
00121	const Pi     = 3.1415926535897932;
00122	
00123	//=============================================================================
00124	// Basic native operators and functions.
00125	
00126	// Bool operators.
00127	native(129) static final preoperator  bool  !  ( bool A );
00128	native(242) static final operator(24) bool  == ( bool A, bool B );
00129	native(243) static final operator(26) bool  != ( bool A, bool B );
00130	native(130) static final operator(30) bool  && ( bool A, skip bool B );
00131	native(131) static final operator(30) bool  ^^ ( bool A, bool B );
00132	native(132) static final operator(32) bool  || ( bool A, skip bool B );
00133	
00134	// Byte operators.
00135	native(133) static final operator(34) byte *= ( out byte A, byte B );
00136	native(134) static final operator(34) byte /= ( out byte A, byte B );
00137	native(135) static final operator(34) byte += ( out byte A, byte B );
00138	native(136) static final operator(34) byte -= ( out byte A, byte B );
00139	native(137) static final preoperator  byte ++ ( out byte A );
00140	native(138) static final preoperator  byte -- ( out byte A );
00141	native(139) static final postoperator byte ++ ( out byte A );
00142	native(140) static final postoperator byte -- ( out byte A );
00143	
00144	// Integer operators.
00145	native(141) static final preoperator  int  ~  ( int A );
00146	native(143) static final preoperator  int  -  ( int A );
00147	native(144) static final operator(16) int  *  ( int A, int B );
00148	native(145) static final operator(16) int  /  ( int A, int B );
00149	native(146) static final operator(20) int  +  ( int A, int B );
00150	native(147) static final operator(20) int  -  ( int A, int B );
00151	native(148) static final operator(22) int  << ( int A, int B );
00152	native(149) static final operator(22) int  >> ( int A, int B );
00153	native(196) static final operator(22) int  >>>( int A, int B );
00154	native(150) static final operator(24) bool <  ( int A, int B );
00155	native(151) static final operator(24) bool >  ( int A, int B );
00156	native(152) static final operator(24) bool <= ( int A, int B );
00157	native(153) static final operator(24) bool >= ( int A, int B );
00158	native(154) static final operator(24) bool == ( int A, int B );
00159	native(155) static final operator(26) bool != ( int A, int B );
00160	native(156) static final operator(28) int  &  ( int A, int B );
00161	native(157) static final operator(28) int  ^  ( int A, int B );
00162	native(158) static final operator(28) int  |  ( int A, int B );
00163	native(159) static final operator(34) int  *= ( out int A, float B );
00164	native(160) static final operator(34) int  /= ( out int A, float B );
00165	native(161) static final operator(34) int  += ( out int A, int B );
00166	native(162) static final operator(34) int  -= ( out int A, int B );
00167	native(163) static final preoperator  int  ++ ( out int A );
00168	native(164) static final preoperator  int  -- ( out int A );
00169	native(165) static final postoperator int  ++ ( out int A );
00170	native(166) static final postoperator int  -- ( out int A );
00171	
00172	// Integer functions.
00173	native(167) static final Function     int  Rand  ( int Max );
00174	native(249) static final function     int  Min   ( int A, int B );
00175	native(250) static final function     int  Max   ( int A, int B );
00176	native(251) static final function     int  Clamp ( int V, int A, int B );
00177	
00178	// Float operators.
00179	native(169) static final preoperator  float -  ( float A );
00180	native(170) static final operator(12) float ** ( float A, float B );
00181	native(171) static final operator(16) float *  ( float A, float B );
00182	native(172) static final operator(16) float /  ( float A, float B );
00183	native(173) static final operator(18) float %  ( float A, float B );
00184	native(174) static final operator(20) float +  ( float A, float B );
00185	native(175) static final operator(20) float -  ( float A, float B );
00186	native(176) static final operator(24) bool  <  ( float A, float B );
00187	native(177) static final operator(24) bool  >  ( float A, float B );
00188	native(178) static final operator(24) bool  <= ( float A, float B );
00189	native(179) static final operator(24) bool  >= ( float A, float B );
00190	native(180) static final operator(24) bool  == ( float A, float B );
00191	native(210) static final operator(24) bool  ~= ( float A, float B );
00192	native(181) static final operator(26) bool  != ( float A, float B );
00193	native(182) static final operator(34) float *= ( out float A, float B );
00194	native(183) static final operator(34) float /= ( out float A, float B );
00195	native(184) static final operator(34) float += ( out float A, float B );
00196	native(185) static final operator(34) float -= ( out float A, float B );
00197	
00198	// Float functions.
00199	native(186) static final function     float Abs   ( float A );
00200	native(187) static final function     float Sin   ( float A );
00201	native(188) static final function     float Cos   ( float A );
00202	native(189) static final function     float Tan   ( float A );
00203	native(190) static final function     float Atan  ( float A );
00204	native(191) static final function     float Exp   ( float A );
00205	native(192) static final function     float Loge  ( float A );
00206	native(193) static final function     float Sqrt  ( float A );
00207	native(194) static final function     float Square( float A );
00208	native(195) static final function     float FRand ();
00209	native(244) static final function     float FMin  ( float A, float B );
00210	native(245) static final function     float FMax  ( float A, float B );
00211	native(246) static final function     float FClamp( float V, float A, float B );
00212	native(247) static final function     float Lerp  ( float Alpha, float A, float B );
00213	native(248) static final function     float Smerp ( float Alpha, float A, float B );
00214	
00215	// Vector operators.
00216	native(211) static final preoperator  vector -     ( vector A );
00217	native(212) static final operator(16) vector *     ( vector A, float B );
00218	native(213) static final operator(16) vector *     ( float A, vector B );
00219	native(296) static final operator(16) vector *     ( vector A, vector B );
00220	native(214) static final operator(16) vector /     ( vector A, float B );
00221	native(215) static final operator(20) vector +     ( vector A, vector B );
00222	native(216) static final operator(20) vector -     ( vector A, vector B );
00223	native(275) static final operator(22) vector <<    ( vector A, rotator B );
00224	native(276) static final operator(22) vector >>    ( vector A, rotator B );
00225	native(217) static final operator(24) bool   ==    ( vector A, vector B );
00226	native(218) static final operator(26) bool   !=    ( vector A, vector B );
00227	native(219) static final operator(16) float  Dot   ( vector A, vector B );
00228	native(220) static final operator(16) vector Cross ( vector A, vector B );
00229	native(221) static final operator(34) vector *=    ( out vector A, float B );
00230	native(297) static final operator(34) vector *=    ( out vector A, vector B );
00231	native(222) static final operator(34) vector /=    ( out vector A, float B );
00232	native(223) static final operator(34) vector +=    ( out vector A, vector B );
00233	native(224) static final operator(34) vector -=    ( out vector A, vector B );
00234	
00235	// Vector functions.
00236	native(225) static final function float  VSize  ( vector A );
00237	native(662) static final function float  VSize2D( vector A );
00238	native(226) static final function vector Normal ( vector A );
00239	native(227) static final function        Invert ( out vector X, out vector Y, out vector Z );
00240	native(252) static final function vector VRand  ( );
00241	native(300) static final function vector MirrorVectorByNormal( vector Vect, vector Normal );
00242	
00243	// Rotator operators and functions.
00244	native(142) static final operator(24) bool ==     ( rotator A, rotator B );
00245	native(203) static final operator(26) bool !=     ( rotator A, rotator B );
00246	native(287) static final operator(16) rotator *   ( rotator A, float    B );
00247	native(288) static final operator(16) rotator *   ( float    A, rotator B );
00248	native(289) static final operator(16) rotator /   ( rotator A, float    B );
00249	native(290) static final operator(34) rotator *=  ( out rotator A, float B  );
00250	native(291) static final operator(34) rotator /=  ( out rotator A, float B  );
00251	native(316) static final operator(20) rotator +   ( rotator A, rotator B );
00252	native(317) static final operator(20) rotator -   ( rotator A, rotator B );
00253	native(318) static final operator(34) rotator +=  ( out rotator A, rotator B );
00254	native(319) static final operator(34) rotator -=  ( out rotator A, rotator B );
00255	native(229) static final function GetAxes         ( rotator A, out vector X, out vector Y, out vector Z );
00256	native(230) static final function GetUnAxes       ( rotator A, out vector X, out vector Y, out vector Z );
00257	native(320) static final function rotator RotRand ( optional bool bRoll );
00258	native      static final function rotator OrthoRotation( vector X, vector Y, vector Z );
00259	native      static final function rotator Normalize( rotator Rot );
00260	
00261	// String operators.
00262	native(112) static final operator(40) string $  ( coerce string A, coerce string B );
00263	native(168) static final operator(40) string @  ( coerce string A, coerce string B );
00264	native(115) static final operator(24) bool   <  ( string A, string B );
00265	native(116) static final operator(24) bool   >  ( string A, string B );
00266	native(120) static final operator(24) bool   <= ( string A, string B );
00267	native(121) static final operator(24) bool   >= ( string A, string B );
00268	native(122) static final operator(24) bool   == ( string A, string B );
00269	native(123) static final operator(26) bool   != ( string A, string B );
00270	native(124) static final operator(24) bool   ~= ( string A, string B );
00271	
00272	// String functions.
00273	native(125) static final function int    Len    ( coerce string S );
00274	native(126) static final function int    InStr  ( coerce string S, coerce string t );
00275	native(127) static final function string Mid    ( coerce string S, int i, optional int j );
00276	native(128) static final function string Left   ( coerce string S, int i );
00277	native(234) static final function string Right  ( coerce string S, int i );
00278	native(235) static final function string Caps   ( coerce string S );
00279	native(236) static final function string Chr    ( int i );
00280	native(237) static final function int    Asc    ( string S );
00281	
00282	function string GetToken(out string s)
00283	{
00284		local int i,length;
00285		local string tok;
00286	
00287		if( instr(s," ") != -1 )
00288		{
00289			length = Len(s);
00290			for (i=0; i<length; i++)
00291			{
00292				if (Mid(s, i, 1) == " ")
00293				{
00294					tok = left(s, i);
00295					s = right(s, length-i-1);
00296					break;
00297				}
00298			}
00299		}
00300		else
00301		{
00302			if (tok=="")
00303			{
00304				tok = s;
00305				s = "";
00306			}
00307		}
00308	
00309		return tok;
00310	}
00311	
00312	// Object operators.
00313	native(114) static final operator(24) bool == ( Object A, Object B );
00314	native(119) static final operator(26) bool != ( Object A, Object B );
00315	
00316	// Name operators.
00317	native(254) static final operator(24) bool == ( name A, name B );
00318	native(255) static final operator(26) bool != ( name A, name B );
00319	
00320	//=============================================================================
00321	// General functions.
00322	
00323	// Logging.
00324	native(231) final static function Log( coerce string S, optional name Tag );
00325	native(232) final static function Warn( coerce string S );
00326	native static function string Localize( string SectionName, string KeyName, string PackageName );
00327	
00328	// Goto state and label.
00329	native(113) final function GotoState( optional name NewState, optional name Label );
00330	native(281) final function bool IsInState( name TestState );
00331	native(284) final function name GetStateName();
00332	
00333	// Objects.
00334	native(258) static final function bool ClassIsChildOf( class TestClass, class ParentClass );
00335	native(303) final function bool IsA( name ClassName );
00336	
00337	// Probe messages.
00338	native(117) final function Enable( name ProbeFunc );
00339	native(118) final function Disable( name ProbeFunc );
00340	
00341	// Properties.
00342	native final function string GetPropertyText( string PropName );
00343	native final function SetPropertyText( string PropName, string PropValue );
00344	native static final function name GetEnum( object E, int i );
00345	native static final function object DynamicLoadObject( string ObjectName, class ObjectClass, optional bool MayFail );
00346	
00347	// Configuration.
00348	native(536) final function SaveConfig();
00349	native static final function StaticSaveConfig();
00350	native static final function ResetConfig();
00351	
00352	// Return a random number within the given range.
00353	final simulated function float RandRange( float Min, float Max )
00354	{
00355	    return Min + (Max - Min) * FRand();
00356	}
00357	
00358	final simulated function float Radians(int theta)
00359	{
00360		return (theta*2.0*Pi/65535.0);
00361	}
00362	
00363	//=============================================================================
00364	// Engine notification functions.
00365	
00366	//
00367	// Called immediately when entering a state, while within
00368	// the GotoState call that caused the state change.
00369	//
00370	event BeginState();
00371	
00372	//
00373	// Called immediately before going out of the current state,
00374	// while within the GotoState call that caused the state change.
00375	// 
00376	event EndState();
00377	
00378	defaultproperties
00379	{
00380	}

End Source Code