Drag[en]gine Game Engine  1.21
decPoint3 Class Reference

3 Component Integer Point. More...

#include <decPoint3.h>

Public Member Functions

Constructors and Destructors
 decPoint3 ()
 Create new point initialized to ( 0,0,0 ). More...
 
 decPoint3 (int nx, int ny, int nz)
 Create new point with the given values. More...
 
 decPoint3 (const decPoint3 &p)
 Create new point with the values of another point. More...
 
 decPoint3 (const decPoint &p, int nz)
 Create new point with the values from a 2-component point augmented with a third value. More...
 
 decPoint3 (const decVector &p)
 Create new point with the values of a 3-component vector discarding fractional parts of all components. More...
 
 decPoint3 (const decDVector &p)
 Create new point with the values of a 3-component vector discarding fractional parts of all components. More...
 
Management
float Length () const
 Length of the point. More...
 
void SetZero ()
 Sets all components to 0. More...
 
void Set (int nx, int ny, int nz)
 Set components to the given values. More...
 
decPoint3 Absolute () const
 Retrieves absolute point. More...
 
void SetSmallest (const decPoint3 &p)
 Set each component to the smallest value of this point and another point. More...
 
decPoint3 Smallest (const decPoint3 &p) const
 Retrieve point with each component set to the smallest value of this point and another point. More...
 
void SetLargest (const decPoint3 &p)
 Set each component to the largest value of this point and another point. More...
 
decPoint3 Largest (const decPoint3 &p) const
 Retrieve point with each component set to the largest value of this point and another point. More...
 
void SetClamped (const decPoint3 &minValue, const decPoint3 &maxValue)
 Clamp each component to the provided range. More...
 
decPoint3 Clamped (const decPoint3 &minValue, const decPoint3 &maxValue) const
 Retrieves point with each component clamped to the provided range. More...
 
Operators
decPoint3 operator- () const
 Negation of this point. More...
 
decPoint3operator= (const decPoint3 &p)
 Set components of this point to the values of another one. More...
 
decPoint3operator+= (const decPoint3 &p)
 Adds the components of another point to this one. More...
 
decPoint3operator-= (const decPoint3 &p)
 Subtracts the components of another point from this point. More...
 
decPoint3operator*= (int k)
 Multiplies the components of this point with a value k. More...
 
decPoint3operator/= (int k)
 Divides the components of this point by a value k. If the value k is 0 an exception is thrown. More...
 
decPoint3 operator+ (const decPoint3 &p) const
 Retrieves a new point with the sum of this point with another one. More...
 
decPoint3 operator- (const decPoint3 &p) const
 Retrieves a new point with the difference of this point to another one. More...
 
decPoint3 operator* (int k) const
 Retrieves a new point with this point scaled by k. More...
 
int operator* (const decPoint3 &p) const
 Calculates the dot product of this point with another one. More...
 
decPoint3 operator/ (int k) const
 Retrieves a new point with this point divided by k. If k is 0 an exception is thrown. More...
 
bool operator== (const decPoint3 &p) const
 Determines if this point is component wise equal to another point. More...
 
bool operator!= (const decPoint3 &p) const
 Determines if this point is component wise not equal to another point. More...
 
bool operator< (const decPoint3 &p) const
 Determines if all the components of this point are less then the components of another one. More...
 
bool operator> (const decPoint3 &p) const
 Determines if all the components of this point are greater then the components of another one. More...
 
bool operator<= (const decPoint3 &p) const
 Determines if all the components of this point are less then or equal to the components of another one. More...
 
bool operator>= (const decPoint3 &p) const
 Determines if all the components of this point are greater then or equal to the components of another one. More...
 

Public Attributes

int x
 X Component of point. More...
 
int y
 Y Component of point. More...
 
int z
 Z Component of point. More...
 

Detailed Description

3 Component Integer Point.

Constructor & Destructor Documentation

◆ decPoint3() [1/6]

decPoint3::decPoint3 ( )

Create new point initialized to ( 0,0,0 ).

◆ decPoint3() [2/6]

decPoint3::decPoint3 ( int  nx,
int  ny,
int  nz 
)

Create new point with the given values.

◆ decPoint3() [3/6]

decPoint3::decPoint3 ( const decPoint3 p)

Create new point with the values of another point.

◆ decPoint3() [4/6]

decPoint3::decPoint3 ( const decPoint p,
int  nz 
)

Create new point with the values from a 2-component point augmented with a third value.

◆ decPoint3() [5/6]

decPoint3::decPoint3 ( const decVector p)

Create new point with the values of a 3-component vector discarding fractional parts of all components.

◆ decPoint3() [6/6]

decPoint3::decPoint3 ( const decDVector p)

Create new point with the values of a 3-component vector discarding fractional parts of all components.

Member Function Documentation

◆ Absolute()

decPoint3 decPoint3::Absolute ( ) const

Retrieves absolute point.

◆ Clamped()

decPoint3 decPoint3::Clamped ( const decPoint3 minValue,
const decPoint3 maxValue 
) const

Retrieves point with each component clamped to the provided range.

◆ Largest()

decPoint3 decPoint3::Largest ( const decPoint3 p) const

Retrieve point with each component set to the largest value of this point and another point.

◆ Length()

float decPoint3::Length ( ) const

Length of the point.

◆ operator!=()

bool decPoint3::operator!= ( const decPoint3 p) const

Determines if this point is component wise not equal to another point.

◆ operator*() [1/2]

int decPoint3::operator* ( const decPoint3 p) const

Calculates the dot product of this point with another one.

◆ operator*() [2/2]

decPoint3 decPoint3::operator* ( int  k) const

Retrieves a new point with this point scaled by k.

◆ operator*=()

decPoint3& decPoint3::operator*= ( int  k)

Multiplies the components of this point with a value k.

◆ operator+()

decPoint3 decPoint3::operator+ ( const decPoint3 p) const

Retrieves a new point with the sum of this point with another one.

◆ operator+=()

decPoint3& decPoint3::operator+= ( const decPoint3 p)

Adds the components of another point to this one.

◆ operator-() [1/2]

decPoint3 decPoint3::operator- ( ) const

Negation of this point.

◆ operator-() [2/2]

decPoint3 decPoint3::operator- ( const decPoint3 p) const

Retrieves a new point with the difference of this point to another one.

◆ operator-=()

decPoint3& decPoint3::operator-= ( const decPoint3 p)

Subtracts the components of another point from this point.

◆ operator/()

decPoint3 decPoint3::operator/ ( int  k) const

Retrieves a new point with this point divided by k. If k is 0 an exception is thrown.

◆ operator/=()

decPoint3& decPoint3::operator/= ( int  k)

Divides the components of this point by a value k. If the value k is 0 an exception is thrown.

◆ operator<()

bool decPoint3::operator< ( const decPoint3 p) const

Determines if all the components of this point are less then the components of another one.

◆ operator<=()

bool decPoint3::operator<= ( const decPoint3 p) const

Determines if all the components of this point are less then or equal to the components of another one.

◆ operator=()

decPoint3& decPoint3::operator= ( const decPoint3 p)

Set components of this point to the values of another one.

◆ operator==()

bool decPoint3::operator== ( const decPoint3 p) const

Determines if this point is component wise equal to another point.

◆ operator>()

bool decPoint3::operator> ( const decPoint3 p) const

Determines if all the components of this point are greater then the components of another one.

◆ operator>=()

bool decPoint3::operator>= ( const decPoint3 p) const

Determines if all the components of this point are greater then or equal to the components of another one.

◆ Set()

void decPoint3::Set ( int  nx,
int  ny,
int  nz 
)

Set components to the given values.

◆ SetClamped()

void decPoint3::SetClamped ( const decPoint3 minValue,
const decPoint3 maxValue 
)

Clamp each component to the provided range.

◆ SetLargest()

void decPoint3::SetLargest ( const decPoint3 p)

Set each component to the largest value of this point and another point.

◆ SetSmallest()

void decPoint3::SetSmallest ( const decPoint3 p)

Set each component to the smallest value of this point and another point.

◆ SetZero()

void decPoint3::SetZero ( )

Sets all components to 0.

◆ Smallest()

decPoint3 decPoint3::Smallest ( const decPoint3 p) const

Retrieve point with each component set to the smallest value of this point and another point.

Member Data Documentation

◆ x

int decPoint3::x

X Component of point.

◆ y

int decPoint3::y

Y Component of point.

◆ z

int decPoint3::z

Z Component of point.


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