44 #ifndef IE_CORE_VECTOROPS_H
45 #define IE_CORE_VECTOROPS_H
47 #include "IECore/VectorTraits.h"
54 inline void vecSet( T &v,
unsigned int i,
typename VectorTraits<T>::BaseType x );
58 inline void vecSetAll( T &v,
typename VectorTraits<T>::BaseType x );
62 inline typename VectorTraits<T>::BaseType
vecGet(
const T &v,
unsigned int i );
66 inline T
vecAdd(
const T &v1,
const T &v2 );
71 inline void vecAdd(
const T &v1,
const T &v2, T &result );
75 inline T
vecSub(
const T &v1,
const T &v2 );
80 inline void vecSub(
const T &v1,
const T &v2, T &result );
84 inline T
vecMul(
const T& v1,
typename VectorTraits<T>::BaseType v2);
89 inline void vecMul(
const T &v1,
typename VectorTraits<T>::BaseType v2, T &result );
93 inline T
vecMul(
const T &v1,
const T &v2 );
98 inline void vecMul(
const T &v1,
const T &v2, T &result);
102 inline T
vecDiv(
const T &v1,
typename VectorTraits<T>::BaseType v2 );
107 inline void vecDiv(
const T &v1,
typename VectorTraits<T>::BaseType v2, T &result );
111 inline T
vecDiv(
const T &v1,
const T &v2 );
116 inline void vecDiv(
const T &v1,
const T &v2, T &result );
120 inline typename VectorTraits<T>::BaseType
vecDot(
const T &v1,
const T &v2 );
124 inline typename VectorTraits<T>::BaseType
vecLength2(
const T &v );
128 inline typename VectorTraits<T>::BaseType
vecLength(
const T &v );
136 inline typename VectorTraits<T>::BaseType
vecDistance2(
const T &v1,
const T &v2 );
140 inline typename VectorTraits<T>::BaseType
vecDistance(
const T &v1,
const T &v2 );
143 template<
typename T,
typename S>
147 template<
typename T,
typename S>
152 template<
typename T,
typename S>
155 inline S operator()(
const T &v )
const;
165 inline T
vecCross(
const T &v1,
const T &v2 );
169 #include "IECore/VectorOps.inl"
171 #endif // IE_CORE_VECTOROPS_H
VectorTraits< T >::BaseType vecLength(const T &v)
Returns the length of v.
T vecDiv(const T &v1, typename VectorTraits< T >::BaseType v2)
Division by a scalar returning a new vector.
T vecSub(const T &v1, const T &v2)
Subtracts v2 from v1, returning a new vector.
T vecConstruct(const typename VectorTraits< T >::BaseType *components)
S vecConvert(const T &v)
Converts from one vector type to another.
VectorTraits< T >::BaseType vecDot(const T &v1, const T &v2)
Returns the dot product of v1 and v2.
VectorTraits< T >::BaseType vecLength2(const T &v)
Returns the squared length of v.
VectorTraits< T >::BaseType vecGet(const T &v, unsigned int i)
Returns the value of the ith component of v.
Definition: VectorOps.h:153
T::BaseType BaseType
The type of the components of the vector.
Definition: VectorTraits.h:51
void vecNormalize(T &v)
Normalizes v in place. If the length of v is zero then has no effect.
T vecCross(const T &v1, const T &v2)
Returns the cross product of v1 and v2, which must be 3-dimensional vectors.
void vecSet(T &v, unsigned int i, typename VectorTraits< T >::BaseType x)
Sets the ith component of v to the value x.
VectorTraits< T >::BaseType vecDistance2(const T &v1, const T &v2)
Returns the distance squared between v1 and v2.
void vecSetAll(T &v, typename VectorTraits< T >::BaseType x)
Sets all components of v to the value x.
T vecAdd(const T &v1, const T &v2)
Adds v1 to v2 returning a new vector.
T vecMul(const T &v1, typename VectorTraits< T >::BaseType v2)
Perform multiplication of v1 by scalar value v2, returning a new vector.
This namespace contains all components of the core library.
Definition: AddSmoothSkinningInfluencesOp.h:43
VectorTraits< T >::BaseType vecDistance(const T &v1, const T &v2)
Returns the distance between v1 and v2.