忍者ブログ

work memo

GamePlayerCameraを利用する方法

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

コメント

ただいまコメントを受けつけておりません。

GamePlayerCameraを利用する方法

UTクラスの子がGamePlayerCameraを利用する方法


DefaultCamera.ini(新しく作る)

[GameFrameWork.GameThirdPersonCameraMode]
FOVAngle = 90.0




SandboxGame.uc

class SandboxGame extends UTGame;
 
defaultProperties
{
 DefaultPawnClass = class'SandboxPawn'
 PlayerControllerClass = class'SandboxPlayerController'
}


SandboxPlayerController.uc

class SandboxPlayerController extends UTPlayerController; event ResetCameraMode()
{
 Super(PlayerController).ResetCameraMode();
}

simulated event GetPlayerViewPoint( out vector out_Location, out Rotator out_Rotation )
{
 Super(PlayerController).GetPlayerViewPoint(out_Location, out_Rotation);
}

defaultProperties
{
 CameraClass=class'GamePlayerCamera'
}


SandboxPawn.uc

class SandboxPawn extends UTPawn;

simulated function name GetDefaultCameraMode( PlayerController RequestedBy )
{
 if ( RequestedBy != None && RequestedBy.PlayerCamera != None && RequestedBy.PlayerCamera.CameraStyle == 'Fixed' )
  return 'Fixed';

 return 'Default';
}

simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
{
 // Handle the fixed camera

 if (bFixedView)
 {
  out_CamLoc = FixedViewLoc;
  out_CamRot = FixedViewRot;
 }
 else
 {
  if ( !IsFirstPerson() ) // Handle BehindView
  {
   return Super(Actor).CalcCamera(fDeltaTime, out_CamLoc, out_CamRot, out_FOV);
  }
  else
  {
   // By default, we view through the Pawn's eyes..
   GetActorEyesViewPoint( out_CamLoc, out_CamRot );
  }

  if ( UTWeapon(Weapon) != none)
  {
   UTWeapon(Weapon).WeaponCalcCamera(fDeltaTime, out_CamLoc, out_CamRot);
  }
 }

 return true;
}

defaultproperties
{
}

PR

コメント

プロフィール

HN:
No Name Ninja
性別:
非公開

P R