ShLibGeometry.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2005 Serious Hack Inc.
00004 // 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
00020 #include "ShLib.hpp" // ShLibGeometry needs to be included from within ShLib
00021 
00022 #ifndef SHLIBGEOMETRY_HPP
00023 #define SHLIBGEOMETRY_HPP
00024 
00025 #include "ShGeneric.hpp"
00026 
00027 #ifndef WIN32
00028 namespace SH {
00029 
00040 template<typename T1, typename T2>
00041 ShGeneric<3, CT1T2> 
00042 cross(const ShGeneric<3, T1>& left, const ShGeneric<3, T2>& right);
00043 
00045 template<int N, typename T1, typename T2>
00046 ShGeneric<3, CT1T2> 
00047 operator^(const ShGeneric<3, T1>& left, const ShGeneric<3, T2>& right);
00048 
00052 template<int N, typename T>
00053 ShGeneric<N, T> normalize(const ShGeneric<N, T>& var);
00054 
00058 template<int N, typename T1, typename T2>
00059 ShGeneric<N, CT1T2> 
00060 reflect(const ShGeneric<N, T1>& a, const ShGeneric<N, T2>& b);
00061 
00067 template<int N, typename T1, typename T2, typename T3>
00068 ShGeneric<N, CT1T2T3> 
00069 refract(const ShGeneric<N, T1>& view, const ShGeneric<N, T2>& normal, const ShGeneric<1, T3>& eta);
00070 
00075 template<int N, typename T1, typename T2>
00076 ShGeneric<N, CT1T2> 
00077 faceforward(const ShGeneric<N, T1>& a, const ShGeneric<N, T2>& b);
00078 
00086 template<typename T1, typename T2, typename T3>
00087 ShGeneric<4, CT1T2T3> 
00088 lit(const ShGeneric<1, T1>& a,
00089     const ShGeneric<1, T2>& b,
00090     const ShGeneric<1, T3>& c);
00091 
00094 template<int N1, int N2, typename T1, typename T2>
00095 ShGeneric<1, CT1T2> 
00096 dot(const ShGeneric<N1, T1>& left, const ShGeneric<N2, T2>& right);
00097 
00098 template<int N, typename T1, typename T2>
00099 ShGeneric<1, CT1T2> 
00100 operator|(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00101 
00102 SH_SHLIB_CONST_N_OP_RETSIZE_BOTH_DECL(dot, 1);
00103 
00109 template<int N, typename T>
00110 ShGeneric<1, T> distance(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b);
00111 
00115 template<int N, typename T>
00116 ShGeneric<1, T> distance_1(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b);
00117 
00121 template<int N, typename T>
00122 ShGeneric<1, T> distance_inf(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b);
00123 
00127 template<int N, typename T>
00128 ShGeneric<1, T> length(const ShGeneric<N, T>& a);
00129 
00133 template<int N, typename T>
00134 ShGeneric<1, T> length_1(const ShGeneric<N, T>& a);
00135 
00139 template<int N, typename T>
00140 ShGeneric<1, T> length_inf(const ShGeneric<N, T>& a);
00141 
00142 }
00143 #endif
00144 
00145 #include "ShLibGeometryImpl.hpp"
00146 
00147 #endif

Generated on Wed Nov 9 15:29:33 2005 for Sh by  doxygen 1.4.5