| 132 |
|
* @see #vector::dot |
| 133 |
|
*/ |
| 134 |
|
template<typename Real> |
| 135 |
< |
Vector3<Real> cross( const Vector3<Real>& v1, const Vector3<Real>& v2 ) { |
| 135 |
> |
inline Vector3<Real> cross( const Vector3<Real>& v1, const Vector3<Real>& v2 ) { |
| 136 |
|
Vector3<Real> result; |
| 137 |
|
|
| 138 |
|
result.x() = v1.y() * v2.z() - v1.z() * v2.y(); |
| 142 |
|
return result; |
| 143 |
|
} |
| 144 |
|
|
| 145 |
+ |
|
| 146 |
+ |
/** |
| 147 |
+ |
* Returns the linear indexing for integer vectors. Compare to |
| 148 |
+ |
* Rapaport's VLinear |
| 149 |
+ |
* |
| 150 |
+ |
* @param p first vector |
| 151 |
+ |
* @param s second vector |
| 152 |
+ |
*/ |
| 153 |
+ |
template<typename Real> |
| 154 |
+ |
inline Real Vlinear( const Vector3<Real>& p, const Vector3<Real>& s ) { |
| 155 |
+ |
return (p.z() * s.y() + p.y()) * s.x() + p.x(); |
| 156 |
+ |
} |
| 157 |
+ |
|
| 158 |
|
typedef Vector3<int> Vector3i; |
| 159 |
|
|
| 160 |
|
typedef Vector3<RealType> Vector3d; |
| 162 |
|
const Vector3d V3Zero(0.0 , 0.0, 0.0); |
| 163 |
|
const Vector3d V3X( 1.0, 0.0, 0.0 ) ; |
| 164 |
|
const Vector3d V3Y( 0.0, 1.0, 0.0 ) ; |
| 165 |
< |
const Vector3d V3Z ( 0.0, 0.0, 1.0 ) ; |
| 166 |
< |
|
| 165 |
> |
const Vector3d V3Z ( 0.0, 0.0, 1.0 ) ; |
| 166 |
> |
|
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
#endif |