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

Geometric operations.
[Library Functions]

Collaboration diagram for Geometric operations.:


Functions

template<typename T1, typename T2>
ShGeneric< 3, CT1T2 > SH::cross (const ShGeneric< 3, T1 > &left, const ShGeneric< 3, T2 > &right)
 Take the cross product of two 3-tuples.
template<int N, typename T1, typename T2>
ShGeneric< 3, CT1T2 > SH::operator^ (const ShGeneric< 3, T1 > &left, const ShGeneric< 3, T2 > &right)
 Equivalent to cross(left, right).
template<int N, typename T>
ShGeneric< N, T > SH::normalize (const ShGeneric< N, T > &var)
 Normalize an n-tuple to unit length.
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::reflect (const ShGeneric< N, T1 > &a, const ShGeneric< N, T2 > &b)
 Compute reflection vector.
template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2T3 > SH::refract (const ShGeneric< N, T1 > &a, const ShGeneric< N, T2 > &b, const ShGeneric< 1, T3 > &c)
 Compute refraction vector.
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::faceforward (const ShGeneric< N, T1 > &a, const ShGeneric< N, T2 > &b)
 Make a vector face the same way as another Negates b if it does not face the same way as a (i.e.
template<typename T1, typename T2, typename T3>
ShGeneric< 4, CT1T2T3 > SH::lit (const ShGeneric< 1, T1 > &a, const ShGeneric< 1, T2 > &b, const ShGeneric< 1, T3 > &c)
 Compute lighting coefficents.
template<int N, typename T1, typename T2>
ShGeneric< 1, CT1T2 > SH::dot (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 Inner (dot) product.
template<int N, typename T1, typename T2>
ShGeneric< 1, CT1T2 > SH::operator| (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 SH::SH_SHLIB_CONST_N_OP_RETSIZE_BOTH_DECL (dot, 1)

Detailed Description

Todo:
sqdistance, rlength, rsqlength, sqlength, perp, perpdot, projnorm should be implemented too.

Function Documentation

template<typename T1, typename T2>
ShGeneric< 3, CT1T2 > SH::cross const ShGeneric< 3, T1 > &  left,
const ShGeneric< 3, T2 > &  right
 

Take the cross product of two 3-tuples.

Note that this operation is not limited to vectors.

Definition at line 34 of file ShLibGeometryImpl.hpp.

References SH::shXPD().

Referenced by ShUtil::ShObjMesh::generateFaceNormals(), ShUtil::ShObjMesh::generateTangents(), ShUtil::ShObjMesh::generateVertexNormals(), SH::ShQuaternion< B, T >::operator *=(), SH::operator^(), ShUtil::ShKernelLib::shVsh(), and ShUtil::ShKernelLight::texLight2D().

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::faceforward const ShGeneric< N, T1 > &  a,
const ShGeneric< N, T2 > &  b
[inline]
 

Make a vector face the same way as another Negates b if it does not face the same way as a (i.e.

the dot product between a and b is negative).

Definition at line 96 of file ShLibGeometryImpl.hpp.

References SH::dot().

template<typename T1, typename T2, typename T3>
ShGeneric< 4, CT1T2T3 > SH::lit const ShGeneric< 1, T1 > &  a,
const ShGeneric< 1, T2 > &  b,
const ShGeneric< 1, T3 > &  c
 

Compute lighting coefficents.

returns a 4-vector consisting of:

  • 1
  • max(a,0)
  • b^c if (a > 0 and b < 0), 0 otherwise
  • 1

Definition at line 102 of file ShLibGeometryImpl.hpp.

References SH::join().

template<int N, typename T>
ShGeneric< N, T > SH::normalize const ShGeneric< N, T > &  var  ) 
 

Normalize an n-tuple to unit length.

Divides an n-tuple by its Euclidean length.

Definition at line 49 of file ShLibGeometryImpl.hpp.

Referenced by ShUtil::ShKernelSurface::diffuse(), ShUtil::ShObjMesh::generateSphericalTexCoords(), ShUtil::ShObjMesh::generateVertexNormals(), ShUtil::ShKernelSurface::gooch(), SH::ShQuaternion< B, T >::normalize(), SH::normalize(), ShUtil::ShObjMesh::normalizeNormals(), ShUtil::ShKernelSurface::phong(), SH::reflect(), SH::refract(), SH::rotate(), SH::ShQuaternion< B, T >::ShQuaternion(), ShUtil::ShKernelLib::shVsh(), ShUtil::ShKernelSurface::specular(), ShUtil::ShKernelLight::spotLight(), and ShUtil::ShKernelLight::texLight2D().

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::reflect const ShGeneric< N, T1 > &  a,
const ShGeneric< N, T2 > &  b
 

Compute reflection vector.

Reflect vector a about normal n.

Definition at line 73 of file ShLibGeometryImpl.hpp.

References SH::dot(), and SH::normalize().

template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2T3 > SH::refract const ShGeneric< N, T1 > &  a,
const ShGeneric< N, T2 > &  b,
const ShGeneric< 1, T3 > &  c
 

Compute refraction vector.

Refract vector a about normal b using relative index of refraction c.

Definition at line 80 of file ShLibGeometryImpl.hpp.

References SH::clamp(), SH::normalize(), and SH::sqrt().


Generated on Wed Jun 15 18:14:32 2005 for Sh by  doxygen 1.4.3-20050530