Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
SkV2 Struct Reference

#include <SkM44.h>

Public Member Functions

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

Static Public Member Functions

static SkScalar Dot (SkV2 a, SkV2 b)
 
static SkScalar Cross (SkV2 a, SkV2 b)
 
static SkV2 Normalize (SkV2 v)
 

Public Attributes

float x
 
float y
 

Friends

SkV2 operator* (SkV2 v, SkScalar s)
 
SkV2 operator* (SkScalar s, SkV2 v)
 
SkV2 operator/ (SkV2 v, SkScalar s)
 
SkV2 operator/ (SkScalar s, SkV2 v)
 

Detailed Description

Definition at line 19 of file SkM44.h.

Member Function Documentation

◆ Cross()

static SkScalar SkV2::Cross ( SkV2  a,
SkV2  b 
)
inlinestatic

Definition at line 26 of file SkM44.h.

26{ return a.x * b.y - a.y * b.x; }
static bool b
struct MyStruct a[10]

◆ cross()

SkScalar SkV2::cross ( SkV2  v) const
inline

Definition at line 49 of file SkM44.h.

49{ return Cross(*this, v); }
static SkScalar Cross(SkV2 a, SkV2 b)
Definition: SkM44.h:26

◆ Dot()

static SkScalar SkV2::Dot ( SkV2  a,
SkV2  b 
)
inlinestatic

Definition at line 25 of file SkM44.h.

25{ return a.x * b.x + a.y * b.y; }

◆ dot()

SkScalar SkV2::dot ( SkV2  v) const
inline

Definition at line 48 of file SkM44.h.

48{ return Dot(*this, v); }
static SkScalar Dot(SkV2 a, SkV2 b)
Definition: SkM44.h:25

◆ length()

SkScalar SkV2::length ( ) const
inline

Definition at line 46 of file SkM44.h.

46{ return SkScalarSqrt(this->lengthSquared()); }
#define SkScalarSqrt(x)
Definition: SkScalar.h:42
SkScalar lengthSquared() const
Definition: SkM44.h:45

◆ lengthSquared()

SkScalar SkV2::lengthSquared ( ) const
inline

Definition at line 45 of file SkM44.h.

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

◆ normalize()

SkV2 SkV2::normalize ( ) const
inline

Definition at line 50 of file SkM44.h.

50{ return Normalize(*this); }
static SkV2 Normalize(SkV2 v)
Definition: SkM44.h:27

◆ Normalize()

static SkV2 SkV2::Normalize ( SkV2  v)
inlinestatic

Definition at line 27 of file SkM44.h.

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

◆ operator!=()

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

Definition at line 23 of file SkM44.h.

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

◆ operator*()

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

Definition at line 33 of file SkM44.h.

33{ return {x*v.x, y*v.y}; }
float x
Definition: SkM44.h:20
float y
Definition: SkM44.h:20

◆ operator*=() [1/2]

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

Definition at line 42 of file SkM44.h.

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

◆ operator*=() [2/2]

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

Definition at line 41 of file SkM44.h.

41{ *this = *this * v; }

◆ operator+()

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

Definition at line 30 of file SkM44.h.

30{ return {x+v.x, y+v.y}; }

◆ operator+=()

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

Definition at line 39 of file SkM44.h.

39{ *this = *this + v; }

◆ operator-() [1/2]

SkV2 SkV2::operator- ( ) const
inline

Definition at line 29 of file SkM44.h.

29{ return {-x, -y}; }

◆ operator-() [2/2]

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

Definition at line 31 of file SkM44.h.

31{ return {x-v.x, y-v.y}; }

◆ operator-=()

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

Definition at line 40 of file SkM44.h.

40{ *this = *this - v; }

◆ operator/=()

void SkV2::operator/= ( SkScalar  s)
inline

Definition at line 43 of file SkM44.h.

43{ *this = *this / s; }

◆ operator==()

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

Definition at line 22 of file SkM44.h.

22{ return x == v.x && y == v.y; }

◆ ptr() [1/2]

float * SkV2::ptr ( )
inline

Definition at line 53 of file SkM44.h.

53{ return &x; }

◆ ptr() [2/2]

const float * SkV2::ptr ( ) const
inline

Definition at line 52 of file SkM44.h.

52{ return &x; }

Friends And Related Function Documentation

◆ operator* [1/2]

SkV2 operator* ( SkScalar  s,
SkV2  v 
)
friend

Definition at line 35 of file SkM44.h.

35{ return {v.x*s, v.y*s}; }

◆ operator* [2/2]

SkV2 operator* ( SkV2  v,
SkScalar  s 
)
friend

Definition at line 34 of file SkM44.h.

34{ return {v.x*s, v.y*s}; }

◆ operator/ [1/2]

SkV2 operator/ ( SkScalar  s,
SkV2  v 
)
friend

Definition at line 37 of file SkM44.h.

37{ return {s/v.x, s/v.y}; }

◆ operator/ [2/2]

SkV2 operator/ ( SkV2  v,
SkScalar  s 
)
friend

Definition at line 36 of file SkM44.h.

36{ return {v.x/s, v.y/s}; }

Member Data Documentation

◆ x

float SkV2::x

Definition at line 20 of file SkM44.h.

◆ y

float SkV2::y

Definition at line 20 of file SkM44.h.


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