NLMISC::CVector2f Class Reference

A 2D vector of float. More...

#include <vector_2f.h>

List of all members.

Public Member Functions

Object.



 CVector2f ()
 Constructor wich do nothing.
 CVector2f (float _x, float _y)
 Constructor.
 CVector2f (const CVector2f &v)
 Copy Constructor.
 CVector2f (const CVector &v)
 Constructor that uses the (x,y) coordinates of a CVector.
 operator CVector () const
CVector asVector () const
Base Maths.



CVector2foperator+= (const CVector2f &v)
CVector2foperator-= (const CVector2f &v)
CVector2foperator*= (float f)
CVector2foperator/= (float f)
CVector2f operator+ (const CVector2f &v) const
CVector2f operator- (const CVector2f &v) const
CVector2f operator* (float f) const
CVector2f operator/ (float f) const
CVector2f operator- () const
Advanced Maths.



float operator* (const CVector2f &v) const
 Dot product.
float norm () const
 Return the norm of the vector.
float sqrnorm () const
 Return the square of the norm of the vector.
void normalize ()
 Normalize the vector.
CVector2f normed () const
 Return the vector normalized.
Misc.



void set (float _x, float _y)
bool operator== (const CVector2f &v) const
bool operator!= (const CVector2f &v) const
bool isNull () const
void minof (const CVector2f &a, const CVector2f &b)
 Set all vector x/y/z as minimum of a/b x/y/z (respectively).
void maxof (const CVector2f &a, const CVector2f &b)
 Set all vector x/y/z as maximum of a/b x/y/z (respectively).
void serial (NLMISC::IStream &f)
 serial.

Public Attributes

float x
float y

Static Public Attributes

Constants



static const CVector2f Null

Friends

CVector2f operator* (float f, const CVector2f &v0)

Detailed Description

A 2D vector of float.

Author:
Lionel Berenguier
Nevrax France
Date:
2001

Definition at line 45 of file vector_2f.h.


Constructor & Destructor Documentation

NLMISC::CVector2f::CVector2f (  )  [inline]

Constructor wich do nothing.

Definition at line 56 of file vector_2f.h.

Referenced by operator*(), operator+(), operator-(), and operator/().

NLMISC::CVector2f::CVector2f ( float  _x,
float  _y 
) [inline]

Constructor.

Definition at line 58 of file vector_2f.h.

NLMISC::CVector2f::CVector2f ( const CVector2f v  )  [inline]

Copy Constructor.

Definition at line 60 of file vector_2f.h.

NLMISC::CVector2f::CVector2f ( const CVector v  )  [inline]

Constructor that uses the (x,y) coordinates of a CVector.

Definition at line 62 of file vector_2f.h.


Member Function Documentation

CVector NLMISC::CVector2f::asVector (  )  const [inline]

Definition at line 66 of file vector_2f.h.

References x, and y.

Referenced by operator CVector().

bool NLMISC::CVector2f::isNull (  )  const [inline]

Definition at line 111 of file vector_2f.h.

References x, and y.

Referenced by NL3D::getRayIntersectionT(), and NLPACS::CEdgeCollide::testCircleMove().

void NLMISC::CVector2f::maxof ( const CVector2f a,
const CVector2f b 
) [inline]

Set all vector x/y/z as maximum of a/b x/y/z (respectively).

Definition at line 119 of file vector_2f.h.

References x, and y.

Referenced by NLMISC::CPolygon2D::getBoundingRect().

void NLMISC::CVector2f::minof ( const CVector2f a,
const CVector2f b 
) [inline]

Set all vector x/y/z as minimum of a/b x/y/z (respectively).

Definition at line 113 of file vector_2f.h.

References min, x, and y.

Referenced by NLMISC::CPolygon2D::getBoundingRect().

float NLMISC::CVector2f::norm (  )  const [inline]

Return the norm of the vector.

Definition at line 87 of file vector_2f.h.

References sqrnorm().

Referenced by NLPACS::COrderedChain::distance(), normalize(), NLPACS::testCirclePoint(), and NLPACS::CEdgeCollide::testEdgeMove().

void NLMISC::CVector2f::normalize (  )  [inline]

Normalize the vector.

Definition at line 91 of file vector_2f.h.

References norm().

Referenced by NLPACS::CEdgeCollide::make(), normed(), and NLPACS::CEdgeCollide::testCircleMove().

CVector2f NLMISC::CVector2f::normed (  )  const [inline]

Return the vector normalized.

Definition at line 98 of file vector_2f.h.

References normalize().

Referenced by NLPACS::CLocalRetriever::snapToInteriorGround().

NLMISC::CVector2f::operator CVector (  )  const [inline]

Definition at line 64 of file vector_2f.h.

References asVector().

bool NLMISC::CVector2f::operator!= ( const CVector2f v  )  const [inline]

Definition at line 110 of file vector_2f.h.

float NLMISC::CVector2f::operator* ( const CVector2f v  )  const [inline]

Dot product.

Definition at line 85 of file vector_2f.h.

References x, and y.

CVector2f NLMISC::CVector2f::operator* ( float  f  )  const [inline]

Definition at line 77 of file vector_2f.h.

References CVector2f(), x, and y.

CVector2f& NLMISC::CVector2f::operator*= ( float  f  )  [inline]

Definition at line 73 of file vector_2f.h.

References x, and y.

CVector2f NLMISC::CVector2f::operator+ ( const CVector2f v  )  const [inline]

Definition at line 75 of file vector_2f.h.

References CVector2f(), x, and y.

CVector2f& NLMISC::CVector2f::operator+= ( const CVector2f v  )  [inline]

Definition at line 71 of file vector_2f.h.

References x, and y.

CVector2f NLMISC::CVector2f::operator- (  )  const [inline]

Definition at line 79 of file vector_2f.h.

References CVector2f(), x, and y.

CVector2f NLMISC::CVector2f::operator- ( const CVector2f v  )  const [inline]

Definition at line 76 of file vector_2f.h.

References CVector2f(), x, and y.

CVector2f& NLMISC::CVector2f::operator-= ( const CVector2f v  )  [inline]

Definition at line 72 of file vector_2f.h.

References x, and y.

CVector2f NLMISC::CVector2f::operator/ ( float  f  )  const [inline]

Definition at line 78 of file vector_2f.h.

References CVector2f(), x, and y.

CVector2f& NLMISC::CVector2f::operator/= ( float  f  )  [inline]

Definition at line 74 of file vector_2f.h.

References x, and y.

bool NLMISC::CVector2f::operator== ( const CVector2f v  )  const [inline]

Definition at line 109 of file vector_2f.h.

References x, and y.

void NLMISC::CVector2f::serial ( NLMISC::IStream f  )  [inline]

serial.

Definition at line 125 of file vector_2f.h.

References NLMISC::IStream::serial(), x, and y.

void NLMISC::CVector2f::set ( float  _x,
float  _y 
) [inline]
float NLMISC::CVector2f::sqrnorm (  )  const [inline]

Return the square of the norm of the vector.

Definition at line 89 of file vector_2f.h.

References x, and y.

Referenced by NL3D::getRayIntersectionT(), NLPACS::CLocalRetriever::insurePosition(), and norm().


Friends And Related Function Documentation

CVector2f operator* ( float  f,
const CVector2f v0 
) [friend]

Member Data Documentation

Definition at line 133 of file vector_2f.h.

Definition at line 50 of file vector_2f.h.

Referenced by asVector(), NL3D::CPatch::bind(), NL3D::CPatchUVLocator::build(), NLMISC::BuildHermiteVector(), NL3D::CPSConstraintMesh::CGlobalTexAnim::buildMatrix(), NL3D::CPatch::computeContinousVertex(), NL3D::CPatch::computeDisplaceCornerSmooth(), NL3D::CPatch::computeDisplaceEdgeSmooth(), NL3D::CPatch::computeDisplaceRawOnNeighbor(), NLMISC::CPolygon2D::computeInnerBorders(), NL3D::CPatch::computeNearBlockLightmap(), NL3D::CPatch::computeNormalCornerSmooth(), NL3D::CPatch::computeNormalEdgeSmooth(), NL3D::CPatch::computeNormalOnNeighbor(), NLMISC::CPolygon2D::computeOuterBorders(), NL3D::CPatch::computeTileLightmapPixelAroundCorner(), NL3D::computeWaterVertexSoft(), NLMISC::CPolygon2D::contains(), NLPACS::COrderedChain::distance(), NL3D::CBloomEffect::doBlur(), NL3D::FillQuadCoords(), NL3D::FillQuadCoordsLocalTime(), NL3D::CWaterModel::fillVBHard(), NL3D::CWaterModel::fillVBSoft(), NL3D::CVegetable::generateGroupEx(), NL3D::CWaterModel::getAttenuatedHeight(), NLMISC::CPolygon2D::getBestTriplet(), NL3D::CWaterHeightMap::getHeight(), NLMISC::CPolygon2D::getLineEquation(), NL3D::CPSQuad::getNeededVB(), NL3D::CZoneLighter::getNormal(), NL3D::CWaterModel::getNumWantedVertices(), NL3D::getRayIntersectionT(), NL3D::CSurfaceLightGrid::getStaticLightSetup(), NLPACS::CLocalRetriever::insurePosition(), NLMISC::CPolygon2D::intersect(), NL3D::CZoneLighter::isLumelOnEdgeMustBeOversample(), isNull(), NL3D::CZoneLighter::lightWater(), NLPACS::CEdgeCollide::make(), maxof(), minof(), NL3D::CPatchUVLocator::CUVBasis::mulPoint(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), NLMISC::operator<(), operator==(), NLPACS::CVector2s::pack(), NL3D::CWaterHeightMap::perturbate(), NL3D::CWaterHeightMap::perturbatePoint(), NLMISC::CMouseSmoother::samplePos(), NLMISC::ScanEdge(), NL3D::CPatchUVLocator::selectPatch(), serial(), set(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CVegetableManager::setupVertexProgramConstants(), NLPACS::CLocalRetriever::snapToInteriorGround(), NLPACS::CRetrieverInstance::snapVector(), sqrnorm(), NLMISC::CGridTraversal::startTraverse(), NLMISC::CPolygon2D::sumDPAgainstLine(), NLPACS::CEdgeCollide::testBBoxCollide(), NLPACS::CEdgeCollide::testBBoxMove(), NLPACS::testCirclePoint(), NLPACS::CGlobalRetriever::testCollisionWithCollisionChains(), NLPACS::CGlobalRetriever::testMovementWithCollisionChains(), NLPACS::CEdgeCollide::testPointMove(), NLMISC::testSegmentIntersection(), NLMISC::CPolygon::toConvexPolygonsEdgeIntersect(), NLMISC::CGridTraversal::traverse(), NL3D::CWaterModel::updateDiffuseMapMatrix(), NL3D::CPSQuad::updateVbColNUVForRender(), and NL3D::uv2st().

Definition at line 50 of file vector_2f.h.

Referenced by asVector(), NL3D::CPatch::bind(), NL3D::CPatchUVLocator::build(), NLMISC::CPolygon2D::buildConvexHull(), NLMISC::BuildHermiteVector(), NL3D::CPSConstraintMesh::CGlobalTexAnim::buildMatrix(), NL3D::CEdge::CEdge(), NL3D::CPatch::computeContinousVertex(), NL3D::CPatch::computeDisplaceCornerSmooth(), NL3D::CPatch::computeDisplaceEdgeSmooth(), NL3D::CPatch::computeDisplaceRawOnNeighbor(), NLMISC::CPolygon2D::computeInnerBorders(), NL3D::CPatch::computeNearBlockLightmap(), NL3D::CPatch::computeNormalCornerSmooth(), NL3D::CPatch::computeNormalEdgeSmooth(), NL3D::CPatch::computeNormalOnNeighbor(), NLMISC::CPolygon2D::computeOuterBorders(), NL3D::CPatch::computeTileLightmapPixelAroundCorner(), NLMISC::CPolygon2D::contains(), NLPACS::COrderedChain::distance(), NL3D::CBloomEffect::doBlur(), NL3D::FillQuadCoords(), NL3D::FillQuadCoordsLocalTime(), NL3D::CWaterModel::fillVBHard(), NL3D::CWaterModel::fillVBSoft(), NL3D::CVegetable::generateGroupEx(), NL3D::CWaterModel::getAttenuatedHeight(), NLMISC::CPolygon2D::getBestTriplet(), NL3D::CWaterHeightMap::getHeight(), NLMISC::CPolygon2D::getLineEquation(), NL3D::CPSQuad::getNeededVB(), NL3D::CZoneLighter::getNormal(), NL3D::CWaterModel::getNumWantedVertices(), NL3D::getRayIntersectionT(), NL3D::CSurfaceLightGrid::getStaticLightSetup(), NLPACS::CLocalRetriever::insurePosition(), NLMISC::CPolygon2D::intersect(), NL3D::CZoneLighter::isLumelOnEdgeMustBeOversample(), isNull(), NL3D::CZoneLighter::lightWater(), NLPACS::CEdgeCollide::make(), maxof(), minof(), NL3D::CPatchUVLocator::CUVBasis::mulPoint(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), NL3D::operator<(), NLMISC::operator<(), operator==(), NLPACS::CVector2s::pack(), NL3D::CWaterHeightMap::perturbate(), NL3D::CWaterHeightMap::perturbatePoint(), NLMISC::CMouseSmoother::samplePos(), NLMISC::ScanEdge(), NL3D::CPatchUVLocator::selectPatch(), serial(), set(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CVegetableManager::setupVertexProgramConstants(), NLPACS::CLocalRetriever::snapToInteriorGround(), NLPACS::CRetrieverInstance::snapVector(), sqrnorm(), NLMISC::CGridTraversal::startTraverse(), NLMISC::CPolygon2D::sumDPAgainstLine(), NLPACS::CEdgeCollide::testBBoxMove(), NLPACS::testCirclePoint(), NLPACS::CGlobalRetriever::testCollisionWithCollisionChains(), NLPACS::CGlobalRetriever::testMovementWithCollisionChains(), NLPACS::CEdgeCollide::testPointMove(), NLMISC::testSegmentIntersection(), NLMISC::CPolygon::toConvexPolygonsEdgeIntersect(), NLMISC::CGridTraversal::traverse(), NL3D::CWaterModel::updateDiffuseMapMatrix(), NL3D::CPSQuad::updateVbColNUVForRender(), and NL3D::uv2st().


The documentation for this class was generated from the following files:

Generated on Thu Jan 7 08:30:19 2010 for NeL by  doxygen 1.6.1