Third Person Cover Shooter  1.6
CoverShooter.ThirdPersonCamera Class Reference

Manages the camera object by setting an appropriate orientation depending on the target object's state. More...

Inheritance diagram for CoverShooter.ThirdPersonCamera:
CoverShooter.BaseCamera CoverShooter.CharacterCamera

Public Member Functions

void Shake (float intensity, float time)
 Shakes the camera in certain intensity for a certain time. More...
 
Vector3 CalculateAimTarget (bool includeRecoil)
 Calculates target position to be aimed at in the world. More...
 
void UpdatePosition ()
 Update camera position and orientation based on the latest known information. More...
 
override void UpdateForCharacterMotor ()
 Update performed after the character motor does it's thing. More...
 
- Public Member Functions inherited from CoverShooter.BaseCamera
TargetComponent< T > ()
 Get cached component of the target object. More...
 
override void DeferUpdate (ICharacterController controller)
 Asks the camera to call UpdateAfterCamera on the given controller after the camera does it's update. More...
 

Static Public Member Functions

static void Shake (Vector3 position, float intensity, float time)
 Shakes the main camera due to an explosion at a position. More...
 
static void Shake (CharacterMotor motor, float intensity, float time)
 Shakes the main camera in certain intensity for a certain time. More...
 

Public Attributes

bool AvoidObstacles = true
 Is the camera adjusting itself so there are no colliders between it and the target. More...
 
bool IgnoreObstaclesWhenZooming = true
 Should the AvoidObstacles be ignored when the character is zooming in. More...
 
float Zoom = 10
 Reduction in field of view when zooming in without a scope. More...
 
bool ShakingAffectsAim = true
 Does camera shake affect aiming. More...
 
bool AskForSmoothRotations = true
 Should the camera ask for smoother rotation animations when zooming in. More...
 
CameraStates States = CameraStates.GetDefault()
 Camera settings for all gameplay situations. More...
 
float Horizontal
 Horizontal orientation of the camera in degrees. More...
 
float Vertical
 Vertical orientation of the camera in degrees. More...
 
float VerticalRecoil
 Vertical recoil offset in degrees. More...
 
float HorizontalRecoil
 Horizontal recoil offset in degrees. More...
 
- Public Attributes inherited from CoverShooter.BaseCamera
CharacterMotor Target
 Target character motor. More...
 
Action TargetChanged
 Executed on every camera target change. More...
 

Protected Member Functions

override void Update ()
 

Properties

float StateFOV [get]
 Field of view as defined by the current camera state. More...
 
string State [get]
 Current state name. More...
 
float CrosshairAlpha [get]
 Alpha transparency of a crosshair that's drawn for this camera. More...
 
float ShakeOffset [get]
 Current maximum shake angle offset. More...
 

Detailed Description

Manages the camera object by setting an appropriate orientation depending on the target object's state.

For camera to work you have to link it to the target object that has a Character Motor attached. The camera component also maintains and draws a crosshair. It hides the crosshair if the character is unarmed or unable to fire at a wall because is too close. The visibility of crosshair also can be turned off manually by setting Is Crosshair Enabled value to false when your game needs so.

Member Function Documentation

◆ CalculateAimTarget()

Vector3 CoverShooter.ThirdPersonCamera.CalculateAimTarget ( bool  includeRecoil)

Calculates target position to be aimed at in the world.

◆ Shake() [1/3]

static void CoverShooter.ThirdPersonCamera.Shake ( Vector3  position,
float  intensity,
float  time 
)
static

Shakes the main camera due to an explosion at a position.

◆ Shake() [2/3]

static void CoverShooter.ThirdPersonCamera.Shake ( CharacterMotor  motor,
float  intensity,
float  time 
)
static

Shakes the main camera in certain intensity for a certain time.

Only if it is the ThirdPersonCamera with the same character motor.

◆ Shake() [3/3]

void CoverShooter.ThirdPersonCamera.Shake ( float  intensity,
float  time 
)

Shakes the camera in certain intensity for a certain time.

◆ Update()

override void CoverShooter.ThirdPersonCamera.Update ( )
protectedvirtual

Reimplemented from CoverShooter.BaseCamera.

◆ UpdateForCharacterMotor()

override void CoverShooter.ThirdPersonCamera.UpdateForCharacterMotor ( )
virtual

Update performed after the character motor does it's thing.

Reimplemented from CoverShooter.BaseCamera.

◆ UpdatePosition()

void CoverShooter.ThirdPersonCamera.UpdatePosition ( )

Update camera position and orientation based on the latest known information.

Member Data Documentation

◆ AskForSmoothRotations

bool CoverShooter.ThirdPersonCamera.AskForSmoothRotations = true

Should the camera ask for smoother rotation animations when zooming in.

◆ AvoidObstacles

bool CoverShooter.ThirdPersonCamera.AvoidObstacles = true

Is the camera adjusting itself so there are no colliders between it and the target.

◆ Horizontal

float CoverShooter.ThirdPersonCamera.Horizontal

Horizontal orientation of the camera in degrees.

◆ HorizontalRecoil

float CoverShooter.ThirdPersonCamera.HorizontalRecoil

Horizontal recoil offset in degrees.

◆ IgnoreObstaclesWhenZooming

bool CoverShooter.ThirdPersonCamera.IgnoreObstaclesWhenZooming = true

Should the AvoidObstacles be ignored when the character is zooming in.

◆ ShakingAffectsAim

bool CoverShooter.ThirdPersonCamera.ShakingAffectsAim = true

Does camera shake affect aiming.

◆ States

CameraStates CoverShooter.ThirdPersonCamera.States = CameraStates.GetDefault()

Camera settings for all gameplay situations.

◆ Vertical

float CoverShooter.ThirdPersonCamera.Vertical

Vertical orientation of the camera in degrees.

◆ VerticalRecoil

float CoverShooter.ThirdPersonCamera.VerticalRecoil

Vertical recoil offset in degrees.

◆ Zoom

float CoverShooter.ThirdPersonCamera.Zoom = 10

Reduction in field of view when zooming in without a scope.

Property Documentation

◆ CrosshairAlpha

float CoverShooter.ThirdPersonCamera.CrosshairAlpha
get

Alpha transparency of a crosshair that's drawn for this camera.

Camera itself doesn't draw it.

◆ ShakeOffset

float CoverShooter.ThirdPersonCamera.ShakeOffset
get

Current maximum shake angle offset.

Used for crosshair size.

◆ State

string CoverShooter.ThirdPersonCamera.State
get

Current state name.

◆ StateFOV

float CoverShooter.ThirdPersonCamera.StateFOV
get

Field of view as defined by the current camera state.


The documentation for this class was generated from the following file: