VR Interaction Framework v2.0
Loading...
Searching...
No Matches
BNG.BNGPlayerController Class Reference

The BNGPlayerController handles basic player movement. More...

Inheritance diagram for BNG.BNGPlayerController:

Public Member Functions

virtual void CheckPlayerElevationRespawn ()
 Check if the player has moved beyond the specified min / max elevation Player should never go above or below 6000 units as physics can start to jitter due to floating point precision Maybe they clipped through a floor, touched a set "lava" height, etc.
 
virtual void UpdateDistanceFromGround ()
 
virtual void RotateTrackingSpaceToCamera ()
 
virtual void UpdateCameraRigPosition ()
 
virtual void UpdateCharacterHeight ()
 
virtual void UpdateCameraHeight ()
 
virtual void CheckCharacterCollisionMove ()
 Move the character controller to new camera position.
 
virtual void CheckRigidbodyCapsuleMove (Vector3 movePosition)
 
virtual bool IsGrounded ()
 
virtual void OnClimbingChange ()
 

Public Attributes

bool MoveCharacterWithCamera = true
 
bool RotateCharacterWithCamera = true
 
bool ResizeCharacterHeightWithCamera = true
 
Transform TrackingSpace
 
Transform CameraRig
 
Transform CenterEyeAnchor
 
LayerMask GroundedLayers
 
float DistanceFromGround = 0
 0 means we are grounded
 
float DistanceFromGroundOffset = 0
 
float MinimumCapsuleHeight = 0.4f
 Minimum Height our Player's capsule collider can be (in meters)
 
float MaximumCapsuleHeight = 3f
 Maximum Height our Player's capsule collider can be (in meters)
 
float LastTeleportTime
 
float CharacterControllerYOffset = -0.025f
 Offset the height of the CharacterController by this amount.
 
float CameraHeight
 Height of our camera in local coords.
 
bool ElevateCameraIfNoHMDPresent = true
 
float ElevateCameraHeight = 1.65f
 
float MinElevation = -6000f
 If player goes below this elevation they will be reset to their initial starting position. If the player goes too far away from the center they may start to jitter due to floating point precisions. Can also use this to detect if player somehow fell through a floor. Or if the "floor is lava".
 
float MaxElevation = 6000f
 If player goes above this elevation they will be reset to their initial starting position. If the player goes too far away from the center they may start to jitter due to floating point precisions.
 
float LastPlayerMoveTime
 
RaycastHit groundHit
 
float SphereColliderRadius = 0.08f
 

Protected Attributes

CharacterController characterController
 
Rigidbody playerRigid
 
CapsuleCollider playerCapsule
 
SmoothLocomotion smoothLocomotion
 
PlayerClimbing playerClimbing
 
bool isClimbing
 
bool wasClimbing = false
 
RaycastHit hit
 
Transform mainCamera
 

Detailed Description

The BNGPlayerController handles basic player movement.

Member Function Documentation

◆ CheckCharacterCollisionMove()

virtual void BNG.BNGPlayerController.CheckCharacterCollisionMove ( )
virtual

Move the character controller to new camera position.

◆ CheckPlayerElevationRespawn()

virtual void BNG.BNGPlayerController.CheckPlayerElevationRespawn ( )
virtual

Check if the player has moved beyond the specified min / max elevation Player should never go above or below 6000 units as physics can start to jitter due to floating point precision Maybe they clipped through a floor, touched a set "lava" height, etc.

◆ CheckRigidbodyCapsuleMove()

virtual void BNG.BNGPlayerController.CheckRigidbodyCapsuleMove ( Vector3  movePosition)
virtual

◆ IsGrounded()

virtual bool BNG.BNGPlayerController.IsGrounded ( )
virtual

◆ OnClimbingChange()

virtual void BNG.BNGPlayerController.OnClimbingChange ( )
virtual

◆ RotateTrackingSpaceToCamera()

virtual void BNG.BNGPlayerController.RotateTrackingSpaceToCamera ( )
virtual

◆ UpdateCameraHeight()

virtual void BNG.BNGPlayerController.UpdateCameraHeight ( )
virtual

◆ UpdateCameraRigPosition()

virtual void BNG.BNGPlayerController.UpdateCameraRigPosition ( )
virtual

◆ UpdateCharacterHeight()

virtual void BNG.BNGPlayerController.UpdateCharacterHeight ( )
virtual

◆ UpdateDistanceFromGround()

virtual void BNG.BNGPlayerController.UpdateDistanceFromGround ( )
virtual

Member Data Documentation

◆ CameraHeight

float BNG.BNGPlayerController.CameraHeight

Height of our camera in local coords.

◆ CameraRig

Transform BNG.BNGPlayerController.CameraRig

◆ CenterEyeAnchor

Transform BNG.BNGPlayerController.CenterEyeAnchor

◆ characterController

CharacterController BNG.BNGPlayerController.characterController
protected

◆ CharacterControllerYOffset

float BNG.BNGPlayerController.CharacterControllerYOffset = -0.025f

Offset the height of the CharacterController by this amount.

◆ DistanceFromGround

float BNG.BNGPlayerController.DistanceFromGround = 0

0 means we are grounded

◆ DistanceFromGroundOffset

float BNG.BNGPlayerController.DistanceFromGroundOffset = 0

◆ ElevateCameraHeight

float BNG.BNGPlayerController.ElevateCameraHeight = 1.65f

◆ ElevateCameraIfNoHMDPresent

bool BNG.BNGPlayerController.ElevateCameraIfNoHMDPresent = true

◆ GroundedLayers

LayerMask BNG.BNGPlayerController.GroundedLayers

◆ groundHit

RaycastHit BNG.BNGPlayerController.groundHit

◆ hit

RaycastHit BNG.BNGPlayerController.hit
protected

◆ isClimbing

bool BNG.BNGPlayerController.isClimbing
protected

◆ LastPlayerMoveTime

float BNG.BNGPlayerController.LastPlayerMoveTime

◆ LastTeleportTime

float BNG.BNGPlayerController.LastTeleportTime

◆ mainCamera

Transform BNG.BNGPlayerController.mainCamera
protected

◆ MaxElevation

float BNG.BNGPlayerController.MaxElevation = 6000f

If player goes above this elevation they will be reset to their initial starting position. If the player goes too far away from the center they may start to jitter due to floating point precisions.

◆ MaximumCapsuleHeight

float BNG.BNGPlayerController.MaximumCapsuleHeight = 3f

Maximum Height our Player's capsule collider can be (in meters)

◆ MinElevation

float BNG.BNGPlayerController.MinElevation = -6000f

If player goes below this elevation they will be reset to their initial starting position. If the player goes too far away from the center they may start to jitter due to floating point precisions. Can also use this to detect if player somehow fell through a floor. Or if the "floor is lava".

◆ MinimumCapsuleHeight

float BNG.BNGPlayerController.MinimumCapsuleHeight = 0.4f

Minimum Height our Player's capsule collider can be (in meters)

◆ MoveCharacterWithCamera

bool BNG.BNGPlayerController.MoveCharacterWithCamera = true

◆ playerCapsule

CapsuleCollider BNG.BNGPlayerController.playerCapsule
protected

◆ playerClimbing

PlayerClimbing BNG.BNGPlayerController.playerClimbing
protected

◆ playerRigid

Rigidbody BNG.BNGPlayerController.playerRigid
protected

◆ ResizeCharacterHeightWithCamera

bool BNG.BNGPlayerController.ResizeCharacterHeightWithCamera = true

◆ RotateCharacterWithCamera

bool BNG.BNGPlayerController.RotateCharacterWithCamera = true

◆ smoothLocomotion

SmoothLocomotion BNG.BNGPlayerController.smoothLocomotion
protected

◆ SphereColliderRadius

float BNG.BNGPlayerController.SphereColliderRadius = 0.08f

◆ TrackingSpace

Transform BNG.BNGPlayerController.TrackingSpace

◆ wasClimbing

bool BNG.BNGPlayerController.wasClimbing = false
protected

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