![]() |
VR-Link API Documentation for HLA Evolved
|
Dt3dPoint represents points in 3-space. More...
Collaboration diagram for Dt3dPoint:Public Member Functions | |
| Dt3dPoint () | |
| Default Constructor, initializes all values to zero. | |
| Dt3dPoint (const double &x, const double &y, const double &z) | |
| Initializing constructor. | |
| Dt3dPoint (const Dt3dPoint &orig) | |
| Copy Constructor. | |
| ~Dt3dPoint () | |
| Destructor. | |
| Dt3dPoint & | operator= (const Dt3dPoint &rhs) |
| bool | operator== (const Dt3dPoint &rhs) const |
| bool | operator!= (const Dt3dPoint &rhs) const |
| Dt3dPoint | operator+ (const DtVector &rhs) const |
| Dt3dPoint & | operator+= (const DtVector &rhs) |
| DtVector | operator- (const Dt3dPoint &rhs) const |
| Dt3dPoint | operator- (const DtVector &rhs) const |
| Dt3dPoint & | operator-= (const DtVector &rhs) |
| Dt3dPoint | differenceAs3dPoint (const Dt3dPoint &rhs) const |
| Added to ease transitions from previous type unsafe implementations. | |
| DtVector | difference (const Dt3dPoint &rhs) const |
| Same as operator-( Dt3dPoint ). Provided for backwards compatibility. | |
| bool | approxEq (const Dt3dPoint &p, const double &tolerance) const |
| compares two points and returns true if the distance between them is within the tolerance value. | |
| const double & | x () const |
| return the x component. | |
| const double & | y () const |
| return the y component. | |
| const double & | z () const |
| return the z component. | |
| void | set (const double &x, const double &y, const double &z) |
| void | setX (const double &x) |
| Set the X component. | |
| void | setY (const double &y) |
| Set the Y component. | |
| void | setZ (const double &z) |
| Set the Z component. | |
| void | setFromVector (const DtVector &vector) |
| void | setFrom4dPoint (const Dt4dPoint &point) |
| Drops last (w) component. | |
| double | distanceTo (const Dt3dPoint &end) const |
| Distance from this point to end point. | |
| double | distanceSquaredTo (const Dt3dPoint &end) const |
| Distance squared from this point to end point. | |
| double | xyDistanceTo (const Dt3dPoint &end) const |
| Distance from this point to end point. Ignores Z values. | |
| double | xyDistanceSquaredTo (const Dt3dPoint &end) const |
| Distance squared from this point to end point. Ignores Z values. | |
| double | xyDistanceToLine (const Dt3dPoint &pointA, const Dt3dPoint &pointB) const |
| Distance from this point to line defined by points A and B. Ignores Z. | |
| double | xyDistanceToLineSquared (const Dt3dPoint &pointA, const Dt3dPoint &pointB) const |
| Distance squared from this point to line defined by points A and B. | |
| double | magnitudeSquared () const |
| Distance from this point to the origin (0,0,0) point. | |
| void | normalize () |
| Assuming that this point is the end point of a vector starting at (0,0,0), this function normalizes that vector and sets this point to the normalized end point. | |
| Dt3dPoint (const DtVector &orig) | |
| This method is provided for backwards compatibility. | |
| Dt3dPoint & | operator= (const DtVector &rhs) |
| This method is provided for backwards compatibility. | |
| Dt3dPoint | operator+ (const Dt3dPoint &rhs) const |
| This method is provided for backwards compatibility. | |
| Dt3dPoint & | operator+= (const Dt3dPoint &rhs) |
| This method is provided for backwards compatibility. | |
| Dt3dPoint & | operator-= (const Dt3dPoint &rhs) |
| This method is provided for backwards compatibility. | |
| const double & | operator[] (const int index) const |
| double & | operator[] (const int index) |
| Dt3dPoint | operator* (const double &rhs) const |
| Multiplication operator is implemented as dot product. | |
| Dt3dPoint & | operator*= (const double &rhs) |
| Multiplication operator is implemented as dot product. | |
| Dt3dPoint | operator/ (const double &rhs) const |
| Division of each component of one point by the corresponding component of the rhs. | |
| Dt3dPoint & | operator/= (const double &rhs) |
| Division of each component of one point by the corresponding component of the rhs. | |
Protected Attributes | |
| double | myX |
| double | myY |
| double | myZ |
Dt3dPoint represents points in 3-space.
This class has no virtual functions, in order to minimize its run-time size. (A terrain database can have millions of Dt3dPoints, so the vtable ptr can matter). i.e. Subclasses should not have any member data.
Several functions are provided to support backwards compatibility. Unfortunately, they do so at the expense of type safety. To disable these functions set the compile flag POINT_VERTEX_TYPESAFETY to 1.
| Dt3dPoint::Dt3dPoint | ( | ) | [inline] |
Default Constructor, initializes all values to zero.
| Dt3dPoint::Dt3dPoint | ( | const double & | x, |
| const double & | y, | ||
| const double & | z | ||
| ) | [inline] |
Initializing constructor.
| Dt3dPoint::Dt3dPoint | ( | const Dt3dPoint & | orig | ) | [inline] |
Copy Constructor.
| Dt3dPoint::~Dt3dPoint | ( | ) | [inline] |
Destructor.
| Dt3dPoint::Dt3dPoint | ( | const DtVector & | orig | ) |
This method is provided for backwards compatibility.
We recommend explicit conversions such as setFromVector(..)
| bool Dt3dPoint::approxEq | ( | const Dt3dPoint & | p, |
| const double & | tolerance | ||
| ) | const |
compares two points and returns true if the distance between them is within the tolerance value.
| DtVector Dt3dPoint::difference | ( | const Dt3dPoint & | rhs | ) | const |
Same as operator-( Dt3dPoint ). Provided for backwards compatibility.
| Dt3dPoint Dt3dPoint::differenceAs3dPoint | ( | const Dt3dPoint & | rhs | ) | const |
Added to ease transitions from previous type unsafe implementations.
| double Dt3dPoint::distanceSquaredTo | ( | const Dt3dPoint & | end | ) | const |
Distance squared from this point to end point.
| double Dt3dPoint::distanceTo | ( | const Dt3dPoint & | end | ) | const |
Distance from this point to end point.
| double Dt3dPoint::magnitudeSquared | ( | ) | const |
Distance from this point to the origin (0,0,0) point.
| void Dt3dPoint::normalize | ( | ) |
Assuming that this point is the end point of a vector starting at (0,0,0), this function normalizes that vector and sets this point to the normalized end point.
| bool Dt3dPoint::operator!= | ( | const Dt3dPoint & | rhs | ) | const [inline] |
| Dt3dPoint Dt3dPoint::operator* | ( | const double & | rhs | ) | const [inline] |
Multiplication operator is implemented as dot product.
| Dt3dPoint& Dt3dPoint::operator*= | ( | const double & | rhs | ) | [inline] |
Multiplication operator is implemented as dot product.
This method is provided for backwards compatibility.
Should Add vectors to points to get new points.
This method is provided for backwards compatibility.
Should Add vectors to points to get new points.
This method is provided for backwards compatibility.
The difference between points should be a vector.
| Dt3dPoint Dt3dPoint::operator/ | ( | const double & | rhs | ) | const [inline] |
Division of each component of one point by the corresponding component of the rhs.
WARNING: does not check for divide by zero.
| Dt3dPoint& Dt3dPoint::operator/= | ( | const double & | rhs | ) | [inline] |
Division of each component of one point by the corresponding component of the rhs.
WARNING: does not check for divide by zero.
This method is provided for backwards compatibility.
We recommend explicit conversions such as setFromVector(..)
| bool Dt3dPoint::operator== | ( | const Dt3dPoint & | rhs | ) | const [inline] |
| const double& Dt3dPoint::operator[] | ( | const int | index | ) | const |
| DtException | for invalid index |
| double& Dt3dPoint::operator[] | ( | const int | index | ) |
| DtException | for invalid index |
| void Dt3dPoint::set | ( | const double & | x, |
| const double & | y, | ||
| const double & | z | ||
| ) | [inline] |
| void Dt3dPoint::setFrom4dPoint | ( | const Dt4dPoint & | point | ) | [inline] |
Drops last (w) component.
| void Dt3dPoint::setFromVector | ( | const DtVector & | vector | ) | [inline] |
| void Dt3dPoint::setX | ( | const double & | x | ) | [inline] |
Set the X component.
| void Dt3dPoint::setY | ( | const double & | y | ) | [inline] |
Set the Y component.
| void Dt3dPoint::setZ | ( | const double & | z | ) | [inline] |
Set the Z component.
| const double& Dt3dPoint::x | ( | ) | const [inline] |
return the x component.
| double Dt3dPoint::xyDistanceSquaredTo | ( | const Dt3dPoint & | end | ) | const |
Distance squared from this point to end point. Ignores Z values.
| double Dt3dPoint::xyDistanceTo | ( | const Dt3dPoint & | end | ) | const |
Distance from this point to end point. Ignores Z values.
| double Dt3dPoint::xyDistanceToLine | ( | const Dt3dPoint & | pointA, |
| const Dt3dPoint & | pointB | ||
| ) | const |
Distance from this point to line defined by points A and B. Ignores Z.
| double Dt3dPoint::xyDistanceToLineSquared | ( | const Dt3dPoint & | pointA, |
| const Dt3dPoint & | pointB | ||
| ) | const |
Distance squared from this point to line defined by points A and B.
Ignores Z.
| const double& Dt3dPoint::y | ( | ) | const [inline] |
return the y component.
| const double& Dt3dPoint::z | ( | ) | const [inline] |
return the z component.
double Dt3dPoint::myX [protected] |
double Dt3dPoint::myY [protected] |
double Dt3dPoint::myZ [protected] |