00001 /* 00002 * Triangle cutter header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_MATH_TRIANGLECUTTER_H__ 00009 #define __SP_MATH_TRIANGLECUTTER_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 #include "Base/spMath.hpp" 00014 00015 #include <list> 00016 00017 00018 namespace sp 00019 { 00020 namespace math 00021 { 00022 00023 00025 enum ETriangleCutResults 00026 { 00027 TRIANGLECUT_NONE, 00028 TRIANGLECUT_QUAD_AND_TRIANGLE, 00029 TRIANGLECUT_TWO_TRIANGLES, 00030 }; 00031 00032 00033 struct STriangleCut 00034 { 00035 dim::triangle3df TrianglePrimary; 00036 dim::triangle3df TriangleSecondaryA; 00037 dim::triangle3df TriangleSecondaryB; 00038 }; 00039 00040 00045 namespace TriangleCutter 00046 { 00047 00048 SP_EXPORT ETriangleCutResults cutTriangle( 00049 const dim::triangle3df &Triangle, const dim::plane3df &ClipPlane, STriangleCut &Cut 00050 ); 00051 00052 SP_EXPORT bool cutTriangle( 00053 const dim::triangle3df &Triangle, const dim::aabbox3df &ClipBox, std::list<dim::triangle3df> &Cut 00054 ); 00055 00056 } // /namespace TriangleCutter 00057 00058 00059 } // /namespace math 00060 00061 } // /namespace sp 00062 00063 00064 #endif 00065 00066 00067 00068 // ================================================================================