#include <vectord.h>
Nevrax France
Definition at line 44 of file vectord.h.
Public Member Functions | |
Misc. | |
| CVector | asVector () const |
| void | cartesianToSpheric (double &r, double &theta, double &phi) const |
| void | copyTo (CVector &dest) const |
| bool | isNull () const |
| operator CVector () const | |
| bool | operator!= (const CVectorD &v) const |
| CVectorD & | operator= (const CVector &v) |
| bool | operator== (const CVectorD &v) const |
| void | serial (IStream &f) |
| void | set (double _x, double _y, double _z) |
| void | sphericToCartesian (double r, double theta, double phi) |
Object. | |
| CVectorD (const CVectorD &v) | |
| Copy Constructor. | |
| CVectorD (const CVector &v) | |
| Constructor with a CVector. | |
| CVectorD (double _x, double _y, double _z) | |
| Constructor . | |
| CVectorD () | |
| Constructor wich do nothing. | |
Advanced Maths. | |
| double | norm () const |
| Return the norm of the vector. | |
| void | normalize () |
| Normalize the vector. | |
| CVectorD | normed () const |
| Return the vector normalized. | |
| double | operator * (const CVectorD &v) const |
| Dot product. | |
| CVectorD | operator^ (const CVectorD &v) const |
| double | sqrnorm () const |
| Return the square of the norm of the vector. | |
Base Maths. | |
| CVectorD | operator * (double f) const |
| CVectorD & | operator *= (double f) |
| CVectorD | operator+ (const CVectorD &v) const |
| CVectorD & | operator+= (const CVectorD &v) |
| CVectorD | operator- () const |
| CVectorD | operator- (const CVectorD &v) const |
| CVectorD & | operator-= (const CVectorD &v) |
| CVectorD | operator/ (double f) const |
| CVectorD & | operator/= (double f) |
Data Fields | |
| double | x |
| double | y |
| double | z |
Static Public Attributes | |
| const CVectorD | I |
| I vector (1,0,0). | |
| const CVectorD | J |
| J vector (0,1,0). | |
| const CVectorD | K |
| K vector (0,0,1). | |
| const CVectorD | Null |
| Null vector (0,0,0). | |
Friends | |
| CVectorD | operator * (double f, const CVectorD &v0) |
|
|
Constructor wich do nothing.
Definition at line 63 of file vectord.h. Referenced by operator-().
00063 {}
|
|
||||||||||||||||
|
Constructor .
Definition at line 65 of file vectord.h.
|
|
|
Constructor with a CVector.
Definition at line 67 of file vectord.h.
|
|
|
Copy Constructor.
Definition at line 69 of file vectord.h.
|
|
|
Definition at line 191 of file vectord_inline.h.
|
|
||||||||||||||||
|
Get the sphreic coordinates of the vector. See sphericToCartesian() to know coordinates conventions.
Definition at line 152 of file vectord_inline.h. References NLMISC::clamp(), norm(), normed(), r, and v.
|
|
|
Definition at line 187 of file vectord_inline.h. References NLMISC::CVector::set(), x, y, and z.
|
|
|
Definition at line 148 of file vectord_inline.h.
00149 {
00150 return *this==CVectorD::Null;
00151 }
|
|
|
Return the norm of the vector.
Definition at line 115 of file vectord_inline.h. Referenced by cartesianToSpheric(), NL3D::CAnimationOptimizer::nearlySameVector(), normalize(), and NLPACS::CPrimitiveWorldImage::reaction().
|
|
|
Normalize the vector.
Definition at line 119 of file vectord_inline.h. References norm(). Referenced by NLPACS::CPrimitiveWorldImage::evalCollisionOCoverOC(), NLPACS::CPrimitiveWorldImage::evalCollisionPoverOC(), NLPACS::CPrimitiveWorldImage::evalCollisionSoverOC(), normed(), and NLAIAGENT::IVector::unit().
00120 {
00121 double n=norm();
00122 if(n)
00123 *this/=n;
00124 }
|
|
|
Return the vector normalized.
Definition at line 125 of file vectord_inline.h. References normalize(). Referenced by cartesianToSpheric().
00126 {
00127 CVectorD ret;
00128 ret= *this;
00129 ret.normalize();
00130 return ret;
00131 }
|
|
|
Dot product.
Definition at line 97 of file vectord_inline.h.
|
|
|
Definition at line 75 of file vectord_inline.h.
|
|
|
Definition at line 54 of file vectord_inline.h.
|
|
|
Definition at line 179 of file vectord_inline.h.
|
|
|
Definition at line 144 of file vectord_inline.h. References v.
00145 {
00146 return !(*this==v);
00147 }
|
|
|
Definition at line 65 of file vectord_inline.h.
|
|
|
Definition at line 40 of file vectord_inline.h.
|
|
|
Definition at line 84 of file vectord_inline.h. References CVectorD(), x, y, and z.
|
|
|
Definition at line 70 of file vectord_inline.h.
|
|
|
Definition at line 47 of file vectord_inline.h.
|
|
|
Definition at line 80 of file vectord_inline.h.
00081 {
00082 return *this*(1.0f/f);
00083 }
|
|
|
Definition at line 61 of file vectord_inline.h.
00062 {
00063 return *this*= (1.0f/f);
00064 }
|
|
|
Definition at line 172 of file vectord_inline.h.
|
|
|
Definition at line 140 of file vectord_inline.h.
|
|
|
Cross product. compute the cross product *this ^ v. Definition at line 101 of file vectord_inline.h. References v, x, x, y, y, z, and z.
|
|
|
Definition at line 183 of file vectord_inline.h. References NLMISC::IStream::serial(), x, y, and z.
|
|
||||||||||||||||
|
Definition at line 136 of file vectord_inline.h. Referenced by NL3D::CBezierPatch::evalDouble(), NLPACS::CPrimitiveWorldImage::reaction(), and NLPACS::CGlobalRetriever::testCollisionWithCollisionChains().
|
|
||||||||||||||||
|
Setup the vector with spheric coordinates. sphericToCartesian(1,0,0) build the I vector ((1,0,0)). the formula is:
Definition at line 166 of file vectord_inline.h.
|
|
|
Return the square of the norm of the vector.
Definition at line 111 of file vectord_inline.h.
|
|
||||||||||||
|
Definition at line 88 of file vectord_inline.h.
|
|
|
I vector (1,0,0).
|
|
|
J vector (0,1,0).
|
|
|
K vector (0,0,1).
|
|
|
Null vector (0,0,0).
|
|
|
|
1.3.6