Meta SDK2 Beta  2.7.0
Meta.MultiRaycast Class Reference

This class is used to support use of multiple rayCasts over an area. More...

Static Public Member Functions

static RaycastHit [] MultiRayCast (Vector3 origin, Vector3 direction, int rows, int raysPerRow, float theta, LayerMask layerMask, bool descend=false)
 Sends out multiple RayCasts over an area and returns all the hits. Raycasts are divided into rows and each row is circle shaped. More...
 
static GameObject MostHit (RaycastHit[] hits)
 An example function to deal with the output from MultiRayCast. Simply returns the transform that was hit by the most raycasts. Can be used as the foundation for something cleverer. More...
 
static GameObject MostHitWithWeights (RaycastHit[] hits, float[] rowWeights)
 The object that was hit the most factoring in weights for each row. More...
 

Properties

static int BaseLayers [get]
 IMPORTANT: If the names of the layers used change this must be updated to include the new layer names. More...
 

Detailed Description

This class is used to support use of multiple rayCasts over an area.

Member Function Documentation

◆ MostHit()

static GameObject Meta.MultiRaycast.MostHit ( RaycastHit []  hits)
inlinestatic

An example function to deal with the output from MultiRayCast. Simply returns the transform that was hit by the most raycasts. Can be used as the foundation for something cleverer.

Returns
The transform with the most hits.
Parameters
hitsOutput from MultiRayCast.

◆ MostHitWithWeights()

static GameObject Meta.MultiRaycast.MostHitWithWeights ( RaycastHit []  hits,
float []  rowWeights 
)
inlinestatic

The object that was hit the most factoring in weights for each row.

Returns
The gameobject that was hit the most.
Parameters
hitsHits.
rowWeightsRow weights.

◆ MultiRayCast()

static RaycastHit [] Meta.MultiRaycast.MultiRayCast ( Vector3  origin,
Vector3  direction,
int  rows,
int  raysPerRow,
float  theta,
LayerMask  layerMask,
bool  descend = false 
)
inlinestatic

Sends out multiple RayCasts over an area and returns all the hits. Raycasts are divided into rows and each row is circle shaped.

Returns
An array of RaycastHits
Parameters
originOrigin of the raycasts.
directionThe central direction.
rowsThe number of rows of Raycast.
raysPerRowRayCasts per row.
thetaThe angle between direction and the outermost row.
layerMaskLayer mask.
descendWhether or not to return child colliders.

Property Documentation

◆ BaseLayers

int Meta.MultiRaycast.BaseLayers
staticget

IMPORTANT: If the names of the layers used change this must be updated to include the new layer names.