Skia
2D Graphics Library
SkPoint3 Struct Reference

#include <SkPoint3.h>

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. More...
 
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. More...
 
void scale (SkScalar value)
 Scale the point's coordinates by scale. More...
 
SkPoint3 operator- () const
 Return a new point whose X, Y and Z coordinates are the negative of the original point's. More...
 
void operator+= (const SkPoint3 &v)
 Add v's coordinates to the point's. More...
 
void operator-= (const SkPoint3 &v)
 Subtract v's coordinates from the point's. More...
 
bool isFinite () const
 Returns true if fX, fY, and fZ are measurable values. More...
 
SkScalar dot (const SkPoint3 &vec) const
 
SkPoint3 cross (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) More...
 
static SkScalar DotProduct (const SkPoint3 &a, const SkPoint3 &b)
 Returns the dot product of a and b, treating them as 3D vectors. More...
 
static SkPoint3 CrossProduct (const SkPoint3 &a, const SkPoint3 &b)
 Returns the cross product of a and b, treating them as 3D vectors. More...
 

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) More...
 
SkPoint3 operator+ (const SkPoint3 &a, const SkPoint3 &b)
 Returns a new point whose coordinates are the sum of a and b (a + b) More...
 
SkPoint3 operator* (SkScalar t, SkPoint3 p)
 

Member Function Documentation

◆ cross()

SkPoint3 SkPoint3::cross ( const SkPoint3 vec) const
inline

◆ CrossProduct()

static SkPoint3 SkPoint3::CrossProduct ( const SkPoint3 a,
const SkPoint3 b 
)
inlinestatic

Returns the cross product of a and b, treating them as 3D vectors.

◆ dot()

SkScalar SkPoint3::dot ( const SkPoint3 vec) const
inline

◆ DotProduct()

static SkScalar SkPoint3::DotProduct ( const SkPoint3 a,
const SkPoint3 b 
)
inlinestatic

Returns the dot product of a and b, treating them as 3D vectors.

◆ isFinite()

bool SkPoint3::isFinite ( ) const
inline

Returns true if fX, fY, and fZ are measurable values.

Returns
true for values other than infinities and NaN

◆ length()

SkScalar SkPoint3::length ( ) const
inline

Return the Euclidian distance from (0,0,0) to the point.

◆ Length()

static SkScalar SkPoint3::Length ( SkScalar  x,
SkScalar  y,
SkScalar  z 
)
static

Returns the Euclidian distance from (0,0,0) to (x,y,z)

◆ Make()

static SkPoint3 SkPoint3::Make ( SkScalar  x,
SkScalar  y,
SkScalar  z 
)
inlinestatic

◆ makeScale()

SkPoint3 SkPoint3::makeScale ( SkScalar  scale) const
inline

Return a new point whose X, Y and Z coordinates are scaled.

◆ normalize()

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.

◆ operator+=()

void SkPoint3::operator+= ( const SkPoint3 v)
inline

Add v's coordinates to the point's.

◆ operator-()

SkPoint3 SkPoint3::operator- ( ) const
inline

Return a new point whose X, Y and Z coordinates are the negative of the original point's.

◆ operator-=()

void SkPoint3::operator-= ( const SkPoint3 v)
inline

Subtract v's coordinates from the point's.

◆ scale()

void SkPoint3::scale ( SkScalar  value)
inline

Scale the point's coordinates by scale.

◆ set()

void SkPoint3::set ( SkScalar  x,
SkScalar  y,
SkScalar  z 
)
inline

◆ x()

SkScalar SkPoint3::x ( ) const
inline

◆ y()

SkScalar SkPoint3::y ( ) const
inline

◆ z()

SkScalar SkPoint3::z ( ) const
inline

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const SkPoint3 a,
const SkPoint3 b 
)
friend

◆ operator*

SkPoint3 operator* ( SkScalar  t,
SkPoint3  p 
)
friend

◆ operator+

SkPoint3 operator+ ( const SkPoint3 a,
const SkPoint3 b 
)
friend

Returns a new point whose coordinates are the sum of a and b (a + b)

◆ operator-

SkPoint3 operator- ( const SkPoint3 a,
const SkPoint3 b 
)
friend

Returns a new point whose coordinates are the difference between a and b (i.e., a - b)

◆ operator==

bool operator== ( const SkPoint3 a,
const SkPoint3 b 
)
friend

Member Data Documentation

◆ fX

SkScalar SkPoint3::fX

◆ fY

SkScalar SkPoint3::fY

◆ fZ

SkScalar SkPoint3::fZ

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