VR-Link API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
Dt3dPoint Class Reference

Dt3dPoint represents points in 3-space. More...

+ Collaboration diagram for Dt3dPoint:

Public Member Functions

 Dt3dPoint ()
 Default Constructor, initializes all values to zero. More...
 
 Dt3dPoint (const double &x, const double &y, const double &z)
 Initializing constructor. More...
 
 Dt3dPoint (const Dt3dPoint &orig)
 Copy Constructor. More...
 
 ~Dt3dPoint ()
 Destructor. More...
 
Dt3dPointoperator= (const Dt3dPoint &rhs)
 
bool operator== (const Dt3dPoint &rhs) const
 
bool operator!= (const Dt3dPoint &rhs) const
 
Dt3dPoint operator+ (const DtVector &rhs) const
 
Dt3dPointoperator+= (const DtVector &rhs)
 
DtVector operator- (const Dt3dPoint &rhs) const
 
Dt3dPoint operator- (const DtVector &rhs) const
 
Dt3dPointoperator-= (const DtVector &rhs)
 
Dt3dPoint differenceAs3dPoint (const Dt3dPoint &rhs) const
 Added to ease transitions from previous type unsafe implementations. More...
 
DtVector difference (const Dt3dPoint &rhs) const
 Same as operator-( Dt3dPoint ). Provided for backwards compatibility. More...
 
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. More...
 
const doublex () const
 return the x component. More...
 
const doubley () const
 return the y component. More...
 
const doublez () const
 return the z component. More...
 
void set (const double &x, const double &y, const double &z)
 
void setX (const double &x)
 Set the X component. More...
 
void setY (const double &y)
 Set the Y component. More...
 
void setZ (const double &z)
 Set the Z component. More...
 
void setFromVector (const DtVector &vector)
 
void setFrom4dPoint (const Dt4dPoint &point)
 Drops last (w) component. More...
 
double distanceTo (const Dt3dPoint &end) const
 Distance from this point to end point. More...
 
double distanceSquaredTo (const Dt3dPoint &end) const
 Distance squared from this point to end point. More...
 
double xyDistanceTo (const Dt3dPoint &end) const
 Distance from this point to end point. Ignores Z values. More...
 
double xyDistanceSquaredTo (const Dt3dPoint &end) const
 Distance squared from this point to end point. Ignores Z values. More...
 
double xyDistanceToLine (const Dt3dPoint &pointA, const Dt3dPoint &pointB) const
 Distance from this point to line defined by points A and B. Ignores Z. More...
 
double xyDistanceToLineSquared (const Dt3dPoint &pointA, const Dt3dPoint &pointB) const
 Distance squared from this point to line defined by points A and B. More...
 
double magnitudeSquared () const
 Distance from this point to the origin (0,0,0) point. More...
 
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. More...
 
 Dt3dPoint (const DtVector &orig)
 
Dt3dPointoperator= (const DtVector &rhs)
 
Dt3dPoint operator+ (const Dt3dPoint &rhs) const
 
Dt3dPointoperator+= (const Dt3dPoint &rhs)
 
Dt3dPointoperator-= (const Dt3dPoint &rhs)
 
const doubleoperator[] (const int index) const
 
doubleoperator[] (const int index)
 
Dt3dPoint operator* (const double &rhs) const
 Multiplication operator is implemented as dot product. More...
 
Dt3dPointoperator*= (const double &rhs)
 Multiplication operator is implemented as dot product. More...
 
Dt3dPoint operator/ (const double &rhs) const
 Division of each component of one point by the corresponding component of the rhs. More...
 
Dt3dPointoperator/= (const double &rhs)
 Division of each component of one point by the corresponding component of the rhs. More...
 

Protected Attributes

double myX
 
double myY
 
double myZ
 

Detailed Description

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.

Constructor & Destructor Documentation

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)
Deprecated:
This method is provided for backwards compatibility. We recommend explicit conversions such as setFromVector(..)

Member Function Documentation

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.

Dt3dPoint Dt3dPoint::operator+ ( const DtVector rhs) const
inline
Dt3dPoint Dt3dPoint::operator+ ( const Dt3dPoint rhs) const
Deprecated:
This method is provided for backwards compatibility. Should Add vectors to points to get new points.
Dt3dPoint& Dt3dPoint::operator+= ( const DtVector rhs)
inline
Dt3dPoint& Dt3dPoint::operator+= ( const Dt3dPoint rhs)
Deprecated:
This method is provided for backwards compatibility. Should Add vectors to points to get new points.
DtVector Dt3dPoint::operator- ( const Dt3dPoint rhs) const
inline
Dt3dPoint Dt3dPoint::operator- ( const DtVector rhs) const
inline
Dt3dPoint& Dt3dPoint::operator-= ( const DtVector rhs)
inline
Dt3dPoint& Dt3dPoint::operator-= ( const Dt3dPoint rhs)
Deprecated:
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.

Dt3dPoint& Dt3dPoint::operator= ( const Dt3dPoint rhs)
Dt3dPoint& Dt3dPoint::operator= ( const DtVector rhs)
Deprecated:
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
Exceptions
DtExceptionfor invalid index
double& Dt3dPoint::operator[] ( const int  index)
Exceptions
DtExceptionfor 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.

Member Data Documentation

double Dt3dPoint::myX
protected
double Dt3dPoint::myY
protected
double Dt3dPoint::myZ
protected

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

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)