Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DPoint3n Class Reference

The U4DPoint3n implements a 3D point representation in space. More...

Public Member Functions

 U4DPoint3n ()
 Contructor which creates a default 3D point. That is, its componets are initialized to zero.
 
 U4DPoint3n (float nx, float ny, float nz)
 Contructor which creates a default 3D point with the given x, y and z component values. More...
 
 ~U4DPoint3n ()
 Destructor for the class.
 
 U4DPoint3n (const U4DPoint3n &a)
 Copy constructor for the class. More...
 
U4DPoint3noperator= (const U4DPoint3n &a)
 Copy constructor for the class. More...
 
bool operator== (const U4DPoint3n &a)
 Method which compares if two 3D points are equal. More...
 
bool operator!= (const U4DPoint3n &a)
 
void operator+= (const U4DPoint3n &v)
 
U4DPoint3n operator+ (const U4DPoint3n &v) const
 
U4DVector3n operator- (const U4DPoint3n &p) const
 
U4DPoint3n operator* (const float s) const
 
float distanceBetweenPoints (U4DPoint3n &v)
 
float distanceSquareBetweenPoints (U4DPoint3n &v)
 
void convertVectorToPoint (U4DVector3n &v)
 
float magnitude ()
 
float magnitudeSquare ()
 
void zero ()
 
U4DVector3n toVector () const
 
void show ()
 

Public Attributes

float x
 x-component
 
float y
 y-component
 
float z
 z-component
 

Detailed Description

The U4DPoint3n implements a 3D point representation in space.

Constructor & Destructor Documentation

◆ U4DPoint3n() [1/2]

U4DEngine::U4DPoint3n::U4DPoint3n ( float  nx,
float  ny,
float  nz 
)

Contructor which creates a default 3D point with the given x, y and z component values.

Parameters
nxx-component
nyy-component
nzz-component

◆ U4DPoint3n() [2/2]

U4DEngine::U4DPoint3n::U4DPoint3n ( const U4DPoint3n a)

Copy constructor for the class.

Parameters
a3D point to copy to

Member Function Documentation

◆ distanceBetweenPoints()

float U4DEngine::U4DPoint3n::distanceBetweenPoints ( U4DPoint3n v)

Distance between points

Parameters
apoint A
bpoint B
Returns
Distance between points

◆ operator+()

U4DPoint3n U4DEngine::U4DPoint3n::operator+ ( const U4DPoint3n v) const

Add points

Parameters
vpoint
Returns
point addition

◆ operator+=()

void U4DEngine::U4DPoint3n::operator+= ( const U4DPoint3n v)

Add points

Parameters
vpoint

◆ operator-()

U4DVector3n U4DEngine::U4DPoint3n::operator- ( const U4DPoint3n p) const

Point subraction

Parameters
ppoint
Returns
vector

◆ operator=()

U4DPoint3n & U4DEngine::U4DPoint3n::operator= ( const U4DPoint3n a)

Copy constructor for the class.

Parameters
a3D point to copy to
Returns
returns a copy of the 3D point

◆ operator==()

bool U4DEngine::U4DPoint3n::operator== ( const U4DPoint3n a)

Method which compares if two 3D points are equal.

Parameters
a3D point to compare with
Returns
Returns true if two points are equal