Highroad Engine v1.3
Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.Tools.MMGhostCamera Class Reference

Add this class to a camera and you'll be able to pilot it using the horizontal/vertical axis, and up/down controls set via its inspector. It's got an activation button, a run button, and an option to slow down time (this will require a MMTimeManager present in the scene) More...

Inheritance diagram for MoreMountains.Tools.MMGhostCamera:

Public Attributes

float MovementSpeed = 10f
 the camera's movement speed More...
 
float RunFactor = 4f
 the factor by which to multiply the speed when "running" More...
 
float Acceleration = 5f
 the movement's acceleration More...
 
float Deceleration = 5f
 the movement's deceleration More...
 
float RotationSpeed = 40f
 the speed at which the camera rotates More...
 
KeyCode ActivateButton = KeyCode.RightShift
 the button used to toggle the camera on/off More...
 
string HorizontalAxisName = "Horizontal"
 the name of the InputManager's horizontal axis More...
 
string VerticalAxisName = "Vertical"
 the name of the InputManager's vertical axis More...
 
KeyCode UpButton = KeyCode.Space
 the button to use to go up More...
 
KeyCode DownButton = KeyCode.C
 the button to use to go down More...
 
KeyCode ControlsModeSwitch = KeyCode.M
 the button to use to switch between mobile and desktop control mode More...
 
KeyCode TimescaleModificationButton = KeyCode.F
 the button used to modify the timescale More...
 
KeyCode RunButton = KeyCode.LeftShift
 the button used to run while it's pressed More...
 
float MouseSensitivity = 0.02f
 the mouse's sensitivity More...
 
float MobileStickSensitivity = 2f
 the right stick sensitivity More...
 
float TimescaleModifier = 0.5f
 the amount to modify the timescale by when pressing the timescale button More...
 
bool AutoActivation = true
 whether or not this camera should activate on start More...
 
bool MovementEnabled = true
 whether or not movement (up/down/left/right/forward/backward) is enabled More...
 
bool RotationEnabled = true
 
bool Active = false
 whether this camera is active or not right now More...
 
bool TimeAltered = false
 whether time is being altered right now or not More...
 
bool UseMobileControls
 
GameObject LeftStickContainer
 
GameObject RightStickContainer
 
MMTouchJoystick LeftStick
 
MMTouchJoystick RightStick
 

Protected Member Functions

virtual void Start ()
 On start, activate our camera if needed More...
 
virtual void Update ()
 On Update we grab our input and move accordingly More...
 
virtual void GetInput ()
 Grabs and stores the various input values More...
 
virtual void HandleMobileControls ()
 Turns controls to mobile if needed More...
 
virtual void Translate ()
 Computes the new position More...
 
virtual void Rotate ()
 Computes the new rotation More...
 
virtual void Move ()
 Modifies the camera's transform's position and rotation More...
 
virtual void ToggleSlowMotion ()
 Toggles the timescale modification More...
 
virtual void ToggleFreeCamera ()
 Toggles the camera's active state More...
 

Protected Attributes

Vector3 _currentInput
 
Vector3 _lerpedInput
 
Vector3 _normalizedInput
 
float _acceleration
 
float _deceleration
 
Vector3 _movementVector = Vector3.zero
 
float _speedMultiplier
 
Vector3 _newEulerAngles
 

Detailed Description

Add this class to a camera and you'll be able to pilot it using the horizontal/vertical axis, and up/down controls set via its inspector. It's got an activation button, a run button, and an option to slow down time (this will require a MMTimeManager present in the scene)

Member Function Documentation

◆ GetInput()

virtual void MoreMountains.Tools.MMGhostCamera.GetInput ( )
protectedvirtual

Grabs and stores the various input values

◆ HandleMobileControls()

virtual void MoreMountains.Tools.MMGhostCamera.HandleMobileControls ( )
protectedvirtual

Turns controls to mobile if needed

◆ Move()

virtual void MoreMountains.Tools.MMGhostCamera.Move ( )
protectedvirtual

Modifies the camera's transform's position and rotation

◆ Rotate()

virtual void MoreMountains.Tools.MMGhostCamera.Rotate ( )
protectedvirtual

Computes the new rotation

◆ Start()

virtual void MoreMountains.Tools.MMGhostCamera.Start ( )
protectedvirtual

On start, activate our camera if needed

◆ ToggleFreeCamera()

virtual void MoreMountains.Tools.MMGhostCamera.ToggleFreeCamera ( )
protectedvirtual

Toggles the camera's active state

◆ ToggleSlowMotion()

virtual void MoreMountains.Tools.MMGhostCamera.ToggleSlowMotion ( )
protectedvirtual

Toggles the timescale modification

◆ Translate()

virtual void MoreMountains.Tools.MMGhostCamera.Translate ( )
protectedvirtual

Computes the new position

◆ Update()

virtual void MoreMountains.Tools.MMGhostCamera.Update ( )
protectedvirtual

On Update we grab our input and move accordingly

Member Data Documentation

◆ _acceleration

float MoreMountains.Tools.MMGhostCamera._acceleration
protected

◆ _currentInput

Vector3 MoreMountains.Tools.MMGhostCamera._currentInput
protected

◆ _deceleration

float MoreMountains.Tools.MMGhostCamera._deceleration
protected

◆ _lerpedInput

Vector3 MoreMountains.Tools.MMGhostCamera._lerpedInput
protected

◆ _movementVector

Vector3 MoreMountains.Tools.MMGhostCamera._movementVector = Vector3.zero
protected

◆ _newEulerAngles

Vector3 MoreMountains.Tools.MMGhostCamera._newEulerAngles
protected

◆ _normalizedInput

Vector3 MoreMountains.Tools.MMGhostCamera._normalizedInput
protected

◆ _speedMultiplier

float MoreMountains.Tools.MMGhostCamera._speedMultiplier
protected

◆ Acceleration

float MoreMountains.Tools.MMGhostCamera.Acceleration = 5f

the movement's acceleration

◆ ActivateButton

KeyCode MoreMountains.Tools.MMGhostCamera.ActivateButton = KeyCode.RightShift

the button used to toggle the camera on/off

◆ Active

bool MoreMountains.Tools.MMGhostCamera.Active = false

whether this camera is active or not right now

◆ AutoActivation

bool MoreMountains.Tools.MMGhostCamera.AutoActivation = true

whether or not this camera should activate on start

◆ ControlsModeSwitch

KeyCode MoreMountains.Tools.MMGhostCamera.ControlsModeSwitch = KeyCode.M

the button to use to switch between mobile and desktop control mode

◆ Deceleration

float MoreMountains.Tools.MMGhostCamera.Deceleration = 5f

the movement's deceleration

◆ DownButton

KeyCode MoreMountains.Tools.MMGhostCamera.DownButton = KeyCode.C

the button to use to go down

◆ HorizontalAxisName

string MoreMountains.Tools.MMGhostCamera.HorizontalAxisName = "Horizontal"

the name of the InputManager's horizontal axis

◆ LeftStick

MMTouchJoystick MoreMountains.Tools.MMGhostCamera.LeftStick

◆ LeftStickContainer

GameObject MoreMountains.Tools.MMGhostCamera.LeftStickContainer

◆ MobileStickSensitivity

float MoreMountains.Tools.MMGhostCamera.MobileStickSensitivity = 2f

the right stick sensitivity

◆ MouseSensitivity

float MoreMountains.Tools.MMGhostCamera.MouseSensitivity = 0.02f

the mouse's sensitivity

◆ MovementEnabled

bool MoreMountains.Tools.MMGhostCamera.MovementEnabled = true

whether or not movement (up/down/left/right/forward/backward) is enabled

◆ MovementSpeed

float MoreMountains.Tools.MMGhostCamera.MovementSpeed = 10f

the camera's movement speed

◆ RightStick

MMTouchJoystick MoreMountains.Tools.MMGhostCamera.RightStick

◆ RightStickContainer

GameObject MoreMountains.Tools.MMGhostCamera.RightStickContainer

◆ RotationEnabled

bool MoreMountains.Tools.MMGhostCamera.RotationEnabled = true

◆ RotationSpeed

float MoreMountains.Tools.MMGhostCamera.RotationSpeed = 40f

the speed at which the camera rotates

◆ RunButton

KeyCode MoreMountains.Tools.MMGhostCamera.RunButton = KeyCode.LeftShift

the button used to run while it's pressed

◆ RunFactor

float MoreMountains.Tools.MMGhostCamera.RunFactor = 4f

the factor by which to multiply the speed when "running"

◆ TimeAltered

bool MoreMountains.Tools.MMGhostCamera.TimeAltered = false

whether time is being altered right now or not

◆ TimescaleModificationButton

KeyCode MoreMountains.Tools.MMGhostCamera.TimescaleModificationButton = KeyCode.F

the button used to modify the timescale

◆ TimescaleModifier

float MoreMountains.Tools.MMGhostCamera.TimescaleModifier = 0.5f

the amount to modify the timescale by when pressing the timescale button

◆ UpButton

KeyCode MoreMountains.Tools.MMGhostCamera.UpButton = KeyCode.Space

the button to use to go up

◆ UseMobileControls

bool MoreMountains.Tools.MMGhostCamera.UseMobileControls

◆ VerticalAxisName

string MoreMountains.Tools.MMGhostCamera.VerticalAxisName = "Vertical"

the name of the InputManager's vertical axis


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