home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Gameplay / Classes / CameraTextureClient.uc < prev    next >
Text File  |  2003-12-11  |  972b  |  63 lines

  1. class CameraTextureClient extends Info
  2.     placeable;
  3.  
  4. var() ScriptedTexture    DestTexture;
  5. var() name                CameraTag;
  6. var() float                RefreshRate;
  7. var() float                FOV;
  8.  
  9. var Actor                CameraActor;
  10.  
  11. //
  12. //    PostBeginPlay
  13. //
  14.  
  15. simulated function PostBeginPlay()
  16. {
  17.     local Actor    CameraActorIt;
  18.  
  19.     ForEach AllActors(class'Actor',CameraActorIt,CameraTag)
  20.     {
  21.         CameraActor = CameraActorIt;
  22.         break;
  23.     }
  24.  
  25.     if(DestTexture != None)
  26.     {
  27.         DestTexture.Client = Self;
  28.         SetTimer(1.0 / RefreshRate,true);
  29.         Enable('Timer');
  30.     }
  31. }
  32.  
  33. //
  34. //    Timer
  35. //
  36.  
  37. simulated function Timer()
  38. {
  39.     DestTexture.Revision++;
  40. }
  41.  
  42. //
  43. //    RenderTexture
  44. //
  45.  
  46. simulated event RenderTexture(ScriptedTexture Tex)
  47. {
  48.     if(CameraActor != None)
  49.         Tex.DrawPortal(0,0,Tex.USize,Tex.VSize,CameraActor,CameraActor.Location,CameraActor.Rotation,FOV);
  50. }
  51.  
  52. //
  53. //    Default properties
  54. //
  55.  
  56. defaultproperties
  57. {
  58.     bStatic=False
  59.     bAlwaysRelevant=True
  60.     bNoDelete=True
  61.     RefreshRate=60.0
  62.     FOV=60.0
  63. }