| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkPoint3_DEFINED | 8 #ifndef SkPoint3_DEFINED |
| 9 #define SkPoint3_DEFINED | 9 #define SkPoint3_DEFINED |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 /** Return the Euclidian distance from (0,0,0) to the point | 40 /** Return the Euclidian distance from (0,0,0) to the point |
| 41 */ | 41 */ |
| 42 SkScalar length() const { return SkPoint3::Length(fX, fY, fZ); } | 42 SkScalar length() const { return SkPoint3::Length(fX, fY, fZ); } |
| 43 | 43 |
| 44 /** Set the point (vector) to be unit-length in the same direction as it | 44 /** Set the point (vector) to be unit-length in the same direction as it |
| 45 already points. If the point has a degenerate length (i.e., nearly 0) | 45 already points. If the point has a degenerate length (i.e., nearly 0) |
| 46 then set it to (0,0,0) and return false; otherwise return true. | 46 then set it to (0,0,0) and return false; otherwise return true. |
| 47 */ | 47 */ |
| 48 bool normalize(); | 48 bool normalize(); |
| 49 | 49 |
| 50 SkPoint3 makeDenormalsZero() const; |
| 51 |
| 50 /** Return a new point whose X, Y and Z coordinates are scaled. | 52 /** Return a new point whose X, Y and Z coordinates are scaled. |
| 51 */ | 53 */ |
| 52 SkPoint3 makeScale(SkScalar scale) const { | 54 SkPoint3 makeScale(SkScalar scale) const { |
| 53 SkPoint3 p; | 55 SkPoint3 p; |
| 54 p.set(scale * fX, scale * fY, scale * fZ); | 56 p.set(scale * fX, scale * fY, scale * fZ); |
| 55 return p; | 57 return p; |
| 56 } | 58 } |
| 57 | 59 |
| 58 /** Scale the point's coordinates by scale. | 60 /** Scale the point's coordinates by scale. |
| 59 */ | 61 */ |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 117 |
| 116 SkScalar dot(const SkPoint3& vec) const { | 118 SkScalar dot(const SkPoint3& vec) const { |
| 117 return DotProduct(*this, vec); | 119 return DotProduct(*this, vec); |
| 118 } | 120 } |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 typedef SkPoint3 SkVector3; | 123 typedef SkPoint3 SkVector3; |
| 122 typedef SkPoint3 SkColor3f; | 124 typedef SkPoint3 SkColor3f; |
| 123 | 125 |
| 124 #endif | 126 #endif |
| OLD | NEW |