C# Class SuperCharacterController.SuperGround, SuperCharacterController

Mostrar archivo Open project: IronWarrior/SuperCharacterController

Public Methods

Method Description
DebugGround ( bool primary, bool near, bool far, bool flush, bool step ) : void
Distance ( ) : float
IsGrounded ( bool currentlyGrounded, float distance ) : bool
IsGrounded ( bool currentlyGrounded, float distance, Vector3 &groundNormal ) : bool
PrimaryNormal ( ) : Vector3
ProbeGround ( Vector3 origin, int iter ) : void

Scan the surface below us for ground. Follow up the initial scan with subsequent scans designed to test what kind of surface we are standing above and handle different edge cases

SuperGround ( LayerMask walkable, SuperCharacterController, controller, QueryTriggerInteraction triggerInteraction ) : System

Private Methods

Method Description
OnSteadyGround ( Vector3 normal, Vector3 point ) : bool

To help the controller smoothly "fall" off surfaces and not hang on the edge of ledges, check that the ground below us is "steady", or that the controller is not standing on too extreme of a ledge

ResetGrounds ( ) : void
SimulateSphereCast ( Vector3 groundNormal, RaycastHit &hit ) : bool

Provides raycast data based on where a SphereCast would contact the specified normal Raycasting downwards from a point along the controller's bottom sphere, based on the provided normal

Method Details

DebugGround() public method

public DebugGround ( bool primary, bool near, bool far, bool flush, bool step ) : void
primary bool
near bool
far bool
flush bool
step bool
return void

Distance() public method

public Distance ( ) : float
return float

IsGrounded() public method

public IsGrounded ( bool currentlyGrounded, float distance ) : bool
currentlyGrounded bool
distance float
return bool

IsGrounded() public method

public IsGrounded ( bool currentlyGrounded, float distance, Vector3 &groundNormal ) : bool
currentlyGrounded bool
distance float
groundNormal Vector3
return bool

PrimaryNormal() public method

public PrimaryNormal ( ) : Vector3
return Vector3

ProbeGround() public method

Scan the surface below us for ground. Follow up the initial scan with subsequent scans designed to test what kind of surface we are standing above and handle different edge cases
public ProbeGround ( Vector3 origin, int iter ) : void
origin Vector3 Center of the sphere for the initial SphereCast
iter int Debug tool to print out which ProbeGround iteration is being run (3 are run each frame for the controller)
return void

SuperGround() public method

public SuperGround ( LayerMask walkable, SuperCharacterController, controller, QueryTriggerInteraction triggerInteraction ) : System
walkable LayerMask
controller SuperCharacterController,
triggerInteraction QueryTriggerInteraction
return System