devel/CSGLib/src/ML_Triangle.cpp
// This function projects a ball onto the side of the plane the center is on.
// It returns the new center of the ball.
This function projects a ball onto the side of the plane the center is on.
It returns the new center of the ball.
This function projects a ball onto the side of the plane the center is on . It returns the new center of the ball .
mlVector3D mlProjectBall(const mlVector3D & vPosition, float fRadius, mlTriangle & triPlane)
{
	mlVector3D vProjected = triPlane.ProjectPoint(vPosition);
	mlVector3D vShiftFromProjected = vProjected - vPosition;
	vShiftFromProjected.Normalise();
	vShiftFromProjected *= fRadius;
	return vProjected - vShiftFromProjected;
}
mlVector3D mlProjectBall ( const mlVector3D & vPosition , float fRadius , mlTriangle & triPlane ) { mlVector3D vProjected = triPlane . ProjectPoint ( vPosition ) ; mlVector3D vShiftFromProjected = vProjected - vPosition ; vShiftFromProjected . Normalise ( ) ; vShiftFromProjected *= fRadius ; return vProjected - vShiftFromProjected ; }
This function projects a ball onto the side of the plane the center is on.
This function projects a ball onto the side of the plane the center is on .