Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ShLibGeometry.hpp

00001 // Sh: A GPU metaprogramming language. 00002 // 00003 // Copyright (c) 2003 University of Waterloo Computer Graphics Laboratory 00004 // Project administrator: Michael D. McCool 00005 // Authors: Zheng Qin, Stefanus Du Toit, Kevin Moule, Tiberiu S. Popa, 00006 // Michael D. McCool 00007 // 00008 // This software is provided 'as-is', without any express or implied 00009 // warranty. In no event will the authors be held liable for any damages 00010 // arising from the use of this software. 00011 // 00012 // Permission is granted to anyone to use this software for any purpose, 00013 // including commercial applications, and to alter it and redistribute it 00014 // freely, subject to the following restrictions: 00015 // 00016 // 1. The origin of this software must not be misrepresented; you must 00017 // not claim that you wrote the original software. If you use this 00018 // software in a product, an acknowledgment in the product documentation 00019 // would be appreciated but is not required. 00020 // 00021 // 2. Altered source versions must be plainly marked as such, and must 00022 // not be misrepresented as being the original software. 00023 // 00024 // 3. This notice may not be removed or altered from any source 00025 // distribution. 00027 #ifndef SHLIBGEOMETRY_HPP 00028 #define SHLIBGEOMETRY_HPP 00029 00030 #include "ShGeneric.hpp" 00031 #include "ShLib.hpp" 00032 00033 namespace SH { 00034 00046 template<typename T> 00047 ShGeneric<3, T> cross(const ShGeneric<3, T>& left, const ShGeneric<3, T>& right); 00048 00050 template<int N, typename T> 00051 ShGeneric<3, T> operator^(const ShGeneric<3, T>& left, const ShGeneric<3, T>& right); 00052 00056 template<int N, typename T> 00057 ShGeneric<N, T> normalize(const ShGeneric<N, T>& var); 00058 00062 template<int N, typename T> 00063 ShGeneric<N, T> reflect(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b); 00064 00068 template<int N, typename T> 00069 ShGeneric<N, T> refract(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b, 00070 const ShGeneric<1, T>& c); 00071 00076 template<int N, typename T> 00077 ShGeneric<N, T> faceforward(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b); 00078 00086 template<typename T> 00087 ShGeneric<4, T> lit(const ShGeneric<1, T>& a, 00088 const ShGeneric<1, T>& b, 00089 const ShGeneric<1, T>& c); 00090 00093 template<int N, typename T> 00094 ShGeneric<1, T> dot(const ShGeneric<N, T>& left, const ShGeneric<N, T>& right); 00095 00096 template<int N, typename T> 00097 ShGeneric<1, T> operator|(const ShGeneric<N, T>& left, const ShGeneric<N, T>& right); 00098 00099 SH_SHLIB_CONST_N_OP_RETSIZE_BOTH(dot, 1); 00100 00106 template<int N, typename T> 00107 ShGeneric<1, T> distance(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b); 00108 00112 template<int N, typename T> 00113 ShGeneric<1, T> distance_1(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b); 00114 00118 template<int N, typename T> 00119 ShGeneric<1, T> distance_inf(const ShGeneric<N, T>& a, const ShGeneric<N, T>& b); 00120 00124 template<int N, typename T> 00125 ShGeneric<1, T> length(const ShGeneric<N, T>& a); 00126 00127 } 00128 00129 #include "ShLibGeometryImpl.hpp" 00130 00131 #endif

Generated on Mon Oct 18 14:17:39 2004 for Sh by doxygen 1.3.7