collision_moving_sphere_and_face(3)

NAME
collision_moving_sphere_and_face - detect collision between a moving sphere and a fixed face

SYNOPSIS
#include <matvec.h>

int collision_moving_sphere_and_face (const float *p0, const float *p1, float radius, const float *points, int nr_points, const float *plane, float *collision_point);

DESCRIPTION

This function detects collisions between a sphere which is moving at constant speed along a linear path and a fixed bounded convex polygon ("face").

The centre of the sphere moves from point p0 to point p1. The sphere has radius radius.

The face is described by the list of bounding points, and the plane coefficients of the plane of the face (you may pass plane as NULL in which case the function works out the plane coefficients for you, although this is generally less efficient).

RETURNS
If there was a collision, this function returns true and sets the collision point in collision_point. Note that the collision point is the position of the centre of the sphere at the point of collision, NOT the place where the sphere touches the face. If there was no collision, this function returns false.

AUTHOR
Richard Jones <rich@annexia.org>

LICENSE
GNU LGPL (see http://www.gnu.org/)

VERSION
c2lib-1.2.14