class UDNPawn extends UTPawn;
var float CamOffsetDistance; // расстояние смещения камеры выше игрока
var bool bFollowPlayerRotation; //если true, камера будет поворачиваться вместе с игроком
//переопределим, чтобы по умолчанию сделать видимым мешь игрока
simulated event BecomeViewTarget( PlayerController PC )
{
local UTPlayerController UTPC;
Super.BecomeViewTarget(PC);
if (LocalPlayer(PC.Player) != None)
{
UTPC = UTPlayerController(PC);
if (UTPC != None)
{
// устанавливаем контроллер позади игрока и делаем мешь видимым
UTPC.SetBehindView(true);
SetMeshVisibility(UTPC.bBehindView);
UTPC.bNoCrosshair = true;
}
}
}
simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
{
out_CamLoc = Location;
out_CamLoc.Z += CamOffsetDistance;
if(!bFollowPlayerRotation)
{
out_CamRot.Pitch = -16384;
out_CamRot.Yaw = 0;
out_CamRot.Roll = 0;
}
else
{
out_CamRot.Pitch = -16384;
out_CamRot.Yaw = Rotation.Yaw;
out_CamRot.Roll = 0;
}
return true;
}
simulated singular event Rotator GetBaseAimRotation()
{
local rotator POVRot, tempRot;
tempRot = Rotation;
tempRot.Pitch = 0;
SetRotation(tempRot);
POVRot = Rotation;
POVRot.Pitch = 0;
return POVRot;
}
defaultproperties
{
bFollowPlayerRotation = false;
CamOffsetDistance=384.0
}