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 */
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2004-10-01 14:10:30 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup bke
|
2011-02-18 13:05:18 +00:00
|
|
|
*/
|
|
|
|
|
|
2018-04-06 12:07:27 +02:00
|
|
|
struct Depsgraph;
|
2005-04-02 13:57:23 +00:00
|
|
|
struct Object;
|
2009-01-04 14:14:06 +00:00
|
|
|
struct Scene;
|
2005-04-02 13:57:23 +00:00
|
|
|
struct SoftBody;
|
2004-10-01 14:10:30 +00:00
|
|
|
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
typedef struct BodyPoint {
|
|
|
|
|
float origS[3], origE[3], origT[3], pos[3], vec[3], force[3];
|
|
|
|
|
float goal;
|
|
|
|
|
float prevpos[3], prevvec[3], prevdx[3], prevdv[3]; /* used for Heun integration */
|
2012-04-29 15:47:02 +00:00
|
|
|
float impdv[3], impdx[3];
|
2010-03-22 09:30:00 +00:00
|
|
|
int nofsprings;
|
|
|
|
|
int *springs;
|
2012-04-29 15:47:02 +00:00
|
|
|
float choke, choke2, frozen;
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
float colball;
|
2019-05-01 11:09:22 +10:00
|
|
|
short loc_flag; /* reserved by locale module specific states */
|
|
|
|
|
// char octantflag;
|
2009-06-24 23:42:45 +00:00
|
|
|
float mass;
|
|
|
|
|
float springweight;
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
} BodyPoint;
|
|
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
|
* Allocates and initializes general main data.
|
|
|
|
|
*/
|
2021-05-11 15:59:55 +10:00
|
|
|
extern struct SoftBody *sbNew(void);
|
2004-10-01 14:10:30 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
|
* Frees internal data and soft-body itself.
|
|
|
|
|
*/
|
2018-07-04 11:21:31 +02:00
|
|
|
extern void sbFree(struct Object *ob);
|
2004-10-01 14:10:30 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
|
* Frees simulation data to reset simulation.
|
|
|
|
|
*/
|
2012-05-12 20:39:39 +00:00
|
|
|
extern void sbFreeSimulation(struct SoftBody *sb);
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
|
* Do one simulation step, reading and writing vertex locs from given array.
|
2024-01-11 16:46:46 +11:00
|
|
|
*/
|
2018-04-06 12:07:27 +02:00
|
|
|
extern void sbObjectStep(struct Depsgraph *depsgraph,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
2020-09-04 20:59:13 +02:00
|
|
|
float cfra,
|
2017-04-21 14:28:23 +02:00
|
|
|
float (*vertexCos)[3],
|
|
|
|
|
int numVerts);
|
2004-10-01 14:10:30 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
|
* Makes totally fresh start situation, resets time.
|
|
|
|
|
*/
|
2012-05-12 20:39:39 +00:00
|
|
|
extern void sbObjectToSoftbody(struct Object *ob);
|
2004-10-01 14:10:30 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
|
* Soft-body global visible functions.
|
|
|
|
|
* Links the soft-body module to a 'test for Interrupt' function, pass NULL to clear the callback.
|
|
|
|
|
*/
|
2006-11-20 22:27:05 +00:00
|
|
|
extern void sbSetInterruptCallBack(int (*f)(void));
|
2009-11-21 22:45:25 +00:00
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
|
* A precise position vector denoting the motion of the center of mass give a rotation/scale matrix
|
|
|
|
|
* using averaging method, that's why estimate and not calculate see: this is kind of reverse
|
|
|
|
|
* engineering: having to states of a point cloud and recover what happened our advantage here we
|
|
|
|
|
* know the identity of the vertex there are others methods giving other results.
|
|
|
|
|
*
|
|
|
|
|
* \param ob: Any object that can do soft-body e.g. mesh, lattice, curve.
|
|
|
|
|
* \param lloc: Output of the calculated location (or NULL).
|
|
|
|
|
* \param lrot: Output of the calculated rotation (or NULL).
|
|
|
|
|
* \param lscale: Output for the calculated scale (or NULL).
|
|
|
|
|
*
|
|
|
|
|
* For velocity & 2nd order stuff see: #vcloud_estimate_transform_v3.
|
|
|
|
|
*/
|
2016-12-28 17:30:58 +01:00
|
|
|
extern void SB_estimate_transform(Object *ob, float lloc[3], float lrot[3][3], float lscale[3][3]);
|