diff options
author | Hans Goudey <h.goudey@me.com> | 2021-04-05 07:09:20 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-04-05 07:09:20 +0300 |
commit | 073bf63a9dbe69a3f2a6c8899832ade978d7cfc5 (patch) | |
tree | adf4d3041fe9415135908be5e4e6d78c2a018ae5 /source/blender/blenlib | |
parent | f91df2e3e3c0917a86a1efee6e82454c1e0a80a0 (diff) |
Geometry Nodes Curves: Cleanup, progres on evaluation for bezier splines
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_float3.hh | 7 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_span.hh | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_float3.hh b/source/blender/blenlib/BLI_float3.hh index cbc4d4ed366..04aae375889 100644 --- a/source/blender/blenlib/BLI_float3.hh +++ b/source/blender/blenlib/BLI_float3.hh @@ -245,6 +245,13 @@ struct float3 { return result; } + static float3 cross(const float3 &a, const float3 &b) + { + float3 result; + cross_v3_v3v3(result, a, b); + return result; + } + static float3 project(const float3 &a, const float3 &b) { float3 result; diff --git a/source/blender/blenlib/BLI_span.hh b/source/blender/blenlib/BLI_span.hh index fe511793c46..bcf6873f9eb 100644 --- a/source/blender/blenlib/BLI_span.hh +++ b/source/blender/blenlib/BLI_span.hh @@ -662,6 +662,16 @@ template<typename T> class MutableSpan { } /** + * Return a reference to the first element in the array. This invokes undefined behavior when the + * array is empty. + */ + constexpr T &first() const + { + BLI_assert(size_ > 0); + return data_[0]; + } + + /** * Returns a reference to the last element. This invokes undefined behavior when the array is * empty. */ |