Class GraphCollision

Public

Handles collision checking for graphs.

Mostly used by grid based graphs

Public Methods

Check (position)

Returns true if the position is not obstructed.

Public
CheckHeight (position)

Returns the position with the correct height.

Public
CheckHeight (position, hit, walkable)

Returns the position with the correct height.

Public
CheckHeightAll (position, numHits)

Returns all hits when checking height for position.

Public
Initialize (transform, scale)

Sets up several variables using the specified matrix and scale.

Public
JobCollisionCapsule (nodePositions, collisionCheckResult, up, allocationMethod, dependencyTracker)
Public
JobCollisionRay (nodePositions, collisionCheckResult, up, allocationMethod, dependencyTracker)

Returns if the position is obstructed for all nodes using the Ray collision checking method.

Public

Public Variables

collisionCheck

Toggle collision check.

Public
collisionOffset

Height above the ground that collision checks should be done.

Public
diameter

Diameter of capsule or sphere when checking for collision.

Public
fromHeight

The height to check from when checking height ('ray length' in the inspector).

Public
height

Height of capsule or length of ray when checking for collision.

Public
heightCheck

Toggle height check.

Public
heightMask

Layers to be included in the height check.

Public
mask

Layers to be treated as obstacles.

Public
thickRaycast

Toggles thick raycast.

Public
thickRaycastDiameter

Diameter of the thick raycast in nodes.

Public
type

Collision shape to use.

Public
unwalkableWhenNoGround

Make nodes unwalkable when no ground was found with the height raycast.

Public
up

Direction to use as UP.

Public
use2D

Use Unity 2D Physics API.

Public

Public Static Variables

RaycastErrorMargin

Offset to apply after each raycast to make sure we don't hit the same point again in CheckHeightAll.

Public Static

Private/Protected Members

contactFilter

Used for 2D collision queries.

Private
dummyArray

Just so that the Physics2D.OverlapPoint method has some buffer to store things in.

Private Static
finalRadius

diameter * scale * 0.5.

Private
finalRaycastRadius

thickRaycastDiameter * scale * 0.5.

Private
hitBuffer

Internal buffer used by CheckHeightAll.

Private
upheight

up * height.

Private

Deprecated Members

rayDirection

Direction of the ray when checking for collision.

Public