Table of Contents

Method Raycast

Namespace
Pinwheel.Griffin
Assembly
Pinwheel.Polaris.Runtime.dll

Raycast(Ray, out RaycastHit, float)

Perform physics raycast against this terrain. This is just a convenient function, you can use Physics.Raycast as usual.

public bool Raycast(Ray ray, out RaycastHit hit, float distance)

Parameters

ray Ray

The ray to cast against this terrian.

hit RaycastHit

Will contains hit point information.

distance float

Length of the ray.

Returns

bool

True if ray was hit the terrain.

Raycast(Vector3, out RaycastHit)

Perform a top-down raycast against this terrain. This is just a convenient function, you can use Physics.Raycast as usual.

public bool Raycast(Vector3 normalizePoint, out RaycastHit hit)

Parameters

normalizePoint Vector3

Ray position in terrain's normalized [0-1] space. Y component will be omitted.

hit RaycastHit

Will contains information about the hit point.

Returns

bool

True if ray hits the terrain.

Raycast(Ray, out RaycastHit, float, int)

Perform raycast against all terrain within a group. This is a convenient function, you can use Physics.Raycast as usual.

public static bool Raycast(Ray ray, out RaycastHit hit, float distance, int groupId)

Parameters

ray Ray

The ray to cast.

hit RaycastHit

Will contains information about the hit point.

distance float

Length of the ray.

groupId int

Terrain group id.

Returns

bool

True if ray hits any terrain.