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 |
//============================================================================= // Util.uc // $Author: Mfox $ // $Date: 8/05/02 12:29p $ // $Revision: 2 $ //============================================================================= class LegendUtil extends LegendObjectComponent abstract; //------------------------------------------------------------------------------ static function DrawQuickLine ( Actor Helper, // pass in self. optional vector Start, optional vector End, optional Actor StartActor, optional Actor EndActor, optional float SpriteInterval, optional float SpriteSize, optional Texture SpriteTexture, optional float Duration ) { local Line Line; local vector A, B; local float Length; if( Helper == None ) return; // Stupidity check. if( (StartActor == None || EndActor == None) && Start == End ) { Helper.warn( "Invalid parameters." ); } Line = Helper.Spawn( class'Line' ); Line.SetEndpoints( Start, End ); Line.SetFollowActors( StartActor, EndActor ); if( StartActor != None ) A = StartActor.Location; else A = Start; if( EndActor != None ) B = EndActor.Location; else B = End; Length = VSize(A - B); if( SpriteInterval > 0.0 ) Line.SegmentLength = SpriteInterval; else Line.SegmentLength = FClamp( Length / 50.0, 0.5, 16.0 ); if( SpriteSize > 0.0 ) Line.SetDrawScale( SpriteSize ); else Line.SetDrawScale( FClamp( Length / 400.0, 0.01, 2.0 ) ); if( SpriteTexture != None ) Line.Texture = SpriteTexture; else Line.Texture = Texture(DynamicLoadObject( "ParticleSystems.Sparks01", class'Texture' )); //!!hardcoded texture Line.LifeSpan = Duration; } //----------------------------------------------------------------------------- // Draws a line made of sprites (or dots) that can optionally fade out. // Used primarily for debugging. Quite a bit slower to generate and render than // DrawLine (virtually unusable if many lines and may even crash renderer). //----------------------------------------------------------------------------- static function DrawLine3D ( Actor Helper, vector Start, vector End, optional float FadeDuration, // Amount of time to fade the line out over. optional float DotInterval, // Space between consecutive dots in a line. optional Texture DotTexture, // Texture to use to draw the dots in the line. optional float DelayTime // How long to wait before actually drawing the line. ) { local Line3D Line; Line = Helper.Spawn( class'Line3D' ); Line.LineDuration = FadeDuration; if( DotTexture != None ) { Line.LineTexture = DotTexture; } if( DotInterval > 0.0 ) { Line.DotInterval = DotInterval; } Line.SetEndpoints( Start, End ); Line.ReDraw( DelayTime ); } //----------------------------------------------------------------------------- // Draws a permanent, easily visible line from Start to End. Mainly useful for // debugging calls to Trace etc. Quite a bit faster to generate and render than // DrawLine3D but can still slow things to crawl if there are many of these. //----------------------------------------------------------------------------- static function DrawLine ( Actor Owner, vector Start, vector End, optional Texture SkinToUse ) { local LineStreak LS; local LineStreakVert LSV; LS = Owner.Spawn( class'LineStreak' ); LSV = Owner.Spawn( class'LineStreakVert' ); LS.SetEndPoints( Start, End ); LSV.SetEndPoints( Start, End ); if( SkinToUse != None ) { LS.SetSkin( SkinToUse ); LSV.SetSkin( SkinToUse ); } } //----------------------------------------------------------------------------- // Use this to fade objects out instead of just Destroy()ing them. Note that // in multiplayer games fading is not performed for now, instead, after the // DelayTime, the object is destroyed after FadeTime additional seconds. //----------------------------------------------------------------------------- // Other: The Actor to fade away. // FadeTime: How long it takes to fade the object away. (Defaults to Fader's default FadeTime value.) // bNoDeleteActor: When we finish fading the object out, should we delete it? (Deletes it by default.) // InitialScaleGlow: The ScaleGlow the Actor starts with. (Defaults to the Actor's current ScaleGlow value.) // FinalScaleGlow: The ScaleGlow the Actor ends with. (Defaults to Fader's default FinalScaleGlow value (0).) - Must be less than InitialScaleGlow. // DelayTime: Time to wait before starting to fade. (Defaults to 0.0 seconds) // NumFlickers: Number of times to "flicker" before fading (Defaults to 0) //----------------------------------------------------------------------------- static simulated function Fade( Actor Other, optional float FadeTime, optional bool bNoDeleteActor, optional float InitialScaleGlow, optional float FinalScaleGlow, optional float DelayTime, optional int NumFlickers ) { local Fader F; if( Other != None ) { F = Other.Spawn( class'Fader' ); if( FadeTime > 0.0 ) { F.FadeTime = FadeTime; } F.bDeleteActor = !bNoDeleteActor; if( InitialScaleGlow > 0.0 ) { F.InitialScaleGlow = InitialScaleGlow; } if( FinalScaleGlow > 0.0 ) { F.FinalScaleGlow = FinalScaleGlow; } F.DelayTime = DelayTime; F.NumFlickers = NumFlickers; F.Fade( Other ); } } //----------------------------------------------------------------------------- // Same as trace, but draws a line from the start location to the end location. //----------------------------------------------------------------------------- static function Actor VisibleTrace ( Actor TraceFromActor, out vector HitLocation, out vector HitNormal, vector TraceEnd, optional vector TraceStart, optional bool bTraceActors, optional vector Extent ) { DrawLine( TraceFromActor, TraceStart, TraceEnd ); return TraceFromActor.Trace( HitLocation, HitNormal, TraceEnd, TraceStart, bTraceActors, Extent ); } //----------------------------------------------------------------------------- // Draw a line from the given player's eyes along his line of sight. //----------------------------------------------------------------------------- static function DrawViewLine( Pawn P ) { local vector StartTrace, EndTrace; StartTrace = P.Location; StartTrace.Z += P.BaseEyeHeight; EndTrace = StartTrace + 32767 * vector(P.GetViewRotation() ); DrawLine( P, StartTrace, EndTrace ); } defaultproperties { } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |