Blender  V2.93
BKE_boids.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 by Janne Karhu.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct BoidSettings;
31 struct BoidState;
32 struct Object;
33 struct ParticleData;
34 struct ParticleSettings;
36 struct RNG;
37 
38 typedef struct BoidBrainData {
41  float timestep, cfra, dfra;
43 
44  /* Goal stuff */
45  struct Object *goal_ob;
46  float goal_co[3];
47  float goal_nor[3];
49 
50  struct RNG *rng;
52 
53 void boids_precalc_rules(struct ParticleSettings *part, float cfra);
54 void boid_brain(BoidBrainData *bbd, int p, struct ParticleData *pa);
55 void boid_body(BoidBrainData *bbd, struct ParticleData *pa);
56 void boid_default_settings(struct BoidSettings *boids);
57 struct BoidRule *boid_new_rule(int type);
58 struct BoidState *boid_new_state(struct BoidSettings *boids);
59 struct BoidState *boid_duplicate_state(struct BoidSettings *boids, struct BoidState *state);
60 void boid_free_settings(struct BoidSettings *boids);
61 struct BoidSettings *boid_copy_settings(const struct BoidSettings *boids);
62 struct BoidState *boid_get_current_state(struct BoidSettings *boids);
63 
64 #ifdef __cplusplus
65 }
66 #endif
struct BoidState * boid_get_current_state(struct BoidSettings *boids)
Definition: boids.c:1739
struct BoidSettings * boid_copy_settings(const struct BoidSettings *boids)
struct BoidRule * boid_new_rule(int type)
Definition: boids.c:1603
void boid_brain(BoidBrainData *bbd, int p, struct ParticleData *pa)
Definition: boids.c:1079
void boid_body(BoidBrainData *bbd, struct ParticleData *pa)
Definition: boids.c:1235
void boid_default_settings(struct BoidSettings *boids)
Definition: boids.c:1643
struct BoidState * boid_new_state(struct BoidSettings *boids)
Definition: boids.c:1669
void boid_free_settings(struct BoidSettings *boids)
Definition: boids.c:1700
struct BoidState * boid_duplicate_state(struct BoidSettings *boids, struct BoidState *state)
Definition: boids.c:1688
struct BoidBrainData BoidBrainData
void boids_precalc_rules(struct ParticleSettings *part, float cfra)
Definition: boids.c:982
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
static ulong state[N]
float wanted_co[3]
Definition: BKE_boids.h:42
float cfra
Definition: BKE_boids.h:41
float dfra
Definition: BKE_boids.h:41
float goal_nor[3]
Definition: BKE_boids.h:47
struct ParticleSettings * part
Definition: BKE_boids.h:40
struct Object * goal_ob
Definition: BKE_boids.h:45
struct RNG * rng
Definition: BKE_boids.h:50
float timestep
Definition: BKE_boids.h:41
float wanted_speed
Definition: BKE_boids.h:42
float goal_priority
Definition: BKE_boids.h:48
struct ParticleSimulationData * sim
Definition: BKE_boids.h:39
float goal_co[3]
Definition: BKE_boids.h:46
Definition: rand.cc:48