My Project
Loading...
Searching...
No Matches
CameraController.Camera3D Class Referenceabstract
Inheritance diagram for CameraController.Camera3D:
CameraController.BaseCamera CameraController.FirstPersonCamera CameraController.ThirdPersonCamera

Public Member Functions

void SetRotationLimits (RotationLimits newYawLimits, RotationLimits newPitchLimits)
 Set the limits of the yaw and pitch rotation of the target follower.

Protected Member Functions

virtual void OnEnable ()
override void UpdateCamera ()
 Update the camera and the target follower position.
Protected Member Functions inherited from CameraController.BaseCamera
virtual void Awake ()
virtual void Update ()
virtual void FixedUpdate ()
virtual void LateUpdate ()
void UpdateFollowerPosition ()
 Update the position of the target follower.
void UpdateCameraPosition ()
 Update the position of the camera.
float GetDeltaTime ()
 Get the deltatime based on the cuurent followmode.

Protected Attributes

Vector2 sensitivity
Protected Attributes inherited from CameraController.BaseCamera
Transform target
Transform targetFollower
Transform cameraTransform
Vector3 offset
FollowMode followMode
float followDamping
Vector3 followSmoothDampVelocity

Properties

Quaternion yaw [get]
 The rotation of the camera on the y axis.
Quaternion pitch [get]
 The rotation of the camera on the x axis.
float horizontalSensitivity [get, set]
float verticalSensitivity [get, set]

Private Member Functions

void OnDisable ()
void GetMovementDir (InputAction.CallbackContext context)
void SetTargetFollowerRotation ()
 Update the rotation of the the target follower.
Quaternion GetNewRotation (Quaternion currentRotation, Quaternion rotationToAdd, Vector3 axis, RotationLimits rotationLimits)
 Get the next rotation on the specified axis.
bool IsWithinAllowedRotation (Quaternion nextRotation, Quaternion minAllowedRotation, Quaternion maxAllowedRotation)
 Check wether the next rotation of the camera is within the limits.
Quaternion GetLimitToBeAt (Quaternion currentRotation, Quaternion minRotation, Quaternion maxRotation, bool wrap)
 Get the limit the given rotation should go at.

Private Attributes

Quaternion yawRotation = Quaternion.identity
Quaternion pitchRotation = Quaternion.identity
RotationLimits pitchRotationLimits
RotationLimits yawRotationLimits
InputActionReference look
Vector2 lookInputDir

Member Function Documentation

◆ GetLimitToBeAt()

Quaternion CameraController.Camera3D.GetLimitToBeAt ( Quaternion currentRotation,
Quaternion minRotation,
Quaternion maxRotation,
bool wrap )
private

Get the limit the given rotation should go at.

Parameters
currentRotationth current rotation
minRotationthe minimum allowed rotation
maxRotationthe maximum allowed rotation
wrapWether the rotation should stay at the reached limit or go at the opposite limit.

◆ GetNewRotation()

Quaternion CameraController.Camera3D.GetNewRotation ( Quaternion currentRotation,
Quaternion rotationToAdd,
Vector3 axis,
RotationLimits rotationLimits )
private

Get the next rotation on the specified axis.

Parameters
currentRotationthe current rotation
rotationToAddthe ammount of rotation to add
axisthe axis of the rotation
rotationLimitsthe limits of the rotation
Returns
The product of the current rotation * the rotation to add

◆ IsWithinAllowedRotation()

bool CameraController.Camera3D.IsWithinAllowedRotation ( Quaternion nextRotation,
Quaternion minAllowedRotation,
Quaternion maxAllowedRotation )
private

Check wether the next rotation of the camera is within the limits.

Parameters
nextRotationThe new rotation of the camera
minAllowedRotationThe smallest allowed rotation
maxAllowedRotationThe greatest allowed rotation
Returns
True if the next rotation is within the allowed angle, false otherwise

◆ SetRotationLimits()

void CameraController.Camera3D.SetRotationLimits ( RotationLimits newYawLimits,
RotationLimits newPitchLimits )

Set the limits of the yaw and pitch rotation of the target follower.

Parameters
newYawLimits
newPitchLimits

◆ UpdateCamera()

override void CameraController.Camera3D.UpdateCamera ( )
protectedvirtual

Update the camera and the target follower position.

Reimplemented from CameraController.BaseCamera.


The documentation for this class was generated from the following file:
  • CameraController/Script/Camera/3DCameras/Camera3D.cs