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