OSG::Vector< ValueTypeT, SizeI > Class Template Reference
[Base, Objects, libOSGBase]
#include <OSGVector.h>
Public Types | |
| typedef Point< ValueTypeT, SizeI > | Inherited |
| Parent type. | |
| typedef Vector< ValueTypeT, SizeI > | Self |
| typedef ValueTypeT | ValueType |
| Value type. | |
| typedef TypeTraits< ValueTypeT > ::RealReturnType | RealReturnType |
| Write point to the given stream. | |
| typedef Inherited::PointType | PointType |
| Own type. | |
| typedef Inherited::VectorType | VectorType |
| Type of the corresponding vector of the same size and value type. | |
Public Member Functions | |
Constructors | |
| Vector (void) | |
| Vector (const ValueTypeT *pVals) | |
| Constructor which takes a const value array. | |
| Vector (ValueTypeT *pVals) | |
| Constructor which takes a const value array. | |
| template<class ValueType2T , UInt32 Size2I> | |
| Vector (const Point< ValueType2T, Size2I > &pnt) | |
| template<class ValueType2T , UInt32 Size2I> | |
| Vector (const Vector< ValueType2T, Size2I > &vec) | |
| Vector (const Vector &source) | |
| Vector (const ValueType rVal1) | |
| Vector (const ValueType rVal1, const ValueType rVal2) | |
| Vector (const ValueType rVal1, const ValueType rVal2, const ValueType rVal3) | |
| Vector (const ValueType rVal1, const ValueType rVal2, const ValueType rVal3, const ValueType rVal4) | |
Destructor | |
| ~Vector (void) | |
Common Math | |
| RealReturnType | length (void) const |
| Euclidean length of the vector. | |
| RealReturnType | squareLength (void) const |
| square of the Euclidean length of the vector | |
| void | normalize (void) |
| Changes vector to be of unit length. | |
| Vector | cross (const Vector &vec) const |
| Returns the right handed cross-product for a given vector; This function is implemented for size 3 vectors only. | |
| Vector | operator% (const Vector &vec) const |
| Euclidean length of the vector. | |
| void | crossThis (const Vector &vec) |
| Calculates the right handed cross-product with a given vector; This function is implemented for size 3 vectors only. | |
| ValueType | dot (const Vector &vec) const |
| Return the dot (inner) product for a given vector. | |
| ValueType | operator* (const Vector &vec) const |
| Euclidean length of the vector. | |
| ValueType | dot (const PointType &pnt) const |
| Euclidean length of the vector. | |
| ValueType | operator* (const PointType &pnt) const |
| Euclidean length of the vector. | |
| RealReturnType | enclosedAngle (const Vector &vec) const |
| Returns the angle between this and another vector. | |
| RealReturnType | projectTo (const Vector &toVec) |
| Euclidean length of the vector. | |
Conv | |
| PointType & | addToZero (void) |
| Returns the corrosponding point by adding it to zero. | |
| const PointType & | addToZero (void) const |
| Returns the corrosponding point by adding it to zero. | |
| Vector & | subZero (void) |
| Returns the corrosponding point by adding it to zero. | |
| const Vector & | subZero (void) const |
| Returns the corrosponding point by adding it to zero. | |
Math | |
| Vector | operator- (const Vector &vec) const |
| Component wise binary vector subtraction operator. | |
| Vector | operator+ (const Vector &vec) const |
| Component wise binary vector addition operator. | |
| Vector | operator* (const ValueType val) const |
| Component wise binary scalar multiplication. | |
| Vector | operator- (void) const |
| Nondestructive unary negation, returns new vector. | |
Assignment | |
| Vector & | operator= (const Vector &source) |
Comparison | |
| bool | operator< (const Vector &other) const |
| bool | operator== (const Vector &other) const |
| Equal operator, using Eps as the tolerance. | |
| bool | operator!= (const Vector &other) const |
| Not eual operator, using Eps as the tolerance. | |
Static Public Attributes | |
| static const Vector | Null |
Related Functions | |
(Note that these are not member functions.) | |
Vector Types | |
| typedef OSG::Vector < OSG::UInt8, 1 > | Vec1ub |
| typedef OSG::Vec1ub * | Vec1ubP |
| typedef OSG::Vector< OSG::Int8, 1 > | Vec1b |
| typedef OSG::Vec1b * | Vec1bP |
| typedef OSG::Vector < OSG::UInt16, 1 > | Vec1us |
| typedef OSG::Vec1us * | Vec1usP |
| typedef OSG::Vector < OSG::Int16, 1 > | Vec1s |
| typedef OSG::Vec1s * | Vec1sP |
| typedef OSG::Vector < OSG::Real32, 1 > | Vec1f |
| typedef OSG::Vec1f * | Vec1fP |
| typedef OSG::Vector< Fixed32, 1 > | Vec1fx |
| typedef OSG::Vec1fx * | Vec1fxP |
| typedef OSG::Vector < OSG::Real64, 1 > | Vec1d |
| typedef OSG::Vec1d * | Vec1dP |
| typedef OSG::Vector < OSG::Real128, 1 > | Vec1ld |
| typedef OSG::Vec1ld * | Vec1ldP |
| typedef OSG::Vector < OSG::UInt8, 2 > | Vec2ub |
| typedef OSG::Vec2ub * | Vec2ubP |
| typedef OSG::Vector< OSG::Int8, 2 > | Vec2b |
| typedef OSG::Vec2b * | Vec2bP |
| typedef OSG::Vector < OSG::UInt16, 2 > | Vec2us |
| typedef OSG::Vec2us * | Vec2usP |
| typedef OSG::Vector < OSG::Int16, 2 > | Vec2s |
| typedef OSG::Vec2s * | Vec2sP |
| typedef OSG::Vector < OSG::Int32, 2 > | Vec2i |
| typedef OSG::Vec2i * | Vec2iP |
| typedef OSG::Vector < OSG::UInt32, 2 > | Vec2u |
| typedef OSG::Vec2u * | Vec2uP |
| typedef OSG::Vector < OSG::Real32, 2 > | Vec2f |
| typedef OSG::Vec2f * | Vec2fP |
| typedef OSG::Vector< Fixed32, 2 > | Vec2fx |
| typedef OSG::Vec2f * | Vec2fP |
| typedef OSG::Vector < OSG::Real64, 2 > | Vec2d |
| typedef OSG::Vec2d * | Vec2dP |
| typedef OSG::Vector < OSG::Real128, 2 > | Vec2ld |
| typedef OSG::Vec2ld * | Vec2ldP |
| typedef OSG::Vector < OSG::UInt8, 3 > | Vec3ub |
| typedef OSG::Vec3ub * | Vec3ubP |
| typedef OSG::Vector< OSG::Int8, 3 > | Vec3b |
| typedef OSG::Vec3b * | Vec3bP |
| typedef OSG::Vector < OSG::UInt16, 3 > | Vec3us |
| typedef OSG::Vec3us * | Vec3usP |
| typedef OSG::Vector < OSG::Int16, 3 > | Vec3s |
| typedef OSG::Vec3s * | Vec3sP |
| typedef OSG::Vector < OSG::Real32, 3 > | Vec3f |
| typedef OSG::Vec3f * | Vec3fP |
| typedef OSG::Vector< Fixed32, 3 > | Vec3fx |
| typedef OSG::Vec3fx * | Vec3fxP |
| typedef OSG::Vector < OSG::Real64, 3 > | Vec3d |
| typedef OSG::Vec3d * | Vec3dP |
| typedef OSG::Vector < OSG::Real128, 3 > | Vec3ld |
| typedef OSG::Vec3ld * | Vec3ldP |
| typedef OSG::Vector < OSG::UInt8, 4 > | Vec4ub |
| typedef OSG::Vec4ub * | Vec4ubP |
| typedef OSG::Vector< OSG::Int8, 4 > | Vec4b |
| typedef OSG::Vec4b * | Vec4bP |
| typedef OSG::Vector < OSG::UInt16, 4 > | Vec4us |
| typedef OSG::Vec4us * | Vec4usP |
| typedef OSG::Vector < OSG::Int16, 4 > | Vec4s |
| typedef OSG::Vec4s * | Vec4sP |
| typedef OSG::Vector < OSG::Real32, 4 > | Vec4f |
| typedef OSG::Vec4f * | Vec4fP |
| typedef OSG::Vector< Fixed32, 4 > | Vec4fx |
| typedef OSG::Vec4fx * | Vec4fxP |
| typedef OSG::Vector < OSG::Real64, 4 > | Vec4d |
| typedef OSG::Vec4d * | Vec4dP |
| typedef OSG::Vector < OSG::Real128, 4 > | Vec4ld |
| typedef OSG::Vec4ld * | Vec4ldP |
Vector/Point Profile Types | |
| typedef OSG::Vec2f | Vec2r |
| typedef OSG::Vec3f | Vec3r |
| typedef OSG::Vec4f | Vec4r |
Detailed Description
template<class ValueTypeT, UInt32 SizeI>
class OSG::Vector< ValueTypeT, SizeI >
Vector Interface, for details about how vectors, points and matrices are actually build see .
Definition at line 583 of file OSGVector.h.
Member Typedef Documentation
| OSG::Vector< ValueTypeT, SizeI >::Inherited |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Reimplemented in OSG::Color3< ValueTypeT >, OSG::Color4< ValueTypeT >, and OSG::Color4< OSG::Real32 >.
Definition at line 589 of file OSGVector.h.
| typedef Vector<ValueTypeT, SizeI> OSG::Vector< ValueTypeT, SizeI >::Self |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 590 of file OSGVector.h.
| OSG::Vector< ValueTypeT, SizeI >::ValueType |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Reimplemented in OSG::Color3< ValueTypeT >, OSG::Color4< ValueTypeT >, and OSG::Color4< OSG::Real32 >.
Definition at line 592 of file OSGVector.h.
| OSG::Vector< ValueTypeT, SizeI >::RealReturnType |
Specializations for char-equivalent types, to prevent writing them
Used type if the returnvalue must be a real value.
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 593 of file OSGVector.h.
| typedef Inherited::PointType OSG::Vector< ValueTypeT, SizeI >::PointType |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 595 of file OSGVector.h.
| typedef Inherited::VectorType OSG::Vector< ValueTypeT, SizeI >::VectorType |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 596 of file OSGVector.h.
Constructor & Destructor Documentation
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | void | ) | [inline] |
Definition at line 1261 of file OSGVector.inl.
01261 : 01262 Inherited() 01263 { 01264 for(UInt32 i = 0; i < Self::_uiSize; i++) 01265 { 01266 Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement(); 01267 } 01268 }
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | const ValueTypeT * | pVals | ) | [inline, explicit] |
Be shure the array size at least as large as the vector size.
Definition at line 1278 of file OSGVector.inl.
01278 : 01279 Inherited(pVals) 01280 { 01281 }
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | ValueTypeT * | pVals | ) | [inline, explicit] |
Be shure the array size at least as large as the vector size.
Definition at line 1290 of file OSGVector.inl.
01290 : 01291 Inherited(pVals) 01292 { 01293 }
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | const Point< ValueType2T, Size2I > & | pnt | ) | [inline, explicit] |
Definition at line 1299 of file OSGVector.inl.
01299 : 01300 01301 Inherited(pnt) 01302 { 01303 }
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | const Vector< ValueType2T, Size2I > & | vec | ) | [inline, explicit] |
Definition at line 1309 of file OSGVector.inl.
01309 : 01310 01311 Inherited(vec) 01312 { 01313 }
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | const Vector< ValueTypeT, SizeI > & | source | ) |
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | const ValueType | rVal1 | ) | [inline] |
Definition at line 1326 of file OSGVector.inl.
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | const ValueType | rVal1, | |
| const ValueType | rVal2 | |||
| ) | [inline] |
Definition at line 1340 of file OSGVector.inl.
01341 : 01342 01343 Inherited(rVal1, rVal2) 01344 { 01345 }
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | const ValueType | rVal1, | |
| const ValueType | rVal2, | |||
| const ValueType | rVal3 | |||
| ) | [inline] |
Definition at line 1349 of file OSGVector.inl.
01351 : 01352 01353 Inherited(rVal1, rVal2, rVal3) 01354 { 01355 }
| OSG::Vector< ValueTypeT, SizeI >::Vector | ( | const ValueType | rVal1, | |
| const ValueType | rVal2, | |||
| const ValueType | rVal3, | |||
| const ValueType | rVal4 | |||
| ) | [inline] |
Definition at line 1359 of file OSGVector.inl.
01362 : 01363 01364 Inherited(rVal1, rVal2, rVal3, rVal4) 01365 { 01366 }
| OSG::Vector< ValueTypeT, SizeI >::~Vector | ( | void | ) | [inline] |
Definition at line 1374 of file OSGVector.inl.
Member Function Documentation
| Vector< ValueTypeT, SizeI >::RealReturnType OSG::Vector< ValueTypeT, SizeI >::length | ( | void | ) | const [inline] |
Definition at line 1404 of file OSGVector.inl.
References OSG::osgSqrt(), and OSG::Vector< ValueTypeT, SizeI >::squareLength().
Referenced by OSG::Camera::calcViewRay(), OSG::VarianceShadowMapHandler::createShadowFactorMapFBO(), OSG::VarianceShadowMapHandler::createShadowMapsFBO(), OSG::dist3D_Segment_to_Segment(), OSG::Vector< ValueTypeT, SizeI >::enclosedAngle(), OSG::CylinderVolume::getScalarVolume(), OSG::QuaternionBase< ValueTypeT >::getValueAsAxisDeg(), OSG::Plane::intersect(), OSG::Line::intersect(), OSG::Transform::intersectEnter(), OSG::Billboard::intersectEnter(), OSG::ScreenGroup::intersectEnter(), OSG::InverseTransform::intersectEnter(), OSG::DoubleTransform::intersectEnter(), OSG::DoubleTransform::intersectLeave(), OSG::Transform::intersectLeave(), OSG::ScreenGroup::intersectLeave(), OSG::Billboard::intersectLeave(), OSG::InverseTransform::intersectLeave(), OSG::Vector< ValueTypeT, SizeI >::normalize(), OSG::TrackballEngine::rotate(), OSG::TrackballEngine::set(), OSG::SimpleShadowMapEngine::setupCamera(), OSG::QuaternionBase< ValueTypeT >::setValue(), OSG::setVecLen(), OSG::SimpleSceneManager::showAll(), OSG::Plane::transform(), OSG::CylinderVolume::transform(), OSG::ProjectionCameraDecorator::updateData(), OSG::ShadowStage::updateLights(), and OSG::Trackball::updateRotation().
01405 { 01406 return osgSqrt(Self::squareLength()); 01407 }
| Vector< ValueTypeT, SizeI >::RealReturnType OSG::Vector< ValueTypeT, SizeI >::squareLength | ( | void | ) | const [inline] |
Definition at line 1386 of file OSGVector.inl.
Referenced by OSG::BezierCurve3D::approximate_sub(), OSG::QuadTreeCreator::computeApproximationError(), OSG::QuadTreeCreator::computeBilinearNorm(), OSG::CErrorQuadTree::computeDistToLine(), OSG::DCTPMesh::computeEdgePointDst(), OSG::CErrorQuadTree::ComputeError(), OSG::BSplineTensorSurface::computeNormal(), OSG::BSplineTensorSurface::computeNormalforTrimming(), OSG::BSplineTensorSurface::computeNormalTex(), OSG::CNurbsPatchSurface::ConvertToBezier(), OSG::BSplineTensorSurface::correctDers(), OSG::ParSpaceTrimmer::doIntersect(), OSG::Surface::findClosestPoint(), OSG::Surface::findClosestPointExact(), OSG::Line::getClosestPoints(), OSG::Surface::getDesiredError(), OSG::ParSpaceTrimmer::intersectsLoop(), OSG::Vector< ValueTypeT, SizeI >::length(), and OSG::DCTPMesh::SplitEdge().
01387 { 01388 RealReturnType rTmpVal = RealReturnType(Self::_values[0] * 01389 Self::_values[0] ); 01390 01391 for(UInt32 i = 1; i < Self::_uiSize; i++) 01392 { 01393 rTmpVal += Self::_values[i] * Self::_values[i]; 01394 } 01395 01396 return rTmpVal; 01397 }
| void OSG::Vector< ValueTypeT, SizeI >::normalize | ( | void | ) | [inline] |
Definition at line 1414 of file OSGVector.inl.
References OSG::Eps, OSG::Vector< ValueTypeT, SizeI >::length(), and OSG::osgAbs().
Referenced by OSG::addPoint(), OSG::Surface::buildSurface(), OSG::PerspectiveShadowMapHandler::calcBodyVec(), OSG::Billboard::calcMatrix(), OSG::PerspectiveShadowMapHandler::calcPerspectiveSpot(), OSG::TrapezoidalShadowMapEngine::calcTrapezoidalTransform(), OSG::PerspectiveShadowMapHandler::calcUpVec2(), OSG::QuadTreeTerrain::changed(), OSG::TextVectorGlyph::computeContourOrientations(), OSG::computeEdgeNormal(), OSG::QuadTreeTerrain::createNormalMap(), drawViewerQuads< posTrait, colTrait, texTrait, sizeTrait >::draw(), drawViewerObjects< posTrait, colTrait, sizeTrait, geoTrait >::draw(), drawObjects< posTrait, colTrait, sizeTrait, normalTrait, geoTrait >::draw(), drawViewerObjects< posTrait, colTrait, sizeTrait, geoTrait >::drawIndexed(), drawObjects< posTrait, colTrait, sizeTrait, normalTrait, geoTrait >::drawIndexed(), drawViewerQuads< posTrait, colTrait, texTrait, sizeTrait >::drawIndexed(), OSG::WalkEngine::forward(), OSG::FlyEngine::forward(), OSG::TextVectorGlyph::getNormals(), OSG::NormalQuantifier::getSubIndex(), OSG::Line::intersect(), OSG::Line::Line(), OSG::Plane::Plane(), OSG::PerspectiveShadowMapHandler::pntInFrontOf(), OSG::GeoTypeGraphOp::processNormals(), OSG::MergeGraphOp::processTransformations(), OSG::RAWSceneFileType::read(), OSG::OFLocalVertexPoolRecord::readContinue(), OSG::WalkEngine::right(), OSG::FlyEngine::right(), OSG::FlyEngine::rotate(), OSG::QuaternionBase< ValueTypeT >::setValue(), OSG::Line::setValue(), OSG::NormalQuantifier::subdivide(), OSG::Plane::transform(), OSG::CylinderVolume::transform(), OSG::ShadowStage::updateLights(), and OSG::TileGeometryLoad::updateView().
01415 { 01416 ValueTypeT rLength = ValueTypeT(length()); 01417 01418 if(osgAbs(rLength) < Eps) 01419 { 01420 rLength = TypeTraits<ValueTypeT>::getOneElement(); 01421 } 01422 else 01423 { 01424 rLength = TypeTraits<ValueTypeT>::getOneElement() / rLength; 01425 } 01426 01427 for(UInt32 i = 0; i < Self::_uiSize; i++) 01428 { 01429 Self::_values[i] *= rLength; 01430 } 01431 }
| Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::cross | ( | const Vector< ValueTypeT, SizeI > & | vec | ) | const [inline] |
Definition at line 1444 of file OSGVector.inl.
Referenced by OSG::Billboard::calcMatrix(), OSG::PerspectiveShadowMapHandler::calcUpVec2(), OSG::QuadTreeTerrain::changed(), OSG::Surface::checkOrient(), OSG::CErrorQuadTree::ComputeError(), OSG::BSplineTensorSurface::computeNormal(), OSG::BSplineTensorSurface::computeNormalTex(), OSG::QuadTreeTerrain::createNormalMap(), drawViewerQuads< posTrait, colTrait, texTrait, sizeTrait >::draw(), drawViewerObjects< posTrait, colTrait, sizeTrait, geoTrait >::draw(), drawObjects< posTrait, colTrait, sizeTrait, normalTrait, geoTrait >::draw(), drawViewerObjects< posTrait, colTrait, sizeTrait, geoTrait >::drawIndexed(), drawObjects< posTrait, colTrait, sizeTrait, normalTrait, geoTrait >::drawIndexed(), drawViewerQuads< posTrait, colTrait, texTrait, sizeTrait >::drawIndexed(), OSG::Line::getClosestPoints(), OSG::ProjectionCameraDecorator::getProjectionTranslation(), OSG::FrustumVolume::getScalarVolume(), OSG::Plane::intersect(), OSG::Line::intersect(), OSG::Vector< ValueTypeT, SizeI >::operator%(), OSG::PerspectiveShadowMapHandler::pntInFrontOf(), OSG::NormalQuantifier::rayTriangle(), OSG::QuaternionBase< ValueTypeT >::setValue(), and OSG::ProjectionCameraDecorator::updateData().
01445 { 01446 Vector<ValueTypeT, SizeI> returnValue; 01447 01448 if(Self::_uiSize >= 3) 01449 { 01450 returnValue[0] = 01451 Self::_values[1] * vec._values[2] - 01452 Self::_values[2] * vec._values[1]; 01453 returnValue[1] = 01454 Self::_values[2] * vec._values[0] - 01455 Self::_values[0] * vec._values[2]; 01456 returnValue[2] = 01457 Self::_values[0] * vec._values[1] - 01458 Self::_values[1] * vec._values[0]; 01459 } 01460 else 01461 { 01462 // Must be changed 01463 fprintf(stderr, "cross only implemented for size 3\n"); 01464 } 01465 01466 return returnValue; 01467 }
| Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator% | ( | const Vector< ValueTypeT, SizeI > & | vec | ) | const [inline] |
Definition at line 1472 of file OSGVector.inl.
References OSG::Vector< ValueTypeT, SizeI >::cross().
01473 { 01474 return this->cross(vec); 01475 }
| void OSG::Vector< ValueTypeT, SizeI >::crossThis | ( | const Vector< ValueTypeT, SizeI > & | vec | ) | [inline] |
Definition at line 1483 of file OSGVector.inl.
Referenced by OSG::WalkEngine::forward(), OSG::Plane::Plane(), OSG::RAWSceneFileType::read(), OSG::WalkEngine::right(), OSG::FlyEngine::right(), OSG::FlyEngine::rotate(), OSG::TrackballEngine::rotate(), OSG::CylinderVolume::transform(), and OSG::Trackball::updateRotation().
01484 { 01485 if(Self::_uiSize >= 3) 01486 { 01487 ValueTypeT rTmp[2]; 01488 01489 rTmp[0] = 01490 Self::_values[1] * vec._values[2] - 01491 Self::_values[2] * vec._values[1]; 01492 rTmp[1] = 01493 Self::_values[2] * vec._values[0] - 01494 Self::_values[0] * vec._values[2]; 01495 01496 Self::_values[2] = 01497 Self::_values[0] * vec._values[1] - 01498 Self::_values[1] * vec._values[0]; 01499 01500 Self::_values[0] = rTmp[0]; 01501 Self::_values[1] = rTmp[1]; 01502 } 01503 else 01504 { 01505 // Must be changed 01506 fprintf(stderr, "crossThis only available for size 3\n"); 01507 } 01508 }
| ValueTypeT OSG::Vector< ValueTypeT, SizeI >::dot | ( | const Vector< ValueTypeT, SizeI > & | vec | ) | const [inline] |
Definition at line 1518 of file OSGVector.inl.
Referenced by OSG::TrackballEngine::calcDeltas(), OSG::PerspectiveShadowMapHandler::calcPerspectiveSpot(), OSG::TrapezoidalShadowMapEngine::calcTrapezoidalTransform(), OSG::Surface::checkOrient(), OSG::CErrorQuadTree::computeDistToLine(), OSG::CNurbsPatchSurface::ConvertToBezier(), OSG::dist3D_Segment_to_Segment(), OSG::Plane::distance(), OSG::ParSpaceTrimmer::doIntersect(), OSG::Vector< ValueTypeT, SizeI >::enclosedAngle(), OSG::WalkEngine::forward(), OSG::Line::getClosestPoint(), OSG::Line::getClosestPoints(), OSG::TrackballEngine::getIntersectionPoint(), OSG::FrustumVolume::getScalarVolume(), OSG::Line::intersect(), OSG::Plane::intersectInfinite(), OSG::ParSpaceTrimmer::intersectsLoop(), OSG::Plane::isInHalfSpace(), OSG::isLeft(), OSG::Plane::isOnPlane(), OSG::Vector< ValueTypeT, SizeI >::operator*(), OSG::Plane::Plane(), OSG::PerspectiveShadowMapHandler::pntInFrontOf(), OSG::Vector< ValueTypeT, SizeI >::projectTo(), OSG::NormalQuantifier::rayTriangle(), OSG::WalkEngine::right(), and OSG::QuaternionBase< ValueTypeT >::setValue().
| ValueTypeT OSG::Vector< ValueTypeT, SizeI >::operator* | ( | const Vector< ValueTypeT, SizeI > & | vec | ) | const [inline] |
Definition at line 1532 of file OSGVector.inl.
References OSG::Vector< ValueTypeT, SizeI >::dot().
01533 { 01534 return this->dot(vec); 01535 }
| ValueTypeT OSG::Vector< ValueTypeT, SizeI >::dot | ( | const PointType & | pnt | ) | const [inline] |
Definition at line 1539 of file OSGVector.inl.
| ValueTypeT OSG::Vector< ValueTypeT, SizeI >::operator* | ( | const PointType & | pnt | ) | const [inline] |
Definition at line 1553 of file OSGVector.inl.
References OSG::Vector< ValueTypeT, SizeI >::dot().
01554 { 01555 return this->dot(pnt); 01556 }
| Vector< ValueTypeT, SizeI >::RealReturnType OSG::Vector< ValueTypeT, SizeI >::enclosedAngle | ( | const Vector< ValueTypeT, SizeI > & | vec | ) | const [inline] |
Definition at line 1563 of file OSGVector.inl.
References OSG::Vector< ValueTypeT, SizeI >::dot(), OSG::Eps, OSG::Point< ValueTypeT, SizeI >::isZero(), OSG::Vector< ValueTypeT, SizeI >::length(), OSG::osgACos(), and OSG::Pi.
Referenced by OSG::ShadowStage::updateLights().
01564 { 01565 RealReturnType returnValue; 01566 01567 if(Self::isZero() || vec.isZero()) 01568 { 01569 returnValue = TypeTraits<RealReturnType>::getZeroElement(); 01570 } 01571 else 01572 { 01573 returnValue = dot(vec); 01574 returnValue /= (length() * vec.length()); 01575 01576 if((returnValue - Eps) < -1.) 01577 { 01578 returnValue = Pi; 01579 } 01580 else if((returnValue + Eps) > 1.) 01581 { 01582 returnValue = TypeTraits<RealReturnType>::getZeroElement(); 01583 } 01584 else 01585 { 01586 returnValue = osgACos(returnValue); 01587 } 01588 } 01589 01590 return returnValue; 01591 }
| Vector< ValueTypeT, SizeI >::RealReturnType OSG::Vector< ValueTypeT, SizeI >::projectTo | ( | const Vector< ValueTypeT, SizeI > & | toVec | ) | [inline] |
Definition at line 1596 of file OSGVector.inl.
References OSG::Vector< ValueTypeT, SizeI >::dot(), OSG::Eps, OSG::osgAbs(), and OSG::Point< ValueTypeT, SizeI >::setNull().
Referenced by OSG::Plane::transform().
01597 { 01598 RealReturnType rDot = this ->dot(toVec); 01599 RealReturnType rSquareDot = toVec .dot(toVec); 01600 01601 if(rSquareDot > Eps) 01602 { 01603 rDot /= rSquareDot; 01604 01605 if(osgAbs(rDot) > Eps) 01606 { 01607 *this = toVec; 01608 *this *= ValueTypeT(rDot); 01609 } 01610 else 01611 { 01612 this->setNull(); 01613 rDot = TypeTraits<RealReturnType>::getZeroElement(); 01614 } 01615 } 01616 else 01617 { 01618 rDot = TypeTraits<RealReturnType>::getOneElement(); 01619 } 01620 01621 return rDot; 01622 }
| Vector< ValueTypeT, SizeI >::PointType & OSG::Vector< ValueTypeT, SizeI >::addToZero | ( | void | ) | [inline] |
Definition at line 1639 of file OSGVector.inl.
Referenced by OSG::Manipulator::mouseMove().
01640 { 01641 return *(static_cast<PointType *>(this)); 01642 }
| const Vector< ValueTypeT, SizeI >::PointType & OSG::Vector< ValueTypeT, SizeI >::addToZero | ( | void | ) | const [inline] |
Definition at line 1629 of file OSGVector.inl.
01630 { 01631 return *(static_cast<const PointType *>(this)); 01632 }
| Vector< ValueTypeT, SizeI > & OSG::Vector< ValueTypeT, SizeI >::subZero | ( | void | ) | [inline] |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 1647 of file OSGVector.inl.
| const Vector< ValueTypeT, SizeI > & OSG::Vector< ValueTypeT, SizeI >::subZero | ( | void | ) | const [inline] |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 1655 of file OSGVector.inl.
| Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator- | ( | const Vector< ValueTypeT, SizeI > & | vec | ) | const [inline] |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 1668 of file OSGVector.inl.
| Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator+ | ( | const Vector< ValueTypeT, SizeI > & | vec | ) | const [inline] |
Definition at line 1685 of file OSGVector.inl.
| Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator* | ( | const ValueType | val | ) | const [inline] |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 1703 of file OSGVector.inl.
| Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator- | ( | void | ) | const [inline] |
Definition at line 1720 of file OSGVector.inl.
| Vector< ValueTypeT, SizeI > & OSG::Vector< ValueTypeT, SizeI >::operator= | ( | const Vector< ValueTypeT, SizeI > & | source | ) | [inline] |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 1738 of file OSGVector.inl.
| bool OSG::Vector< ValueTypeT, SizeI >::operator< | ( | const Vector< ValueTypeT, SizeI > & | other | ) | const [inline] |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 1754 of file OSGVector.inl.
01755 { 01756 bool ret = false; 01757 01758 for(UInt32 i = 0; i < Self::_uiSize; i++) 01759 { 01760 if(Self::_values[i] > other._values[i]) 01761 { 01762 break; 01763 } 01764 if(Self::_values[i] < other._values[i]) 01765 { 01766 ret = true; 01767 break; 01768 } 01769 } 01770 01771 return ret; 01772 }
| bool OSG::Vector< ValueTypeT, SizeI >::operator== | ( | const Vector< ValueTypeT, SizeI > & | other | ) | const [inline] |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 1778 of file OSGVector.inl.
References OSG::Eps, and OSG::Point< ValueTypeT, SizeI >::equals().
01779 { 01780 return Self::equals(other, ValueTypeT(Eps)); 01781 }
| bool OSG::Vector< ValueTypeT, SizeI >::operator!= | ( | const Vector< ValueTypeT, SizeI > & | other | ) | const [inline] |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Definition at line 1787 of file OSGVector.inl.
Member Data Documentation
const Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::Null [inline, static] |
Reimplemented from OSG::Point< ValueTypeT, SizeI >.
Reimplemented in OSG::Color3< ValueTypeT >, OSG::Color4< ValueTypeT >, and OSG::Color4< OSG::Real32 >.
Definition at line 599 of file OSGVector.h.
The documentation for this class was generated from the following files:
