5 /*----------------------------------------------------------------------
6 Copyright (c) 2004 Open Dynamics Framework Group
10 Redistribution and use in source and binary forms, with or without modification, are permitted provided
11 that the following conditions are met:
13 Redistributions of source code must retain the above copyright notice, this list of conditions
14 and the following disclaimer.
16 Redistributions in binary form must reproduce the above copyright notice,
17 this list of conditions and the following disclaimer in the documentation
18 and/or other materials provided with the distribution.
20 Neither the name of the Open Dynamics Framework Group nor the names of its contributors may
21 be used to endorse or promote products derived from this software without specific prior written permission.
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 DISCLAIMED. IN NO EVENT SHALL THE INTEL OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
28 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 -----------------------------------------------------------------------*/
32 // http://codesuppository.blogspot.com
34 // mailto: jratcliff@infiniplex.net
36 // http://www.amillionpixels.us
48 PlaneTriResult planeTriIntersection(const float *plane, // the plane equation in Ax+By+Cz+D format
49 const float *triangle, // the source position triangle.
50 unsigned int tstride, // stride in bytes between vertices of the triangle.
51 float epsilon, // the co-planer epsilon value.
52 float *front, // the triangle in front of the
53 unsigned int &fcount, // number of vertices in the 'front' triangle.
54 float *back, // the triangle in back of the plane
55 unsigned int &bcount); // the number of vertices in the 'back' triangle.