Helper Scripts Collection 1.3.1
API documentation for the helper scripts compatible with Unity3D
|
A helper class to determine random points in the 3D space More...
Public Member Functions | |
virtual Vector3 | GetRandomPointInSphere () |
Get a random point inside a unit sphere multiplied by and within bounds of minMaxDistance More... | |
virtual Vector3 | GetRandomPointInSphereArea (Transform target) |
Get a random point inside a limited sphere area based on minAngleFromLookDir, maxAngleFromLookDir, minMaxDistance and shiftAngleClockwise for the given target s position and orientation More... | |
virtual Vector3 | GetRandomPointOnStraightLine (Vector3 originPoint, Vector3 normalizedLookDirection) |
Get a random Vector3 point on a straight line based on the originPoint and the normalizedLookDirection multiplied by and in bounds of minMaxDistance More... | |
Static Public Member Functions | |
static Vector3 | GetRandomPointOnStraightLine (Vector3 originPoint, Vector3 normalizedLookDirection, float minDist, float maxDist) |
Get a random Vector3 point on a straight line based on the originPoint and the normalizedLookDirection multiplied by and in bounds of minDist and maxDist More... | |
static Vector3 | GetRandomPointInSphereArea (Vector3 position, Vector3 localUp, Vector3 localFwd, float minAngle, float maxAngle, float minDist, float maxDist, float shiftAngleClock) |
Get a random point inside a limited sphere area based on the given params for the given position and local orientations. Look into the non-static GetRandomPointInSphereArea(UnityEngine.Transform) method to understand the required params of this method. More... | |
static Vector3 | GetRandomUnitPointInSphereArea (float minAngle=0, float maxAngle=180) |
Spawn a random point inside a unit sphere without any position or orientation context More... | |
static Vector3 | GetClosestPointOnSurface (Vector3 airPoint, Vector3 shootDir, float maxDist=50, params string[] layerMasks) |
Try to get the closest point on a surface with the accepted layerMasks based on the starting airPoint , the shootDir and the maxDist More... | |
static Vector3 | GetRandomPointOnSurface (Vector3 airPoint, Vector3 offsetAirPoint, Vector3 shootDir, float maxDist=50, params string[] layerMasks) |
static Vector3 | GetClosestPointOnNavmesh (Vector3 pointSomewhere, float searchRadiusOfPoint=5, int navMeshArea=-1) |
A helper class to determine random points in the 3D space
|
static |
Try to get the closest point on a surface with the accepted layerMasks based on the starting airPoint , the shootDir and the maxDist
airPoint | The floating starting point |
shootDir | Try to hit a surface based on this dir |
maxDist | How far shoot we shoot? |
layerMasks | What colliders are accepted? |
|
virtual |
Get a random point inside a unit sphere multiplied by and within bounds of minMaxDistance
|
virtual |
Get a random point inside a limited sphere area based on minAngleFromLookDir, maxAngleFromLookDir, minMaxDistance and shiftAngleClockwise for the given target s position and orientation
target |
|
static |
Get a random point inside a limited sphere area based on the given params for the given position and local orientations. Look into the non-static GetRandomPointInSphereArea(UnityEngine.Transform) method to understand the required params of this method.
position | The starting position |
localUp | The targets normalized local up vector |
localFwd | The targets normalized local fwd vector |
minAngle | The minimum spawn-point angle of the imaginary sphere |
maxAngle | The maximum spawn-point angle of the imaginary sphere |
minDist | The minimum spawn distance radius |
maxDist | The maximum spawn distance radius |
shiftAngleClock | Shift the spawn point clockwise |
|
virtual |
Get a random Vector3 point on a straight line based on the originPoint and the normalizedLookDirection multiplied by and in bounds of minMaxDistance
originPoint | |
normalizedLookDirection |
|
static |
Get a random Vector3 point on a straight line based on the originPoint and the normalizedLookDirection multiplied by and in bounds of minDist and maxDist
originPoint | |
normalizedLookDirection | |
minDist | |
maxDist |
|
static |
Spawn a random point inside a unit sphere without any position or orientation context
minAngle | |
maxAngle |