Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkPoint3 Struct Reference

Public Member Functions

SkScalar x () const
 
SkScalar y () const
 
SkScalar z () const
 
void set (SkScalar x, SkScalar y, SkScalar z)
 
SkScalar length () const
 Return the Euclidian distance from (0,0,0) to the point.
 
bool normalize ()
 Set the point (vector) to be unit-length in the same direction as it already points. More...
 
SkPoint3 makeScale (SkScalar scale) const
 Return a new point whose X, Y and Z coordinates are scaled.
 
void scale (SkScalar value)
 Scale the point's coordinates by scale.
 
SkPoint3 operator- () const
 Return a new point whose X, Y and Z coordinates are the negative of the original point's.
 
void operator+= (const SkPoint3 &v)
 Add v's coordinates to the point's.
 
void operator-= (const SkPoint3 &v)
 Subtract v's coordinates from the point's.
 
SkScalar dot (const SkPoint3 &vec) const
 

Static Public Member Functions

static SkPoint3 Make (SkScalar x, SkScalar y, SkScalar z)
 
static SkScalar Length (SkScalar x, SkScalar y, SkScalar z)
 Returns the Euclidian distance from (0,0,0) to (x,y,z)
 
static SkScalar DotProduct (const SkPoint3 &a, const SkPoint3 &b)
 Returns the dot product of a and b, treating them as 3D vectors.
 

Public Attributes

SkScalar fX
 
SkScalar fY
 
SkScalar fZ
 

Friends

bool operator== (const SkPoint3 &a, const SkPoint3 &b)
 
bool operator!= (const SkPoint3 &a, const SkPoint3 &b)
 
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)
 
SkPoint3 operator+ (const SkPoint3 &a, const SkPoint3 &b)
 Returns a new point whose coordinates are the sum of a and b (a + b)
 

Member Function Documentation

bool SkPoint3::normalize ( )

Set the point (vector) to be unit-length in the same direction as it already points.

If the point has a degenerate length (i.e., nearly 0) then set it to (0,0,0) and return false; otherwise return true.


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