Blender  V2.93
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
blender::float2 Struct Reference

#include <BLI_float2.hh>

Classes

struct  isect_result
 

Public Member Functions

 float2 ()=default
 
 float2 (const float *ptr)
 
 float2 (float value)
 
 float2 (int value)
 
 float2 (float x, float y)
 
 float2 (const float3 &other)
 
 operator float * ()
 
 operator const float * () const
 
float length () const
 
float length_squared () const
 
bool is_zero () const
 
float2operator+= (const float2 &other)
 
float2operator-= (const float2 &other)
 
float2operator*= (float factor)
 
float2operator/= (float divisor)
 
uint64_t hash () const
 

Static Public Member Functions

static float dot (const float2 &a, const float2 &b)
 
static float2 interpolate (const float2 &a, const float2 &b, float t)
 
static float2 abs (const float2 &a)
 
static float distance (const float2 &a, const float2 &b)
 
static float distance_squared (const float2 &a, const float2 &b)
 
static isect_result isect_seg_seg (const float2 &v1, const float2 &v2, const float2 &v3, const float2 &v4)
 

Public Attributes

float x
 
float y
 

Friends

float2 operator+ (const float2 &a, const float2 &b)
 
float2 operator- (const float2 &a, const float2 &b)
 
float2 operator* (const float2 &a, float b)
 
float2 operator/ (const float2 &a, float b)
 
float2 operator* (float a, const float2 &b)
 
std::ostream & operator<< (std::ostream &stream, const float2 &v)
 
bool operator== (const float2 &a, const float2 &b)
 
bool operator!= (const float2 &a, const float2 &b)
 

Detailed Description

Definition at line 23 of file BLI_float2.hh.

Constructor & Destructor Documentation

◆ float2() [1/6]

blender::float2::float2 ( )
default

Referenced by abs().

◆ float2() [2/6]

blender::float2::float2 ( const float ptr)
inline

Definition at line 28 of file BLI_float2.hh.

◆ float2() [3/6]

blender::float2::float2 ( float  value)
inlineexplicit

Definition at line 32 of file BLI_float2.hh.

◆ float2() [4/6]

blender::float2::float2 ( int  value)
inlineexplicit

Definition at line 36 of file BLI_float2.hh.

◆ float2() [5/6]

blender::float2::float2 ( float  x,
float  y 
)
inline

Definition at line 40 of file BLI_float2.hh.

◆ float2() [6/6]

blender::float2::float2 ( const float3 other)
inline

Definition at line 44 of file BLI_float2.hh.

Member Function Documentation

◆ abs()

static float2 blender::float2::abs ( const float2 a)
inlinestatic

Definition at line 150 of file BLI_float2.hh.

References Freestyle::a, fabsf, and float2().

◆ distance()

static float blender::float2::distance ( const float2 a,
const float2 b 
)
inlinestatic

Definition at line 155 of file BLI_float2.hh.

References Freestyle::a.

◆ distance_squared()

static float blender::float2::distance_squared ( const float2 a,
const float2 b 
)
inlinestatic

Definition at line 160 of file BLI_float2.hh.

References Freestyle::a, KDL::diff(), and dot().

◆ dot()

static float blender::float2::dot ( const float2 a,
const float2 b 
)
inlinestatic

Definition at line 140 of file BLI_float2.hh.

References Freestyle::a, x, and y.

Referenced by distance_squared().

◆ hash()

uint64_t blender::float2::hash ( ) const
inline

Definition at line 101 of file BLI_float2.hh.

References x, x2, and y.

◆ interpolate()

static float2 blender::float2::interpolate ( const float2 a,
const float2 b,
float  t 
)
inlinestatic

Definition at line 145 of file BLI_float2.hh.

References Freestyle::a, and t.

◆ is_zero()

bool blender::float2::is_zero ( ) const
inline

Definition at line 68 of file BLI_float2.hh.

◆ isect_seg_seg()

float2::isect_result float2::isect_seg_seg ( const float2 v1,
const float2 v2,
const float2 v3,
const float2 v4 
)
static

◆ length()

float blender::float2::length ( ) const
inline

Definition at line 58 of file BLI_float2.hh.

References len_v2().

◆ length_squared()

float blender::float2::length_squared ( ) const
inline

Definition at line 63 of file BLI_float2.hh.

References len_squared_v2().

◆ operator const float *()

blender::float2::operator const float * ( ) const
inline

Definition at line 53 of file BLI_float2.hh.

References x.

◆ operator float *()

blender::float2::operator float * ( )
inline

Definition at line 48 of file BLI_float2.hh.

References x.

◆ operator*=()

float2& blender::float2::operator*= ( float  factor)
inline

Definition at line 87 of file BLI_float2.hh.

References x, and y.

◆ operator+=()

float2& blender::float2::operator+= ( const float2 other)
inline

Definition at line 73 of file BLI_float2.hh.

References x, and y.

◆ operator-=()

float2& blender::float2::operator-= ( const float2 other)
inline

Definition at line 80 of file BLI_float2.hh.

References x, and y.

◆ operator/=()

float2& blender::float2::operator/= ( float  divisor)
inline

Definition at line 94 of file BLI_float2.hh.

References x, and y.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const float2 a,
const float2 b 
)
friend

Definition at line 187 of file BLI_float2.hh.

◆ operator* [1/2]

float2 operator* ( const float2 a,
float  b 
)
friend

Definition at line 118 of file BLI_float2.hh.

◆ operator* [2/2]

float2 operator* ( float  a,
const float2 b 
)
friend

Definition at line 129 of file BLI_float2.hh.

◆ operator+

float2 operator+ ( const float2 a,
const float2 b 
)
friend

Definition at line 108 of file BLI_float2.hh.

◆ operator-

float2 operator- ( const float2 a,
const float2 b 
)
friend

Definition at line 113 of file BLI_float2.hh.

◆ operator/

float2 operator/ ( const float2 a,
float  b 
)
friend

Definition at line 123 of file BLI_float2.hh.

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const float2 v 
)
friend

Definition at line 134 of file BLI_float2.hh.

◆ operator==

bool operator== ( const float2 a,
const float2 b 
)
friend

Definition at line 182 of file BLI_float2.hh.

Member Data Documentation

◆ x

float blender::float2::x

◆ y

float blender::float2::y

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