parry3d::query::details

Function clip_halfspace_polygon

source
pub fn clip_halfspace_polygon(
    center: &Point<f32>,
    normal: &Vector<f32>,
    polygon: &[Point<f32>],
    result: &mut Vec<Point<f32>>,
)
Expand description

Cuts a polygon with the given half-space.

Given the half-space center and outward normal, this computes the intersecting between the half-space and the polygon. (Note that a point pt is considered as inside of the half-space if normal.dot(&(pt - center)) <= 0.0.