mav_objectIntersectionsSort - Find nearest in list of object intersections.

[ Maverik Level 2 functions ]

#

mav_objectIntersectionsSort

## Summary

Find nearest in list of object intersections.

## Syntax

int mav_objectIntersectionsSort(int nhits, MAV_objectIntersection *hits, float scale, MAV_objectIntersection *res);

- int nhits
  Number of intersection hits.

- MAV_objectIntersection *hits
  Array of intersection hits.

- float scale
  Scaling factor.

- MAV_objectIntersection *res
  Closest intersection.

## Description

This function takes an array `hits` of `nhits` intersections, and returns in `res` the intersection closest to the origin of the intersecting line. `scale` accounts for non-unity scaling of the intersected object.

Back to the index page.