2011-02-18 13:58:08 +00:00
|
|
|
/*
|
2008-01-07 19:13:47 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-01-07 19:13:47 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +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
|
|
|
* Contributor(s): Janne Karhu
|
|
|
|
* Brecht Van Lommel
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
2008-01-07 19:13:47 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +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
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BLI_KDTREE_H__
|
|
|
|
#define __BLI_KDTREE_H__
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2011-02-18 13:58:08 +00:00
|
|
|
/** \file BLI_kdtree.h
|
|
|
|
* \ingroup bli
|
2012-03-01 12:20:18 +00:00
|
|
|
* \brief A kd-tree for nearest neighbor search.
|
2011-02-18 13:58:08 +00:00
|
|
|
* \author Janne Karhu
|
|
|
|
* \author Brecht van Lommel
|
|
|
|
*/
|
|
|
|
|
2013-09-01 20:17:56 +00:00
|
|
|
#include "BLI_compiler_attrs.h"
|
|
|
|
|
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
|
|
|
struct KDTree;
|
|
|
|
typedef struct KDTree KDTree;
|
2002-10-12 11:37:38 +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 KDTreeNearest {
|
|
|
|
int index;
|
|
|
|
float dist;
|
|
|
|
float co[3];
|
|
|
|
} KDTreeNearest;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2013-09-01 20:17:56 +00:00
|
|
|
KDTree *BLI_kdtree_new(unsigned int maxsize);
|
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
|
|
|
void BLI_kdtree_free(KDTree *tree);
|
2013-09-01 20:17:56 +00:00
|
|
|
void BLI_kdtree_balance(KDTree *tree) ATTR_NONNULL(1);
|
|
|
|
|
2014-03-18 09:05:07 +11:00
|
|
|
void BLI_kdtree_insert(
|
|
|
|
KDTree *tree, int index,
|
|
|
|
const float co[3]) ATTR_NONNULL(1, 3);
|
|
|
|
int BLI_kdtree_find_nearest(
|
2015-11-17 16:39:29 +11:00
|
|
|
const KDTree *tree, const float co[3],
|
2014-03-18 09:05:07 +11:00
|
|
|
KDTreeNearest *r_nearest) ATTR_NONNULL(1, 2);
|
|
|
|
|
|
|
|
#define BLI_kdtree_find_nearest_n(tree, co, r_nearest, n) \
|
|
|
|
BLI_kdtree_find_nearest_n__normal(tree, co, NULL, r_nearest, n)
|
|
|
|
#define BLI_kdtree_range_search(tree, co, r_nearest, range) \
|
|
|
|
BLI_kdtree_range_search__normal(tree, co, NULL, r_nearest, range)
|
|
|
|
|
2015-12-06 21:29:06 +11:00
|
|
|
int BLI_kdtree_find_nearest_cb(
|
|
|
|
const KDTree *tree, const float co[3],
|
|
|
|
int (*filter_cb)(void *user_data, int index, const float co[3], float dist_sq), void *user_data,
|
|
|
|
KDTreeNearest *r_nearest);
|
2015-11-18 09:01:55 +11:00
|
|
|
void BLI_kdtree_range_search_cb(
|
|
|
|
const KDTree *tree, const float co[3], float range,
|
|
|
|
bool (*search_cb)(void *user_data, int index, const float co[3], float dist_sq), void *user_data);
|
|
|
|
|
2014-03-18 09:05:07 +11:00
|
|
|
/* Normal use is deprecated */
|
|
|
|
/* remove __normal functions when last users drop */
|
|
|
|
int BLI_kdtree_find_nearest_n__normal(
|
2015-11-17 16:39:29 +11:00
|
|
|
const KDTree *tree, const float co[3], const float nor[3],
|
2014-03-18 09:05:07 +11:00
|
|
|
KDTreeNearest *r_nearest,
|
|
|
|
unsigned int n) ATTR_NONNULL(1, 2, 4);
|
|
|
|
int BLI_kdtree_range_search__normal(
|
2015-11-17 16:39:29 +11:00
|
|
|
const KDTree *tree, const float co[3], const float nor[3],
|
2014-03-18 09:05:07 +11:00
|
|
|
KDTreeNearest **r_nearest,
|
|
|
|
float range) ATTR_NONNULL(1, 2, 4) ATTR_WARN_UNUSED_RESULT;
|
2013-09-01 20:17:56 +00:00
|
|
|
|
|
|
|
#endif /* __BLI_KDTREE_H__ */
|