Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | Friends | List of all members
SkPatch3D Class Reference

#include <SkCamera.h>

Public Member Functions

 SkPatch3D ()
 
void reset ()
 
void transform (const SkM44 &, SkPatch3D *dst=nullptr) const
 
SkScalar dotWith (SkScalar dx, SkScalar dy, SkScalar dz) const
 
SkScalar dotWith (const SkV3 &v) const
 
void rotate (SkScalar, SkScalar, SkScalar)
 
void rotateDegrees (SkScalar, SkScalar, SkScalar)
 

Public Attributes

SkV3 fU
 
SkV3 fV
 
SkV3 fOrigin
 

Friends

class SkCamera3D
 

Detailed Description

Definition at line 27 of file SkCamera.h.

Constructor & Destructor Documentation

◆ SkPatch3D()

SkPatch3D::SkPatch3D ( )

Definition at line 24 of file SkCamera.cpp.

24 {
25 this->reset();
26}
void reset()
Definition: SkCamera.cpp:28

Member Function Documentation

◆ dotWith() [1/2]

SkScalar SkPatch3D::dotWith ( const SkV3 v) const
inline

Definition at line 36 of file SkCamera.h.

36 {
37 return this->dotWith(v.x, v.y, v.z);
38 }
SkScalar dotWith(SkScalar dx, SkScalar dy, SkScalar dz) const
Definition: SkCamera.cpp:44
float y
Definition: SkM44.h:57
float z
Definition: SkM44.h:57
float x
Definition: SkM44.h:57

◆ dotWith() [2/2]

SkScalar SkPatch3D::dotWith ( SkScalar  dx,
SkScalar  dy,
SkScalar  dz 
) const

Definition at line 44 of file SkCamera.cpp.

44 {
45 SkScalar cx = fU.y * fV.z - fU.z * fV.y;
46 SkScalar cy = fU.z * fV.x - fU.x * fV.y;
47 SkScalar cz = fU.x * fV.y - fU.y * fV.x;
48
49 return cx * dx + cy * dy + cz * dz;
50}
SkV3 fV
Definition: SkCamera.h:46
SkV3 fU
Definition: SkCamera.h:46
float SkScalar
Definition: extension.cpp:12
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
Definition: SkRecords.h:208

◆ reset()

void SkPatch3D::reset ( )

Definition at line 28 of file SkCamera.cpp.

28 {
29 fOrigin = {0, 0, 0};
30 fU = {SK_Scalar1, 0, 0};
31 fV = {0, -SK_Scalar1, 0};
32}
#define SK_Scalar1
Definition: SkScalar.h:18
SkV3 fOrigin
Definition: SkCamera.h:47

◆ rotate()

void SkPatch3D::rotate ( SkScalar  ,
SkScalar  ,
SkScalar   
)
inline

Definition at line 41 of file SkCamera.h.

41{}

◆ rotateDegrees()

void SkPatch3D::rotateDegrees ( SkScalar  ,
SkScalar  ,
SkScalar   
)
inline

Definition at line 42 of file SkCamera.h.

42{}

◆ transform()

void SkPatch3D::transform ( const SkM44 m,
SkPatch3D dst = nullptr 
) const

Definition at line 34 of file SkCamera.cpp.

34 {
35 if (dst == nullptr) {
36 dst = const_cast<SkPatch3D*>(this);
37 }
38 dst->fU = m * fU;
39 dst->fV = m * fV;
40 auto [x,y,z,_] = m.map(fOrigin.x, fOrigin.y, fOrigin.z, 1);
41 dst->fOrigin = {x, y, z};
42}
double y
double x
dst
Definition: cp.py:12

Friends And Related Function Documentation

◆ SkCamera3D

friend class SkCamera3D
friend

Definition at line 49 of file SkCamera.h.

Member Data Documentation

◆ fOrigin

SkV3 SkPatch3D::fOrigin

Definition at line 47 of file SkCamera.h.

◆ fU

SkV3 SkPatch3D::fU

Definition at line 46 of file SkCamera.h.

◆ fV

SkV3 SkPatch3D::fV

Definition at line 46 of file SkCamera.h.


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