Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
SkV3 Struct Reference

#include <SkM44.h>

Public Member Functions

bool operator== (const SkV3 &v) const
 
bool operator!= (const SkV3 &v) const
 
SkV3 operator- () const
 
SkV3 operator+ (const SkV3 &v) const
 
SkV3 operator- (const SkV3 &v) const
 
SkV3 operator* (const SkV3 &v) const
 
void operator+= (SkV3 v)
 
void operator-= (SkV3 v)
 
void operator*= (SkV3 v)
 
void operator*= (SkScalar s)
 
SkScalar lengthSquared () const
 
SkScalar length () const
 
SkScalar dot (const SkV3 &v) const
 
SkV3 cross (const SkV3 &v) const
 
SkV3 normalize () const
 
const float * ptr () const
 
float * ptr ()
 

Static Public Member Functions

static SkScalar Dot (const SkV3 &a, const SkV3 &b)
 
static SkV3 Cross (const SkV3 &a, const SkV3 &b)
 
static SkV3 Normalize (const SkV3 &v)
 

Public Attributes

float x
 
float y
 
float z
 

Friends

SkV3 operator* (const SkV3 &v, SkScalar s)
 
SkV3 operator* (SkScalar s, const SkV3 &v)
 

Detailed Description

Definition at line 56 of file SkM44.h.

Member Function Documentation

◆ Cross()

static SkV3 SkV3::Cross ( const SkV3 a,
const SkV3 b 
)
inlinestatic

Definition at line 65 of file SkM44.h.

65 {
66 return { a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x };
67 }
static bool b
struct MyStruct a[10]

◆ cross()

SkV3 SkV3::cross ( const SkV3 v) const
inline

Definition at line 91 of file SkM44.h.

91{ return Cross(*this, v); }
static SkV3 Cross(const SkV3 &a, const SkV3 &b)
Definition SkM44.h:65

◆ Dot()

static SkScalar SkV3::Dot ( const SkV3 a,
const SkV3 b 
)
inlinestatic

Definition at line 64 of file SkM44.h.

64{ return a.x*b.x + a.y*b.y + a.z*b.z; }

◆ dot()

SkScalar SkV3::dot ( const SkV3 v) const
inline

Definition at line 90 of file SkM44.h.

90{ return Dot(*this, v); }
static SkScalar Dot(const SkV3 &a, const SkV3 &b)
Definition SkM44.h:64

◆ length()

SkScalar SkV3::length ( ) const
inline

Definition at line 88 of file SkM44.h.

88{ return SkScalarSqrt(Dot(*this, *this)); }
#define SkScalarSqrt(x)
Definition SkScalar.h:42

◆ lengthSquared()

SkScalar SkV3::lengthSquared ( ) const
inline

Definition at line 87 of file SkM44.h.

87{ return Dot(*this, *this); }

◆ normalize()

SkV3 SkV3::normalize ( ) const
inline

Definition at line 92 of file SkM44.h.

92{ return Normalize(*this); }
static SkV3 Normalize(const SkV3 &v)
Definition SkM44.h:68

◆ Normalize()

static SkV3 SkV3::Normalize ( const SkV3 v)
inlinestatic

Definition at line 68 of file SkM44.h.

68{ return v * (1.0f / v.length()); }
SkScalar length() const
Definition SkM44.h:88

◆ operator!=()

bool SkV3::operator!= ( const SkV3 v) const
inline

Definition at line 62 of file SkM44.h.

62{ return !(*this == v); }

◆ operator*()

SkV3 SkV3::operator* ( const SkV3 v) const
inline

Definition at line 74 of file SkM44.h.

74 {
75 return { x*v.x, y*v.y, z*v.z };
76 }
float y
Definition SkM44.h:57
float z
Definition SkM44.h:57
float x
Definition SkM44.h:57

◆ operator*=() [1/2]

void SkV3::operator*= ( SkScalar  s)
inline

Definition at line 85 of file SkM44.h.

85{ *this = *this * s; }
struct MyStruct s

◆ operator*=() [2/2]

void SkV3::operator*= ( SkV3  v)
inline

Definition at line 84 of file SkM44.h.

84{ *this = *this * v; }

◆ operator+()

SkV3 SkV3::operator+ ( const SkV3 v) const
inline

Definition at line 71 of file SkM44.h.

71{ return { x + v.x, y + v.y, z + v.z }; }

◆ operator+=()

void SkV3::operator+= ( SkV3  v)
inline

Definition at line 82 of file SkM44.h.

82{ *this = *this + v; }

◆ operator-() [1/2]

SkV3 SkV3::operator- ( ) const
inline

Definition at line 70 of file SkM44.h.

70{ return {-x, -y, -z}; }

◆ operator-() [2/2]

SkV3 SkV3::operator- ( const SkV3 v) const
inline

Definition at line 72 of file SkM44.h.

72{ return { x - v.x, y - v.y, z - v.z }; }

◆ operator-=()

void SkV3::operator-= ( SkV3  v)
inline

Definition at line 83 of file SkM44.h.

83{ *this = *this - v; }

◆ operator==()

bool SkV3::operator== ( const SkV3 v) const
inline

Definition at line 59 of file SkM44.h.

59 {
60 return x == v.x && y == v.y && z == v.z;
61 }

◆ ptr() [1/2]

float * SkV3::ptr ( )
inline

Definition at line 95 of file SkM44.h.

95{ return &x; }

◆ ptr() [2/2]

const float * SkV3::ptr ( ) const
inline

Definition at line 94 of file SkM44.h.

94{ return &x; }

Friends And Related Symbol Documentation

◆ operator* [1/2]

SkV3 operator* ( const SkV3 v,
SkScalar  s 
)
friend

Definition at line 77 of file SkM44.h.

77 {
78 return { v.x*s, v.y*s, v.z*s };
79 }

◆ operator* [2/2]

SkV3 operator* ( SkScalar  s,
const SkV3 v 
)
friend

Definition at line 80 of file SkM44.h.

80{ return v*s; }

Member Data Documentation

◆ x

float SkV3::x

Definition at line 57 of file SkM44.h.

◆ y

float SkV3::y

Definition at line 57 of file SkM44.h.

◆ z

float SkV3::z

Definition at line 57 of file SkM44.h.


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