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) |
| Dt3dPoint & | operator= (const DtVector &rhs) |
| Dt3dPoint | operator+ (const Dt3dPoint &rhs) const |
| Dt3dPoint & | operator+= (const Dt3dPoint &rhs) |
| Dt3dPoint & | operator-= (const Dt3dPoint &rhs) |
|
| 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.
|
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.