3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Math::UPoint Struct Reference

Represents a 2D point with unsigned integer coordinates. More...

#include <UPoint.hpp>

Public Member Functions

constexpr UPoint (unsigned x=0, unsigned y=0)
constexpr UPoint (std::initializer_list< unsigned > lst)
UPoint operator+= (const UPoint &p)
 Adds another point to this point in-place.
UPoint operator+ (const UPoint &p) const
 Adds another point to this point and returns the result.
UPoint operator-= (const UPoint &p)
 Subtracts another point from this point in-place.
UPoint operator- (const UPoint &p) const
 Subtracts another point from this point and returns the result.
UPoint operator*= (float s)
 Multiplies this point by a scalar in-place.
UPoint operator* (float s) const
 Multiplies this point by a scalar and returns the result.
UPoint operator/= (float s)
 Divides this point by a scalar in-place.
UPoint operator/ (float s) const
 Divides this point by a scalar and returns the result.
auto operator<=> (const UPoint &) const noexcept=default
 Compares this point with another point for equality.

Public Attributes

unsigned X
 X coordinate of the point.
unsigned Y
 Y coordinate of the point.

Detailed Description

Represents a 2D point with unsigned integer coordinates.

Constructor & Destructor Documentation

◆ UPoint() [1/2]

Engine3DRadSpace.Math::UPoint::UPoint ( unsigned x = 0,
unsigned y = 0 )
inlineexplicitconstexpr

◆ UPoint() [2/2]

Engine3DRadSpace.Math::UPoint::UPoint ( std::initializer_list< unsigned > lst)
inlineexplicitconstexpr

Member Function Documentation

◆ operator*()

UPoint UPoint::operator* ( float s) const

Multiplies this point by a scalar and returns the result.

Parameters
sThe scalar to multiply by.
Returns
The resulting point after multiplication.

◆ operator*=()

UPoint UPoint::operator*= ( float s)

Multiplies this point by a scalar in-place.

Parameters
sThe scalar to multiply by.
Returns
A reference to this point after multiplication.

◆ operator+()

UPoint UPoint::operator+ ( const UPoint & p) const

Adds another point to this point and returns the result.

Parameters
pThe point to add.
Returns
The resulting point after addition.

◆ operator+=()

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

Adds another point to this point in-place.

Parameters
pThe point to add.
Returns
A reference to this point after addition.

◆ operator-()

UPoint UPoint::operator- ( const UPoint & p) const

Subtracts another point from this point and returns the result.

Parameters
pThe point to subtract.
Returns
The resulting point after subtraction.

◆ operator-=()

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

Subtracts another point from this point in-place.

Parameters
pThe point to subtract.
Returns
A reference to this point after subtraction.

◆ operator/()

UPoint UPoint::operator/ ( float s) const

Divides this point by a scalar and returns the result.

Parameters
sThe scalar to divide by.
Returns
The resulting point after division.

◆ operator/=()

UPoint UPoint::operator/= ( float s)

Divides this point by a scalar in-place.

Parameters
sThe scalar to divide by.
Returns
A reference to this point after division.

◆ operator<=>()

auto Engine3DRadSpace.Math::UPoint::operator<=> ( const UPoint & ) const
defaultnoexcept

Compares this point with another point for equality.

Returns
default strong ordering

Member Data Documentation

◆ X

unsigned Engine3DRadSpace.Math::UPoint::X

X coordinate of the point.

◆ Y

unsigned Engine3DRadSpace.Math::UPoint::Y

Y coordinate of the point.


The documentation for this struct was generated from the following files: