Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. class MugetsuThirdPersonMode extends MugetsuCameraModeBase;
  2.  
  3. var float CamOffsetDistance; //distance to offset the camera from the player in unreal units
  4. var float CamMinDistance, CamMaxDistance;
  5. var float CamZoomTick; //how far to zoom in/out per command
  6. var float CamHeight; //how high cam is relative to pawn pelvis
  7.  
  8. function bool CameraUpdate( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV, Pawn playerpawn )
  9. {
  10.     local vector HitLoc,HitNorm, End, Start, vecCamHeight;
  11.  
  12.     vecCamHeight = vect(0,0,0);
  13.     vecCamHeight.Z = CamHeight;
  14.     Start = playerpawn.Location;
  15.  
  16.     End = (playerpawn.Location+vecCamHeight)-(Vector(playerpawn.Controller.Rotation) * CamOffsetDistance);  //cam follow behind player controller
  17.     out_CamLoc = End;
  18.  
  19.     //trace to check if cam running into wall/floor
  20.     if(playerpawn.Trace(HitLoc,HitNorm,End,Start,false,vect(12,12,12))!=none)
  21.     {
  22.         out_CamLoc = HitLoc; // + vecCamHeight;
  23.     }
  24.  
  25.     //camera will look slightly above player
  26.     out_CamRot=rotator((playerpawn.Location + vecCamHeight) - out_CamLoc);
  27.     return true;
  28. }
  29.  
  30. DefaultProperties
  31. {
  32.     CamHeight = 20.0            //40 default value
  33.     CamMinDistance = 10.0       //40 default value
  34.     CamMaxDistance = 512.0      //350 default value
  35.     CamOffsetDistance= 200.0        //250 default value
  36.     CamZoomTick= 20.0
  37.     bSmoothTransition = false
  38. }