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

Property group 'Debug'

bDebugChangedCameraMode

Type: bool

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

Property group 'Focus'

Focus_BackOffStrength

Type: float

move back pct based on move up

Default value: 0.33

Focus_FastAdjustKickInTime

Type: float

time it takes for fast interpolation speed to kick in

Default value: 0.5

Focus_MaxTries

Type: int

number of tries to have focus in view

Default value: 4

Focus_StepHeightAdjustment

Type: float

Z offset step for every try

Default value: 64.0

FocusPoint

Type: CamFocusPointParams

current focus point

Property group 'GameThirdPersonCamera'

bDrawDebug

Type: bool

Modifiers: protected

toggles debug mode

CurrentCamMode

Type: GameThirdPersonCameraMode

Modifiers: editinline, transient

Current GearCam Mode

DirectLookInterpSpeed

Type: float


Default value: 6.0

OffsetAdjustmentInterpSpeed

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

Type: float

origin offset interpolation speed

Default value: 8.0

PenetrationAvoidanceFeelers

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

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

Type: float

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

Default value: 0.15

PenetrationExtentScale

Type: float

camera extent scale to use when calculating penetration for this segment

Default value: 1.0

ThirdPersonCamDefault

Type: GameThirdPersonCameraMode

Modifiers: protected, editinline

Base camera position when walking

ThirdPersonCamDefaultClass

Type: class<GameThirdPersonCameraMode>

Modifiers: protected


Default value: Class'GameFramework.GameThirdPersonCameraMode_Default'

WorstLocInterpSpeed

Type: float


Default value: 8.0

WorstLocPenetrationExtentScale

Type: float

camera extent scale to use when calculating penetration for this segment

Default value: 1.0

Internal variables

ActualFocusPointWorldLoc

Type: Object.Vector

Modifiers: transient, protected


bDoingACameraTurn

Type: bool

Modifiers: protected


bDoingDirectLook

Type: bool

Modifiers: transient


bFocusPointSet

Type: bool

do we have a focus point set?

bFocusPointSuccessful

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

Type: bool

Modifiers: protected


DirectLookYaw

Type: int

Modifiers: transient

direct look vars

LastActualCameraOrigin

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

Type: Object.Rotator

Modifiers: transient


LastActualOriginOffset

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

Type: float

Modifiers: transient

last CamFOV for war cam interpolation

LastFocusChangeTime

Type: float

Modifiers: transient, protected

Last time focus point changed (location)

LastFocusPointLoc

Type: Object.Vector

Modifiers: transient, protected

Last focus point location

LastHeightAdjustment

Type: float

Modifiers: transient

last offset adjustment, for smooth blend out

LastOffsetAdjustment

Type: Object.Vector

Modifiers: protectedwrite, transient

Offset adjustment from last tick, used for interpolation.

LastPitchAdjustment

Type: float

Modifiers: transient

last adjusted pitch, for smooth blend out

LastPostCamTurnYaw

Type: int

Modifiers: protected, transient

Saved data for camera turn "align when finished" functionality

LastPreModifierCameraLoc

Type: Object.Vector

Modifiers: transient

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

LastPreModifierCameraRot

Type: Object.Rotator

Modifiers: transient


LastViewOffset

Type: Object.Vector

Modifiers: transient

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

LastWorstLocationLocal

Type: Object.Vector

Modifiers: transient


LastYawAdjustment

Type: float

Modifiers: transient

last adjusted Yaw, for smooth blend out

LeftoverPitchAdjustment

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

Type: float

Modifiers: protected

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

Default value: 1.0

TurnCurTime

Type: float

Modifiers: protected

Vars for code-driven camera turns

TurnDelay

Type: float

Modifiers: protected


TurnEndAngle

Type: int

Modifiers: protected


TurnStartAngle

Type: int

Modifiers: protected


TurnTotalTime

Type: float

Modifiers: protected


WorstLocBlockedPct

Type: float

obstruction pct from origin to worstloc origin

Structs

CamFocusPointParams

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

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

Native functions

EndTurn

native function EndTurn ()

Stops a camera rotation.

PlayerUpdateCamera

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

Internal camera updating code

Events

GetDesiredFOV

event float GetDesiredFOV (Pawn ViewedPawn)

returns camera mode desired FOV

ModifyPostProcessSettings

event ModifyPostProcessSettings (out PostProcessVolume.PostProcessSettings PP)

Overrides: GameCameraBase.ModifyPostProcessSettings


UpdateFocusPoint

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

AdjustFocusPointInterpolation

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

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

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

function ClearFocusPoint (optional bool bLeaveCameraRotation)

Clear focus point

CreateCameraMode

protected function GameThirdPersonCameraMode CreateCameraMode (class<GameThirdPersonCameraModeModeClass)

Internal.

FindBestCameraMode

function GameThirdPersonCameraMode FindBestCameraMode (Pawn P)

Evaluates the game state and returns the proper camera mode.

Returns:

new camera mode to use

GetActualFocusLocation

protected function Object.Vector GetActualFocusLocation ()

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

GetFocusActor

function Actor GetFocusActor ()

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

Init

function Init ()

Overrides: GameCameraBase.Init


OnBecomeActive

function OnBecomeActive (GameCameraBase OldCamera)

Overrides: GameCameraBase.OnBecomeActive

Called when Camera mode becomes active

ProcessViewRotation

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

function Reset ()


ResetInterpolation

function ResetInterpolation ()

Overrides: GameCameraBase.ResetInterpolation

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

SetFocusOnActor

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

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

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

Overrides: GameCameraBase.UpdateCamera

Player Update Camera code

UpdateCameraMode

final protected function UpdateCameraMode (Pawn P)

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