 |
Skia
2D Graphics Library
|
Go to the documentation of this file.
8 #ifndef SkPoint3_DEFINED
9 #define SkPoint3_DEFINED
54 p.
set(scale * fX, scale * fY, scale * fZ);
107 return { t * p.
fX, t * p.
fY, t * p.
fZ };
135 return DotProduct(*
this, vec);
150 return CrossProduct(*
this, vec);
friend SkPoint3 operator-(const SkPoint3 &a, const SkPoint3 &b)
Returns a new point whose coordinates are the difference between a and b (i.e., a - b)
Definition: SkPoint3.h:80
static bool SkScalarIsNaN(SkScalar x)
Definition: SkScalar.h:67
SkPoint3 SkVector3
Definition: SkPoint3.h:154
Definition: SkPoint3.h:13
friend SkPoint3 operator*(SkScalar t, SkPoint3 p)
Definition: SkPoint3.h:106
SkScalar z() const
Definition: SkPoint3.h:24
void scale(SkScalar value)
Scale the point's coordinates by scale.
Definition: SkPoint3.h:60
SkScalar fY
Definition: SkPoint3.h:14
static SkScalar Length(SkScalar x, SkScalar y, SkScalar z)
Returns the Euclidian distance from (0,0,0) to (x,y,z)
friend bool operator!=(const SkPoint3 &a, const SkPoint3 &b)
Definition: SkPoint3.h:32
#define SK_API
Definition: SkTypes.h:181
#define SkASSERT(cond)
Definition: SkTypes.h:460
void operator+=(const SkPoint3 &v)
Add v's coordinates to the point's.
Definition: SkPoint3.h:92
void set(SkScalar x, SkScalar y, SkScalar z)
Definition: SkPoint3.h:26
SkScalar fZ
Definition: SkPoint3.h:14
bool isFinite() const
Returns true if fX, fY, and fZ are measurable values.
Definition: SkPoint3.h:114
static SkPoint3 CrossProduct(const SkPoint3 &a, const SkPoint3 &b)
Returns the cross product of a and b, treating them as 3D vectors.
Definition: SkPoint3.h:140
SkScalar fX
Definition: SkPoint3.h:14
SkScalar x() const
Definition: SkPoint3.h:22
float SkScalar
Definition: SkScalar.h:16
SkPoint3 operator-() const
Return a new point whose X, Y and Z coordinates are the negative of the original point's.
Definition: SkPoint3.h:69
friend SkPoint3 operator+(const SkPoint3 &a, const SkPoint3 &b)
Returns a new point whose coordinates are the sum of a and b (a + b)
Definition: SkPoint3.h:86
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)
Definition: SkPoint3.h:16
SkScalar dot(const SkPoint3 &vec) const
Definition: SkPoint3.h:134
SkPoint3 makeScale(SkScalar scale) const
Return a new point whose X, Y and Z coordinates are scaled.
Definition: SkPoint3.h:52
SkPoint3 SkColor3f
Definition: SkPoint3.h:155
SkScalar length() const
Return the Euclidian distance from (0,0,0) to the point.
Definition: SkPoint3.h:42
SkPoint3 cross(const SkPoint3 &vec) const
Definition: SkPoint3.h:149
static SkScalar DotProduct(const SkPoint3 &a, const SkPoint3 &b)
Returns the dot product of a and b, treating them as 3D vectors.
Definition: SkPoint3.h:130
void operator-=(const SkPoint3 &v)
Subtract v's coordinates from the point's.
Definition: SkPoint3.h:100
friend bool operator==(const SkPoint3 &a, const SkPoint3 &b)
Definition: SkPoint3.h:28
SkScalar y() const
Definition: SkPoint3.h:23
bool normalize()
Set the point (vector) to be unit-length in the same direction as it already points.