Drag[en]gine Game Engine  1.0
decPoint3 Class Reference

3 Component Integer Point. More...

#include <decPoint3.h>

Public Member Functions

Constructors and Destructors
 decPoint3 ()
 
 decPoint3 (int nx, int ny, int nz)
 
 decPoint3 (const decPoint3 &p)
 
 decPoint3 (const decPoint &p, int nz)
 
 decPoint3 (const decVector &p)
 
 decPoint3 (const decDVector &p)
 
Management
float Length () const
 
void SetZero ()
 
void Set (int nx, int ny, int nz)
 
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
 
decPoint3operator= (const decPoint3 &p)
 
decPoint3operator+= (const decPoint3 &p)
 
decPoint3operator-= (const decPoint3 &p)
 
decPoint3operator*= (int k)
 
decPoint3operator/= (int k)
 
decPoint3 operator+ (const decPoint3 &p) const
 
decPoint3 operator- (const decPoint3 &p) const
 
decPoint3 operator* (int k) const
 
int operator* (const decPoint3 &p) const
 
decPoint3 operator/ (int k) const
 
bool operator== (const decPoint3 &p) const
 
bool operator!= (const decPoint3 &p) const
 
bool operator< (const decPoint3 &p) const
 
bool operator> (const decPoint3 &p) const
 
bool operator<= (const decPoint3 &p) const
 
bool operator>= (const decPoint3 &p) const
 

Public Attributes

int x
 
int y
 
int z
 

Detailed Description

3 Component Integer Point.

Author
Pl├╝ss Roland
Version
1.0
Date
2014

Constructor & Destructor Documentation

◆ decPoint3() [1/6]

decPoint3::decPoint3 ( )

Creates a new point initialized to ( 0,0,0 ).

◆ decPoint3() [2/6]

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

Creates a new point with the given values.

◆ decPoint3() [3/6]

decPoint3::decPoint3 ( const decPoint3 p)

Creates a new point with the values of another point.

◆ decPoint3() [4/6]

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

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

◆ decPoint3() [5/6]

decPoint3::decPoint3 ( const decVector p)

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

◆ decPoint3() [6/6]

decPoint3::decPoint3 ( const decDVector p)

Creates a 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

Retrieves the 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]

decPoint3 decPoint3::operator* ( int  k) const

Retrieves a new point with this point scaled by k.

◆ operator*() [2/2]

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

Calculates the dot product of this point with another one.

◆ 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

Retrieves the 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)

Sets the 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 
)

Sets the 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: