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

Geometric operations.
[Library Functions]


Functions

template<typename T> ShGeneric< 3, T > SH::cross (const ShGeneric< 3, T > &left, const ShGeneric< 3, T > &right)
 Take the cross product of two 3-tuples.

template<int N, typename T> ShGeneric< 3, T > SH::operator^ (const ShGeneric< 3, T > &left, const ShGeneric< 3, T > &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 T> ShGeneric< N, T > SH::reflect (const ShGeneric< N, T > &a, const ShGeneric< N, T > &b)
 Compute reflection vector.

template<int N, typename T> ShGeneric< N, T > SH::refract (const ShGeneric< N, T > &a, const ShGeneric< N, T > &b, const ShGeneric< 1, T > &c)
 Compute refraction vector.

template<int N, typename T> ShGeneric< N, T > SH::faceforward (const ShGeneric< N, T > &a, const ShGeneric< N, T > &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 T> ShGeneric< 4, T > SH::lit (const ShGeneric< 1, T > &a, const ShGeneric< 1, T > &b, const ShGeneric< 1, T > &c)
 Compute lighting coefficents.

template<int N, typename T> ShGeneric< 1, T > SH::dot (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 Inner (dot) product.

template<int N, typename T> ShGeneric< 1, T > operator| (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 SH_SHLIB_CONST_N_OP_RETSIZE_BOTH (dot, 1)

Detailed Description

Todo:
distance, sqdistance, length, rlength, rsqlength, sqlength, perp, perpdot, projnorm should be implemented too. Different distance functions also possible: L1, L2, Linf.

Function Documentation

template<typename T>
ShGeneric< 3, T > SH::cross const ShGeneric< 3, T > &  left,
const ShGeneric< 3, T > &  right
[inline]
 

Take the cross product of two 3-tuples.

Note that this operation is not limited to vectors.

Definition at line 38 of file ShLibGeometryImpl.hpp.

Referenced by SH::ShQuaternion< B, T >::operator *=(), and SH::operator^().

template<int N, typename T>
ShGeneric< N, T > SH::faceforward const ShGeneric< N, T > &  a,
const ShGeneric< N, T > &  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 102 of file ShLibGeometryImpl.hpp.

References SH::dot().

template<typename T>
ShGeneric< 4, T > SH::lit const ShGeneric< 1, T > &  a,
const ShGeneric< 1, T > &  b,
const ShGeneric< 1, T > &  c
[inline]
 

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 109 of file ShLibGeometryImpl.hpp.

References SH::pos(), and SH::pow().

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

Normalize an n-tuple to unit length.

Divides an n-tuple by its Euclidean length.

Definition at line 54 of file ShLibGeometryImpl.hpp.

Referenced by SH::ShQuaternion< B, T >::normalize(), SH::reflect(), SH::refract(), SH::rotate(), and SH::ShQuaternion< B, T >::ShQuaternion().

template<int N, typename T>
ShGeneric< N, T > SH::reflect const ShGeneric< N, T > &  a,
const ShGeneric< N, T > &  b
[inline]
 

Compute reflection vector.

Reflect vector a about normal n.

Definition at line 79 of file ShLibGeometryImpl.hpp.

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

template<int N, typename T>
ShGeneric< N, T > SH::refract const ShGeneric< N, T > &  a,
const ShGeneric< N, T > &  b,
const ShGeneric< 1, T > &  c
 

Compute refraction vector.

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

Definition at line 86 of file ShLibGeometryImpl.hpp.

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


Generated on Fri Nov 5 16:51:41 2004 for Sh by doxygen 1.3.7