Blender V2.61 - r43446

BKE_boids.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2009 by Janne Karhu.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00028 #ifndef BKE_BOIDS_H
00029 #define BKE_BOIDS_H
00030 
00037 #include "DNA_boid_types.h"
00038 
00039 typedef struct BoidBrainData {
00040     struct ParticleSimulationData *sim;
00041     struct ParticleSettings *part;
00042     float timestep, cfra, dfra;
00043     float wanted_co[3], wanted_speed;
00044 
00045     /* Goal stuff */
00046     struct Object *goal_ob;
00047     float goal_co[3];
00048     float goal_nor[3];
00049     float goal_priority;
00050 } BoidBrainData;
00051 
00052 void boids_precalc_rules(struct ParticleSettings *part, float cfra);
00053 void boid_brain(BoidBrainData *bbd, int p, struct ParticleData *pa);
00054 void boid_body(BoidBrainData *bbd, struct ParticleData *pa);
00055 void boid_default_settings(BoidSettings *boids);
00056 BoidRule *boid_new_rule(int type);
00057 BoidState *boid_new_state(BoidSettings *boids);
00058 BoidState *boid_duplicate_state(BoidSettings *boids, BoidState *state);
00059 void boid_free_settings(BoidSettings *boids);
00060 BoidSettings *boid_copy_settings(BoidSettings *boids);
00061 BoidState *boid_get_current_state(BoidSettings *boids);
00062 #endif