[Bf-blender-cvs] [8801d58ce8d] soc-2021-adaptive-cloth: adaptive_cloth: AdaptiveMesh: extra data interp
ishbosamiya
noreply at git.blender.org
Mon Jul 26 08:17:39 CEST 2021
Commit: 8801d58ce8dcbf94579a407430c59f6a8d583dde
Author: ishbosamiya
Date: Mon Jul 19 21:59:13 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rB8801d58ce8dcbf94579a407430c59f6a8d583dde
adaptive_cloth: AdaptiveMesh: extra data interp
Add interp() function to the extra data of `AdaptiveMesh`
===================================================================
M source/blender/blenkernel/intern/cloth_remesh.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/cloth_remesh.cc b/source/blender/blenkernel/intern/cloth_remesh.cc
index 0b2d65f2f7b..01c0fccb1e7 100644
--- a/source/blender/blenkernel/intern/cloth_remesh.cc
+++ b/source/blender/blenkernel/intern/cloth_remesh.cc
@@ -35,6 +35,7 @@
#include "BKE_cloth.h"
#include "BKE_cloth_remesh.hh"
+#include <limits>
namespace blender::bke::internal {
class NodeData;
@@ -150,6 +151,11 @@ class Sizing {
return float2::dot(u_ij, m_avg * u_ij);
}
+
+ Sizing interp(const Sizing &other) const
+ {
+ return Sizing(this->m.linear_blend(other.get_m(), 0.5));
+ }
};
class VertData {
@@ -160,10 +166,6 @@ class VertData {
{
}
- VertData(Sizing &&sizing) : sizing(sizing)
- {
- }
-
const auto &get_sizing() const
{
return this->sizing;
@@ -173,6 +175,12 @@ class VertData {
{
this->sizing = sizing;
}
+
+ VertData interp(const VertData &other) const
+ {
+ VertData res(this->get_sizing().interp(other.get_sizing()));
+ return res;
+ }
};
class EdgeData {
@@ -193,6 +201,11 @@ class EdgeData {
{
this->size = size;
}
+
+ EdgeData interp(const EdgeData &UNUSED(other)) const
+ {
+ return EdgeData(std::numeric_limits<float>::signaling_NaN());
+ }
};
class AdaptiveMesh : public Mesh<NodeData, VertData, EdgeData, internal::EmptyExtraData> {
More information about the Bf-blender-cvs
mailing list