Banuba SDK
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
bnb::point2d Union Reference

Public Member Functions

float sum ()
 
point2d sqr () const noexcept
 
point2d operator/ (const point2d &p) const noexcept
 
point2d operator/ (float f) const noexcept
 
point2d operator* (float a) const noexcept
 
point2d operator+ (float a) const noexcept
 
point2d operator* (const point2d &p) const noexcept
 
point2d operator- (const point2d &p) const noexcept
 
point2d operator+ (const point2d &p) const noexcept
 

Public Attributes

struct { 
 
   float   x 
 
   float   y 
 
};  
 
float data [2]
 

Detailed Description

Definition at line 42 of file base_types.hpp.

Member Function Documentation

◆ operator*() [1/2]

point2d bnb::point2d::operator* ( const point2d & p) const
inlinenoexcept

Definition at line 80 of file base_types.hpp.

81 {
82 return point2d{x * p.x, y * p.y};
83 }

◆ operator*() [2/2]

point2d bnb::point2d::operator* ( float a) const
inlinenoexcept

Definition at line 70 of file base_types.hpp.

71 {
72 return point2d{x * a, y * a};
73 }

◆ operator+() [1/2]

point2d bnb::point2d::operator+ ( const point2d & p) const
inlinenoexcept

Definition at line 90 of file base_types.hpp.

91 {
92 return point2d{x + p.x, y + p.y};
93 }

◆ operator+() [2/2]

point2d bnb::point2d::operator+ ( float a) const
inlinenoexcept

Definition at line 75 of file base_types.hpp.

76 {
77 return point2d{x + a, y + a};
78 }

◆ operator-()

point2d bnb::point2d::operator- ( const point2d & p) const
inlinenoexcept

Definition at line 85 of file base_types.hpp.

86 {
87 return point2d{x - p.x, y - p.y};
88 }

◆ operator/() [1/2]

point2d bnb::point2d::operator/ ( const point2d & p) const
inlinenoexcept

Definition at line 60 of file base_types.hpp.

61 {
62 return point2d{x / p.x, y / p.y};
63 }

◆ operator/() [2/2]

point2d bnb::point2d::operator/ ( float f) const
inlinenoexcept

Definition at line 65 of file base_types.hpp.

66 {
67 return point2d{x / f, y / f};
68 }

◆ sqr()

point2d bnb::point2d::sqr ( ) const
inlinenoexcept

Definition at line 55 of file base_types.hpp.

56 {
57 return *this * *this;
58 }

◆ sum()

float bnb::point2d::sum ( )
inline

Definition at line 50 of file base_types.hpp.

51 {
52 return x + y;
53 }

Member Data Documentation

◆ data

float bnb::point2d::data[2]

Definition at line 48 of file base_types.hpp.

◆ x

float bnb::point2d::x

Definition at line 46 of file base_types.hpp.

◆ y

float bnb::point2d::y

Definition at line 46 of file base_types.hpp.


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