Mostly Harmless

UE3:GameThirdPersonCamera (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UDK Object >> GameCameraBase >> GameThirdPersonCamera

Contents

Package: 
GameFramework


Properties[edit]

Property group 'Debug'[edit]

bDebugChangedCameraMode[edit]

Type: bool

Change in camera mode happened this frame - reset on first call to PlayerUpdateCamera

Property group 'Focus'[edit]

Focus_BackOffStrength[edit]

Type: float

move back pct based on move up

Default value: 0.33

Focus_FastAdjustKickInTime[edit]

Type: float

time it takes for fast interpolation speed to kick in

Default value: 0.5

Focus_MaxTries[edit]

Type: int

number of tries to have focus in view

Default value: 4

Focus_StepHeightAdjustment[edit]

Type: float

Z offset step for every try

Default value: 64.0

FocusPoint[edit]

Type: CamFocusPointParams

current focus point

Property group 'GameThirdPersonCamera'[edit]

bDrawDebug[edit]

Type: bool

Modifiers: protected

toggles debug mode

CurrentCamMode[edit]

Type: GameThirdPersonCameraMode

Modifiers: editinline, transient

Current GearCam Mode

DirectLookInterpSpeed[edit]

Type: float


Default value: 6.0

OffsetAdjustmentInterpSpeed[edit]

Type: float

Modifiers: protected, const

We optionally interpolate the results of AdjustViewOffset() to prevent pops when a cameramode changes its adjustment suddenly.

Default value: 12.0

OriginOffsetInterpSpeed[edit]

Type: float

origin offset interpolation speed

Default value: 8.0

PenetrationAvoidanceFeelers[edit]

Type: array<PenetrationAvoidanceFeeler>


Default value, index 0:

Member Value
Extent
Member Value
X 14.0
Y 14.0
Z 14.0
PawnWeight 1.0
WorldWeight 1.0

Default value, index 1:

Member Value
AdjustmentRot
Member Value
Pitch 0
Roll 0
Yaw 3072
PawnWeight 0.75
WorldWeight 0.75

Default value, index 2:

Member Value
AdjustmentRot
Member Value
Pitch 0
Roll 0
Yaw -3072
PawnWeight 0.75
WorldWeight 0.75

Default value, index 3:

Member Value
AdjustmentRot
Member Value
Pitch 0
Roll 0
Yaw 6144
PawnWeight 0.5
WorldWeight 0.5

Default value, index 4:

Member Value
AdjustmentRot
Member Value
Pitch 0
Roll 0
Yaw -6144
PawnWeight 0.5
WorldWeight 0.5

Default value, index 5:

Member Value
AdjustmentRot
Member Value
Pitch 3640
Roll 0
Yaw 0
PawnWeight 1.0
WorldWeight 1.0

Default value, index 6:

Member Value
AdjustmentRot
Member Value
Pitch -3640
Roll 0
Yaw 0
PawnWeight 0.5
WorldWeight 0.5

PenetrationBlendInTime[edit]

Type: float

Time to transition from ideal location to blocked position, after camera collision with geometry. (used only by predictive feelers)

Default value: 0.1

PenetrationBlendOutTime[edit]

Type: float

Time to transition from blocked location to ideal position, after camera collision with geometry.

Default value: 0.15

PenetrationExtentScale[edit]

Type: float

camera extent scale to use when calculating penetration for this segment

Default value: 1.0

ThirdPersonCamDefault[edit]

Type: GameThirdPersonCameraMode

Modifiers: protected, editinline

Base camera position when walking

ThirdPersonCamDefaultClass[edit]

Type: class<GameThirdPersonCameraMode>

Modifiers: protected


Default value: Class'GameFramework.GameThirdPersonCameraMode_Default'

WorstLocInterpSpeed[edit]

Type: float


Default value: 8.0

WorstLocPenetrationExtentScale[edit]

Type: float

camera extent scale to use when calculating penetration for this segment

Default value: 1.0

Internal variables[edit]

ActualFocusPointWorldLoc[edit]

Type: Object.Vector

Modifiers: transient, protected


bDoingACameraTurn[edit]

Type: bool

Modifiers: protected


bDoingDirectLook[edit]

Type: bool

Modifiers: transient


bFocusPointSet[edit]

Type: bool

do we have a focus point set?

bFocusPointSuccessful[edit]

Type: bool

Modifiers: protected, transient

Internal. TRUE if the focus point was good and the camera looked at it, FALSE otherise (e.g. failed the trace).

bTurnAlignTargetWhenFinished[edit]

Type: bool

Modifiers: protected


DirectLookYaw[edit]

Type: int

Modifiers: transient

direct look vars

LastActualCameraOrigin[edit]

Type: Object.Vector

Modifiers: transient

Last actual camera origin position, for lazy cam interpolation. It's only applied to player's origin, not view offsets, for faster/smoother response

LastActualCameraOriginRot[edit]

Type: Object.Rotator

Modifiers: transient


LastActualOriginOffset[edit]

Type: Object.Vector

Modifiers: transient

Last pawn relative offset, for slow offsets interpolation. This is because this offset is relative to the Pawn's rotation, which can change abruptly (when snapping to cover). Used to adjust the camera origin (evade, lean, pop up, blind fire, reload..)

LastCamFOV[edit]

Type: float

Modifiers: transient

last CamFOV for war cam interpolation

LastFocusChangeTime[edit]

Type: float

Modifiers: transient, protected

Last time focus point changed (location)

LastFocusPointLoc[edit]

Type: Object.Vector

Modifiers: transient, protected

Last focus point location

LastHeightAdjustment[edit]

Type: float

Modifiers: transient

last offset adjustment, for smooth blend out

LastOffsetAdjustment[edit]

Type: Object.Vector

Modifiers: protectedwrite, transient

Offset adjustment from last tick, used for interpolation.

LastPitchAdjustment[edit]

Type: float

Modifiers: transient

last adjusted pitch, for smooth blend out

LastPostCamTurnYaw[edit]

Type: int

Modifiers: protected, transient

Saved data for camera turn "align when finished" functionality

LastPreModifierCameraLoc[edit]

Type: Object.Vector

Modifiers: transient

Last location and rotation of the camera, cached before camera modifiers are applied.

LastPreModifierCameraRot[edit]

Type: Object.Rotator

Modifiers: transient


LastViewOffset[edit]

Type: Object.Vector

Modifiers: transient

View relative offset. This offset is relative to Controller's rotation, mainly used for Pitch positioning.

LastWorstLocationLocal[edit]

Type: Object.Vector

Modifiers: transient


LastYawAdjustment[edit]

Type: float

Modifiers: transient

last adjusted Yaw, for smooth blend out

LeftoverPitchAdjustment[edit]

Type: float

Modifiers: transient

pitch adjustment when keeping target is done in 2 parts. this is the amount to pitch in part 2 (post view offset application)

PenetrationBlockedPct[edit]

Type: float

Modifiers: protected

Percentage of distance blocked by collision. From worst location, to desired location.

Default value: 1.0

TurnCurTime[edit]

Type: float

Modifiers: protected

Vars for code-driven camera turns

TurnDelay[edit]

Type: float

Modifiers: protected


TurnEndAngle[edit]

Type: int

Modifiers: protected


TurnStartAngle[edit]

Type: int

Modifiers: protected


TurnTotalTime[edit]

Type: float

Modifiers: protected


WorstLocBlockedPct[edit]

Type: float

obstruction pct from origin to worstloc origin

Structs[edit]

CamFocusPointParams[edit]

Modifiers: native

Camera focus point definition

Actor FocusActor 
Actor to focus on.
name FocusBoneName 
Bone name to focus on. Ignored if FocusActor is None or has no SkeletalMeshComponent
Object.Vector FocusWorldLoc 
Focus point location in world space. Ignored if FocusActor is not None.
float CameraFOV 
If >0, FOV to force upon camera while looking at this point (degrees)
Object.Vector2D InterpSpeedRange 
Interpolation speed (X=slow/focus loc moving, Y=fast/focus loc steady/blending out)
Object.Vector2D InFocusFOV 
FOV where target is considered in focus, no correction is made. X is yaw tolerance, Y is pitch tolerance.
bool bAlwaysFocus 
If FALSE, focus only if point roughly in view; if TRUE, focus no matter where player is looking
bool bAdjustCamera 
If TRUE, camera adjusts to keep player in view, if FALSE the camera remains fixed and just rotates in place
bool bIgnoreTrace 
If TRUE, ignore world trace to find a good spot
float FocusPitchOffsetDeg 
Offsets the pitch. e.g. 20 will look 20 degrees above the target

PenetrationAvoidanceFeeler[edit]

Modifiers: native

Struct defining a feeler ray used for camera penetration avoidance.

Object.Rotator AdjustmentRot 
rotator describing deviance from main ray
float WorldWeight 
how much this feeler affects the final position if it hits the world
float PawnWeight 
how much this feeler affects the final position if it hits a Pawn (setting to 0 will not attempt to collide with pawns at all)
Object.Vector Extent 
extent to use for collision when firing this ray

Functions[edit]

Native functions[edit]

EndTurn[edit]

native function EndTurn ()

Stops a camera rotation.

PlayerUpdateCamera[edit]

native protected function PlayerUpdateCamera (Pawn P, float DeltaTime, out Camera.TViewTarget OutVT)

Internal camera updating code

Events[edit]

GetDesiredFOV[edit]

event float GetDesiredFOV (Pawn ViewedPawn)

returns camera mode desired FOV

ModifyPostProcessSettings[edit]

event ModifyPostProcessSettings (out PostProcessVolume.PostProcessSettings PP)

Overrides: GameCameraBase.ModifyPostProcessSettings


UpdateFocusPoint[edit]

protected event UpdateFocusPoint (Pawn P)

Per-tick focus point processing, for polling gamestate and adjusting as desired. Override if you want other systems or criteria to set focus points.

Other instance functions[edit]

AdjustFocusPointInterpolation[edit]

function AdjustFocusPointInterpolation (Object.Rotator Delta)

Use this if you keep the same focus point, but move the camera basis around underneath it

e.g. you want the camera to hold steady focus, but the camera target is rotating

AdjustTurn[edit]

function AdjustTurn (int AngleOffset)

Adjusts a camera rotation. Useful for situations where the basis of the rotation changes.

Parameters:

  • AngleOffset - Yaw adjustment to apply (in Rotator units)

BeginTurn[edit]

function BeginTurn (int StartAngle, int EndAngle, float TimeSec, optional float DelaySec, optional bool bAlignTargetWhenFinished)

Initiates a forced camera rotation.

Parameters:

  • StartAngle - Starting Yaw offset (in Rotator units)
  • EndAngle - Finishing Yaw offset (in Rotator units)
  • TimeSec - How long the rotation should take
  • DelaySec - How long to wait before starting the rotation

ClearFocusPoint[edit]

function ClearFocusPoint (optional bool bLeaveCameraRotation)

Clear focus point

CreateCameraMode[edit]

protected function GameThirdPersonCameraMode CreateCameraMode (class<GameThirdPersonCameraModeModeClass)

Internal.

FindBestCameraMode[edit]

function GameThirdPersonCameraMode FindBestCameraMode (Pawn P)

Evaluates the game state and returns the proper camera mode.

Returns:

new camera mode to use

GetActualFocusLocation[edit]

protected function Object.Vector GetActualFocusLocation ()

Internal. Returns the world space position of the current focus point.

GetFocusActor[edit]

function Actor GetFocusActor ()

Returns ref to the actor currently being used as a focus point, if any.

Init[edit]

function Init ()

Overrides: GameCameraBase.Init


OnBecomeActive[edit]

function OnBecomeActive (GameCameraBase OldCamera)

Overrides: GameCameraBase.OnBecomeActive

Called when Camera mode becomes active

ProcessViewRotation[edit]

function ProcessViewRotation (float DeltaTime, Actor ViewTarget, out Object.Rotator out_ViewRotation, out Object.Rotator out_DeltaRot)

Overrides: GameCameraBase.ProcessViewRotation

Gives cameras a chance to change player view rotation

Reset[edit]

function Reset ()


ResetInterpolation[edit]

function ResetInterpolation ()

Overrides: GameCameraBase.ResetInterpolation

Called to indicate that the next update should skip interpolation and snap to desired values.

SetFocusOnActor[edit]

function SetFocusOnActor (Actor FocusActor, name FocusBoneName, Object.Vector2D InterpSpeedRange, Object.Vector2D InFocusFOV, optional float CameraFOV, optional bool bAlwaysFocus, optional bool bAdjustCamera, optional bool bIgnoreTrace, optional float FocusPitchOffsetDeg)

Tells camera to focus on the given actor.

SetFocusOnLoc[edit]

function SetFocusOnLoc (Object.Vector FocusWorldLoc, Object.Vector2D InterpSpeedRange, Object.Vector2D InFocusFOV, optional float CameraFOV, optional bool bAlwaysFocus, optional bool bAdjustCamera, optional bool bIgnoreTrace, optional float FocusPitchOffsetDeg)

Tells camera to focus on the given world position.

UpdateCamera[edit]

function UpdateCamera (Pawn P, float DeltaTime, out Camera.TViewTarget OutVT)

Overrides: GameCameraBase.UpdateCamera

Player Update Camera code

UpdateCameraMode[edit]

final protected function UpdateCameraMode (Pawn P)

Update current camera modes. Pick Best, handle transitions, etc.