#include <vector.h>
Inheritance diagram for NLMISC::CVector:
Nevrax France
Definition at line 48 of file vector.h.
Public Member Functions | |
std::string | asString () const |
std::string | toString () const |
Returns the contents as a printable string "x y z". | |
Object. | |
CVector (const CVector &v) | |
Copy Constructor. | |
CVector (float _x, float _y, float _z) | |
Constructor . | |
CVector () | |
Constructor wich do nothing. | |
Data Fields | |
float | x |
float | y |
float | z |
Static Public Attributes | |
const CVector | I |
I vector (1,0,0). | |
const CVector | J |
J vector (0,1,0). | |
const CVector | K |
K vector (0,0,1). | |
const CVector | Null |
Null vector (0,0,0). | |
Friends | |
CVector | operator * (float f, const CVector &v0) |
|
Constructor wich do nothing.
Definition at line 67 of file vector.h. Referenced by operator-().
00067 {} |
|
Constructor .
Definition at line 69 of file vector.h.
|
|
Copy Constructor.
Definition at line 71 of file vector.h.
|
|
Returns the contents as a printable string "x y z" undeprecated, use the generic function toString() Definition at line 139 of file vector.h. References toString().
00139 { return toString(); } |
|
Get the sphreic coordinates of the vector. See sphericToCartesian() to know coordinates conventions.
Definition at line 161 of file vector_inline.h. References NLMISC::clamp(), norm(), normed(), r, and v.
|
|
Get the sphreic coordinates of the vector. See sphericToCartesian() to know coordinates conventions.
Definition at line 148 of file vector_inline.h. Referenced by NLMISC::CMatrix::normalize(), NLSOUND::CSimpleSource::setDirection(), NLPACS::CGlobalRetriever::testBBoxMove(), and NLPACS::CGlobalRetriever::testCylinderMove().
00149 { 00150 return *this==CVector::Null; 00151 } |
|
Set all vector x/y/z as maximum of a/b x/y/z (respectively).
Definition at line 192 of file vector_inline.h. References x, x, y, y, z, and z. Referenced by NL3D::CLodCharacterShape::addAnim(), NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::build(), NLPACS::CEdgeQuad::build(), NLPACS::CChainQuad::build(), NL3D::CPatch::buildBBoxFromBezierPatch(), NLMISC::CAABBox::computeAABBoxUnion(), NL3D::CPSLocated::computeBBox(), NLMISC::CAABBox::computeIntersection(), NL3D::CSkeletonModel::computeWorldBBoxForShadow(), NLMISC::CAABBox::extend(), and NL3D::CZoneLighter::light().
|
|
Set all vector x/y/z as minimum of a/b x/y/z (respectively).
Definition at line 186 of file vector_inline.h. References min, x, x, y, y, z, and z. Referenced by NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::build(), NLPACS::CEdgeQuad::build(), NLPACS::CChainQuad::build(), NL3D::CPatch::buildBBoxFromBezierPatch(), NLMISC::CAABBox::computeIntersection(), NL3D::CSkeletonModel::computeWorldBBoxForShadow(), NLMISC::CAABBox::extend(), NL3D::CZoneLighter::light(), NLPACS::CQuadGrid< uint32 >::selectQuads(), and NL3D::CQuadGrid< CWaterShape * >::selectQuads().
|
|
|
|
Return the vector normalized.
Definition at line 125 of file vector_inline.h. References normalize(). Referenced by NL3D::CCameraCol::build(), NL3D::BuildCubeMapTex(), NL3D::BuildCubeMapTexLuminance(), NL3D::CShadowMap::buildProjectionInfos(), cartesianToSpheric(), NL3D::CPSFaceLookAtHelper::computeOrientationVectors(), NL3D::CVegetableManager::CVegetableManager(), NL3D::CBezierPatch::evalTangentS(), NL3D::CBezierPatch::evalTangentT(), NL3D::CTargetAnimCtrl::execute(), NLMISC::CQuatT< float >::getAxis(), NLSOUND::CClusteredSound::interpolateSourceDirection(), NLMISC::CPlane::make(), NL3D::CVegetableManager::render(), and NLSOUND::CClusteredSound::soundTraverse().
00126 { 00127 CVector ret; 00128 ret= *this; 00129 ret.normalize(); 00130 return ret; 00131 } |
|
Dot product.
Definition at line 97 of file vector_inline.h.
|
|
Definition at line 75 of file vector_inline.h.
|
|
Definition at line 54 of file vector_inline.h.
|
|
Get the sphreic coordinates of the vector. See sphericToCartesian() to know coordinates conventions.
Definition at line 144 of file vector_inline.h. References v.
00145 { 00146 return !(*this==v); 00147 } |
|
Definition at line 65 of file vector_inline.h.
|
|
Definition at line 40 of file vector_inline.h.
|
|
Definition at line 84 of file vector_inline.h. References CVector(), x, y, and z.
|
|
Definition at line 70 of file vector_inline.h.
|
|
Definition at line 47 of file vector_inline.h.
|
|
Definition at line 80 of file vector_inline.h.
00081 { 00082 return *this*(1.0f/f); 00083 } |
|
Definition at line 61 of file vector_inline.h.
00062 { 00063 return *this*= (1.0f/f); 00064 } |
|
This operator is here just for map/set insertion (no meaning). comparison order is x,y,z.
Definition at line 152 of file vector_inline.h.
|
|
Get the sphreic coordinates of the vector. See sphericToCartesian() to know coordinates conventions.
Definition at line 140 of file vector_inline.h.
|
|
Cross product. compute the cross product *this ^ v. Definition at line 101 of file vector_inline.h. References v, x, x, y, y, z, and z.
|
|
serial.
Definition at line 198 of file vector_inline.h. References NLMISC::IStream::serial(), x, y, and z.
|
|
|
Setup the vector with spheric coordinates. sphericToCartesian(1,0,0) build the I vector ((1,0,0)). the formula is:
Definition at line 175 of file vector_inline.h.
|
|
Return the square of the norm of the vector.
Definition at line 111 of file vector_inline.h. Referenced by NLMISC::CBSphere::applyTransform(), NL3D::CTessFace::computeSplitPoint(), NLSOUND::CClusteredSound::getPolyNearestPos(), NLMISC::CBSphere::include(), NL3D::CCameraCol::minimizeDistanceAgainstTri(), NLMISC::CLine::project(), NL3D::CTessFace::updateErrorMetric(), NL3D::CTessFace::updateRefineSplit(), and NLSOUND::CSourceDSound::updateVolume().
|
|
Returns the contents as a printable string "x y z".
Definition at line 45 of file vector.cpp. References NLMISC::toString(), x, y, and z. Referenced by asString().
00046 { 00047 string str; 00048 str = NLMISC::toString(x) + " " + NLMISC::toString(y) + " " + NLMISC::toString(z); 00049 return str; 00050 } |
|
Definition at line 88 of file vector_inline.h.
|
|
I vector (1,0,0).
|
|
J vector (0,1,0).
|
|
K vector (0,0,1).
|
|
Null vector (0,0,0).
|
|
|
|