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

#include <BLI_float3.hh>

Public Member Functions

 float3 ()=default
 
 float3 (const float *ptr)
 
 float3 (const float(*ptr)[3])
 
 float3 (float value)
 
 float3 (int value)
 
 float3 (float x, float y, float z)
 
 operator const float * () const
 
 operator float * ()
 
float3operator+= (const float3 &b)
 
float3operator-= (const float3 &b)
 
float3operator*= (float scalar)
 
float3operator*= (const float3 &other)
 
float normalize_and_get_length ()
 
void normalize ()
 
float3 normalized () const
 
float length () const
 
float length_squared () const
 
bool is_zero () const
 
void reflect (const float3 &normal)
 
float3 reflected (const float3 &normal) const
 
void invert ()
 
uint64_t hash () const
 

Static Public Member Functions

static float3 refract (const float3 &incident, const float3 &normal, const float eta)
 
static float3 faceforward (const float3 &vector, const float3 &incident, const float3 &reference)
 
static float3 safe_divide (const float3 &a, const float3 &b)
 
static float dot (const float3 &a, const float3 &b)
 
static float3 cross_high_precision (const float3 &a, const float3 &b)
 
static float3 project (const float3 &a, const float3 &b)
 
static float distance (const float3 &a, const float3 &b)
 
static float distance_squared (const float3 &a, const float3 &b)
 
static float3 interpolate (const float3 &a, const float3 &b, float t)
 
static float3 abs (const float3 &a)
 

Public Attributes

float x
 
float y
 
float z
 

Friends

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

Detailed Description

Definition at line 25 of file BLI_float3.hh.

Constructor & Destructor Documentation

◆ float3() [1/6]

blender::float3::float3 ( )
default

Referenced by abs(), and refract().

◆ float3() [2/6]

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

Definition at line 30 of file BLI_float3.hh.

◆ float3() [3/6]

blender::float3::float3 ( const float(*)  ptr[3])
inline

Definition at line 34 of file BLI_float3.hh.

◆ float3() [4/6]

blender::float3::float3 ( float  value)
inlineexplicit

Definition at line 38 of file BLI_float3.hh.

◆ float3() [5/6]

blender::float3::float3 ( int  value)
inlineexplicit

Definition at line 42 of file BLI_float3.hh.

◆ float3() [6/6]

blender::float3::float3 ( float  x,
float  y,
float  z 
)
inline

Definition at line 46 of file BLI_float3.hh.

Member Function Documentation

◆ abs()

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

Definition at line 271 of file BLI_float3.hh.

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

Referenced by blender::nodes::try_dispatch_float_math_fl3_to_fl3().

◆ cross_high_precision()

static float3 blender::float3::cross_high_precision ( const float3 a,
const float3 b 
)
inlinestatic

◆ distance()

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

Definition at line 255 of file BLI_float3.hh.

References Freestyle::a.

Referenced by blender::nodes::try_dispatch_float_math_fl3_fl3_to_fl().

◆ distance_squared()

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

Definition at line 260 of file BLI_float3.hh.

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

◆ dot()

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

◆ faceforward()

static float3 blender::float3::faceforward ( const float3 vector,
const float3 incident,
const float3 reference 
)
inlinestatic

Definition at line 207 of file BLI_float3.hh.

References dot().

Referenced by blender::nodes::try_dispatch_float_math_fl3_fl3_fl3_to_fl3().

◆ hash()

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

◆ interpolate()

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

Definition at line 266 of file BLI_float3.hh.

References Freestyle::a, and t.

◆ invert()

void blender::float3::invert ( )
inline

Definition at line 221 of file BLI_float3.hh.

References x, y, and z.

◆ is_zero()

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

Definition at line 177 of file BLI_float3.hh.

Referenced by blender::nodes::transform_mesh().

◆ length()

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

Definition at line 167 of file BLI_float3.hh.

References len_v3().

Referenced by blender::nodes::try_dispatch_float_math_fl3_to_fl().

◆ length_squared()

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

Definition at line 172 of file BLI_float3.hh.

References len_squared_v3().

Referenced by blender::nodes::use_translate().

◆ normalize()

void blender::float3::normalize ( )
inline

◆ normalize_and_get_length()

float blender::float3::normalize_and_get_length ( )
inline

Definition at line 144 of file BLI_float3.hh.

References normalize_v3().

◆ normalized()

float3 blender::float3::normalized ( ) const
inline

Returns a normalized vector. The original vector is not changed.

Definition at line 160 of file BLI_float3.hh.

References normalize_v3_v3(), and result.

Referenced by blender::nodes::create_line_mesh(), blender::nodes::geo_node_mesh_primitive_line_exec(), and blender::nodes::try_dispatch_float_math_fl3_fl3_fl_to_fl3().

◆ operator const float *()

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

Definition at line 50 of file BLI_float3.hh.

References x.

◆ operator float *()

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

Definition at line 55 of file BLI_float3.hh.

References x.

◆ operator*=() [1/2]

float3& blender::float3::operator*= ( const float3 other)
inline

Definition at line 99 of file BLI_float3.hh.

References x, y, and z.

◆ operator*=() [2/2]

float3& blender::float3::operator*= ( float  scalar)
inline

Definition at line 91 of file BLI_float3.hh.

◆ operator+=()

float3& blender::float3::operator+= ( const float3 b)
inline

Definition at line 65 of file BLI_float3.hh.

References x, y, and z.

◆ operator-=()

float3& blender::float3::operator-= ( const float3 b)
inline

Definition at line 83 of file BLI_float3.hh.

References x, y, and z.

◆ project()

static float3 blender::float3::project ( const float3 a,
const float3 b 
)
inlinestatic

Definition at line 248 of file BLI_float3.hh.

References Freestyle::a, project_v3_v3v3(), and result.

◆ reflect()

void blender::float3::reflect ( const float3 normal)
inline

Definition at line 182 of file BLI_float3.hh.

References reflected().

◆ reflected()

float3 blender::float3::reflected ( const float3 normal) const
inline

Definition at line 187 of file BLI_float3.hh.

References normal, reflect_v3_v3v3(), and result.

Referenced by reflect().

◆ refract()

static float3 blender::float3::refract ( const float3 incident,
const float3 normal,
const float  eta 
)
inlinestatic

Definition at line 194 of file BLI_float3.hh.

References dot(), float3(), normal, result, and sqrt().

Referenced by blender::nodes::try_dispatch_float_math_fl3_fl3_fl_to_fl3().

◆ safe_divide()

static float3 blender::float3::safe_divide ( const float3 a,
const float3 b 
)
inlinestatic

Definition at line 212 of file BLI_float3.hh.

References Freestyle::a, result, x, y, and z.

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 139 of file BLI_float3.hh.

◆ operator* [1/3]

float3 operator* ( const float3 a,
const float3 b 
)
friend

Definition at line 107 of file BLI_float3.hh.

◆ operator* [2/3]

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

Definition at line 112 of file BLI_float3.hh.

◆ operator* [3/3]

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

Definition at line 117 of file BLI_float3.hh.

◆ operator+

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

Definition at line 60 of file BLI_float3.hh.

◆ operator- [1/2]

float3 operator- ( const float3 a)
friend

Definition at line 78 of file BLI_float3.hh.

◆ operator- [2/2]

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

Definition at line 73 of file BLI_float3.hh.

◆ operator/

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

Definition at line 122 of file BLI_float3.hh.

◆ operator<<

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

Definition at line 128 of file BLI_float3.hh.

◆ operator==

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

Definition at line 134 of file BLI_float3.hh.

Member Data Documentation

◆ x

float blender::float3::x

◆ y

float blender::float3::y

◆ z

float blender::float3::z

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