2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2014-09-10 14:25:57 +02:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
2020-11-06 01:41:31 -05:00
|
|
|
* \ingroup sim
|
2015-05-20 12:54:45 +10:00
|
|
|
*/
|
|
|
|
|
|
2020-07-16 14:37:21 +02:00
|
|
|
#pragma once
|
2014-09-10 14:25:57 +02:00
|
|
|
|
2014-09-14 13:23:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct ClothModifierData;
|
2018-06-22 14:42:03 +02:00
|
|
|
struct Depsgraph;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Implicit_Data;
|
|
|
|
|
struct ListBase;
|
|
|
|
|
struct Object;
|
2014-09-13 18:45:58 +02:00
|
|
|
|
2014-09-20 21:05:46 +02:00
|
|
|
typedef enum eMassSpringSolverStatus {
|
2020-07-16 14:37:21 +02:00
|
|
|
SIM_SOLVER_SUCCESS = (1 << 0),
|
|
|
|
|
SIM_SOLVER_NUMERICAL_ISSUE = (1 << 1),
|
|
|
|
|
SIM_SOLVER_NO_CONVERGENCE = (1 << 2),
|
|
|
|
|
SIM_SOLVER_INVALID_INPUT = (1 << 3),
|
2014-09-20 21:05:46 +02:00
|
|
|
} eMassSpringSolverStatus;
|
|
|
|
|
|
2020-07-16 14:37:21 +02:00
|
|
|
struct Implicit_Data *SIM_mass_spring_solver_create(int numverts, int numsprings);
|
|
|
|
|
void SIM_mass_spring_solver_free(struct Implicit_Data *id);
|
|
|
|
|
int SIM_mass_spring_solver_numvert(struct Implicit_Data *id);
|
2014-09-13 18:45:58 +02:00
|
|
|
|
2020-07-16 14:37:21 +02:00
|
|
|
int SIM_cloth_solver_init(struct Object *ob, struct ClothModifierData *clmd);
|
2021-07-15 15:58:34 +02:00
|
|
|
void SIM_mass_spring_set_implicit_vertex_mass(struct Implicit_Data *data, int index, float mass);
|
|
|
|
|
|
2020-07-16 14:37:21 +02:00
|
|
|
void SIM_cloth_solver_free(struct ClothModifierData *clmd);
|
|
|
|
|
int SIM_cloth_solve(struct Depsgraph *depsgraph,
|
2018-06-22 14:42:03 +02:00
|
|
|
struct Object *ob,
|
|
|
|
|
float frame,
|
|
|
|
|
struct ClothModifierData *clmd,
|
|
|
|
|
struct ListBase *effectors);
|
2020-07-16 14:37:21 +02:00
|
|
|
void SIM_cloth_solver_set_positions(struct ClothModifierData *clmd);
|
2020-12-15 10:47:58 +11:00
|
|
|
void SIM_cloth_solver_set_volume(struct ClothModifierData *clmd);
|
2014-09-11 17:49:26 +02:00
|
|
|
|
2014-09-14 13:23:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|