Third Person Cover Shooter  1.6
CoverShooter.Util Class Reference

Utility functions. More...

Static Public Member Functions

static Mesh Clone (Mesh mesh, int[] triangles)
 
static float GetViewDistance (Vector3 position, float viewDistance, bool isAlerted)
 
static float GetViewDistance (float viewDistance, List< DarkZone > dark, List< LightZone > light, List< GrassZone > grass, bool isAlerted)
 
static T [] GetInterfaces< T > (GameObject gameObject)
 
static bool IsFree (GameObject gameObject, Vector3 origin, Vector3 direction, float distance, bool coverMeansFree, bool actorMeansFree)
 
static bool GetClosestCover (Vector3 position, float radius, ref Cover resultCover, ref Vector3 resultPosition)
 
static RaycastHit GetClosestRaycastHit (Vector3 origin, Vector3 target, float minDistance, GameObject ignore=null)
 
static Vector3 GetClosestNonActorHit (Vector3 origin, Vector3 target, float minDistance, GameObject ignore=null)
 
static Vector3 GetClosestHitIgnoreSide (Vector3 origin, Vector3 target, float minDistance, int side, out Vector3 normal)
 
static Vector3 GetClosestStaticHit (Vector3 origin, Vector3 target, float minDistance, GameObject ignore=null)
 
static Vector3 GetClosestHit (Vector3 origin, Vector3 target, float minDistance, GameObject ignore=null)
 
static float RandomUnobstructedAngle (GameObject gameObject, Vector3 position, float maxObstruction, int attempts=10)
 
static float RandomUnobstructedAngle (GameObject gameObject, Vector3 position, float current, float angleRange, float maxObstruction, int attempts=10)
 
static float GetPinch ()
 
static float Lerp (float Value, float Target, float rate)
 
static float LerpAngle (float Value, float Target, float rate)
 
static Vector3 Lerp (Vector3 Value, Vector3 Target, float rate)
 
static Quaternion Lerp (Quaternion Value, Quaternion Target, float rate)
 
static void Lerp (ref float Value, float Target, float rate)
 
static void LerpAngle (ref float Value, float Target, float rate)
 
static void Lerp (ref Vector3 Value, Vector3 Target, float rate)
 
static void Lerp (ref Quaternion Value, Quaternion Target, float rate)
 
static void Move (ref Vector3 Value, Vector3 Target, float speed)
 
static void Move (ref float Value, float Target, float speed)
 
static void MoveAngle (ref float Value, float Target, float speed)
 
static bool InHiearchyOf (GameObject target, GameObject parent)
 Is the given target object is inside the parent hierarchy. More...
 
static float FindDeltaPath (Vector3 a, Vector3 b, Vector3 point)
 Delta of a point on AB line closest to the given point. More...
 
static Vector3 FindClosestToPath (Vector3 a, Vector3 b, Vector3 point)
 Position of a point on AB line closest to the given .point. More...
 
static Vector3 HorizontalVector (float angle)
 Calculates a vector given the horizontal angle. More...
 
static Vector3 Vector (float horizontal, float vertical)
 Calculates a vector given the horizontal angle. More...
 
static float HorizontalAngle (Vector3 vector)
 Calculates horizontal angle of the given vector. More...
 
static float VerticalAngle (Vector3 vector)
 Calculates vertical angle in degrees. More...
 
static float VerticalAngle (float height, float distance)
 Calculates vertical angle in degrees. More...
 
static float DistanceToSegment (Vector3 point, Vector3 p0, Vector3 p1)
 An utility function to calculate a distance between a point and a segment. More...
 
static Vector3 VectorToSegment (Vector3 point, Vector3 p0, Vector3 p1)
 An utility function to calculate a vector between a point and a segment. More...
 

Static Public Attributes

static Collider [] Colliders = new Collider[256]
 
static RaycastHit [] Hits = new RaycastHit[256]
 

Detailed Description

Utility functions.

Member Function Documentation

◆ Clone()

static Mesh CoverShooter.Util.Clone ( Mesh  mesh,
int []  triangles 
)
static

◆ DistanceToSegment()

static float CoverShooter.Util.DistanceToSegment ( Vector3  point,
Vector3  p0,
Vector3  p1 
)
static

An utility function to calculate a distance between a point and a segment.

◆ FindClosestToPath()

static Vector3 CoverShooter.Util.FindClosestToPath ( Vector3  a,
Vector3  b,
Vector3  point 
)
static

Position of a point on AB line closest to the given .point.

◆ FindDeltaPath()

static float CoverShooter.Util.FindDeltaPath ( Vector3  a,
Vector3  b,
Vector3  point 
)
static

Delta of a point on AB line closest to the given point.

◆ GetClosestCover()

static bool CoverShooter.Util.GetClosestCover ( Vector3  position,
float  radius,
ref Cover  resultCover,
ref Vector3  resultPosition 
)
static

◆ GetClosestHit()

static Vector3 CoverShooter.Util.GetClosestHit ( Vector3  origin,
Vector3  target,
float  minDistance,
GameObject  ignore = null 
)
static

◆ GetClosestHitIgnoreSide()

static Vector3 CoverShooter.Util.GetClosestHitIgnoreSide ( Vector3  origin,
Vector3  target,
float  minDistance,
int  side,
out Vector3  normal 
)
static

◆ GetClosestNonActorHit()

static Vector3 CoverShooter.Util.GetClosestNonActorHit ( Vector3  origin,
Vector3  target,
float  minDistance,
GameObject  ignore = null 
)
static

◆ GetClosestRaycastHit()

static RaycastHit CoverShooter.Util.GetClosestRaycastHit ( Vector3  origin,
Vector3  target,
float  minDistance,
GameObject  ignore = null 
)
static

◆ GetClosestStaticHit()

static Vector3 CoverShooter.Util.GetClosestStaticHit ( Vector3  origin,
Vector3  target,
float  minDistance,
GameObject  ignore = null 
)
static

◆ GetInterfaces< T >()

static T [] CoverShooter.Util.GetInterfaces< T > ( GameObject  gameObject)
static
Type Constraints
T :class 

◆ GetPinch()

static float CoverShooter.Util.GetPinch ( )
static

◆ GetViewDistance() [1/2]

static float CoverShooter.Util.GetViewDistance ( Vector3  position,
float  viewDistance,
bool  isAlerted 
)
static

◆ GetViewDistance() [2/2]

static float CoverShooter.Util.GetViewDistance ( float  viewDistance,
List< DarkZone dark,
List< LightZone light,
List< GrassZone grass,
bool  isAlerted 
)
static

◆ HorizontalAngle()

static float CoverShooter.Util.HorizontalAngle ( Vector3  vector)
static

Calculates horizontal angle of the given vector.

◆ HorizontalVector()

static Vector3 CoverShooter.Util.HorizontalVector ( float  angle)
static

Calculates a vector given the horizontal angle.

◆ InHiearchyOf()

static bool CoverShooter.Util.InHiearchyOf ( GameObject  target,
GameObject  parent 
)
static

Is the given target object is inside the parent hierarchy.

◆ IsFree()

static bool CoverShooter.Util.IsFree ( GameObject  gameObject,
Vector3  origin,
Vector3  direction,
float  distance,
bool  coverMeansFree,
bool  actorMeansFree 
)
static

◆ Lerp() [1/6]

static float CoverShooter.Util.Lerp ( float  Value,
float  Target,
float  rate 
)
static

◆ Lerp() [2/6]

static Vector3 CoverShooter.Util.Lerp ( Vector3  Value,
Vector3  Target,
float  rate 
)
static

◆ Lerp() [3/6]

static Quaternion CoverShooter.Util.Lerp ( Quaternion  Value,
Quaternion  Target,
float  rate 
)
static

◆ Lerp() [4/6]

static void CoverShooter.Util.Lerp ( ref float  Value,
float  Target,
float  rate 
)
static

◆ Lerp() [5/6]

static void CoverShooter.Util.Lerp ( ref Vector3  Value,
Vector3  Target,
float  rate 
)
static

◆ Lerp() [6/6]

static void CoverShooter.Util.Lerp ( ref Quaternion  Value,
Quaternion  Target,
float  rate 
)
static

◆ LerpAngle() [1/2]

static float CoverShooter.Util.LerpAngle ( float  Value,
float  Target,
float  rate 
)
static

◆ LerpAngle() [2/2]

static void CoverShooter.Util.LerpAngle ( ref float  Value,
float  Target,
float  rate 
)
static

◆ Move() [1/2]

static void CoverShooter.Util.Move ( ref Vector3  Value,
Vector3  Target,
float  speed 
)
static

◆ Move() [2/2]

static void CoverShooter.Util.Move ( ref float  Value,
float  Target,
float  speed 
)
static

◆ MoveAngle()

static void CoverShooter.Util.MoveAngle ( ref float  Value,
float  Target,
float  speed 
)
static

◆ RandomUnobstructedAngle() [1/2]

static float CoverShooter.Util.RandomUnobstructedAngle ( GameObject  gameObject,
Vector3  position,
float  maxObstruction,
int  attempts = 10 
)
static

◆ RandomUnobstructedAngle() [2/2]

static float CoverShooter.Util.RandomUnobstructedAngle ( GameObject  gameObject,
Vector3  position,
float  current,
float  angleRange,
float  maxObstruction,
int  attempts = 10 
)
static

◆ Vector()

static Vector3 CoverShooter.Util.Vector ( float  horizontal,
float  vertical 
)
static

Calculates a vector given the horizontal angle.

◆ VectorToSegment()

static Vector3 CoverShooter.Util.VectorToSegment ( Vector3  point,
Vector3  p0,
Vector3  p1 
)
static

An utility function to calculate a vector between a point and a segment.

◆ VerticalAngle() [1/2]

static float CoverShooter.Util.VerticalAngle ( Vector3  vector)
static

Calculates vertical angle in degrees.

◆ VerticalAngle() [2/2]

static float CoverShooter.Util.VerticalAngle ( float  height,
float  distance 
)
static

Calculates vertical angle in degrees.

Member Data Documentation

◆ Colliders

Collider [] CoverShooter.Util.Colliders = new Collider[256]
static

◆ Hits

RaycastHit [] CoverShooter.Util.Hits = new RaycastHit[256]
static

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