Blender V5.3
GEO_xpbd_updater_velocity.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9namespace blender::xpbd {
10
15 private:
16 Span<GeometryRef> geometry_refs_;
17
18 public:
19 VelocityUpdater(const Span<GeometryRef> geometry_refs) : geometry_refs_(geometry_refs) {}
20
21 void update_velocity(const int geo_i, const int point_i, const float3 &offset)
22 {
23 geometry_refs_[geo_i].velocities[point_i] += offset;
24 }
25
26 void update_angular_velocity(const int geo_i, const int point_i, const float3 &offset)
27 {
28 geometry_refs_[geo_i].angular_velocities[point_i] += offset;
29 }
30};
31
32} // namespace blender::xpbd
VelocityUpdater(const Span< GeometryRef > geometry_refs)
void update_velocity(const int geo_i, const int point_i, const float3 &offset)
void update_angular_velocity(const int geo_i, const int point_i, const float3 &offset)
VecBase< float, 3 > float3