Blender V4.3
DNA_boid_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 by Janne Karhu. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include "DNA_listBase.h"
12
13typedef enum eBoidRuleType {
31#if 0
33 eBoidRuleType_Protect = 9,
35 eBoidRuleType_Hide = 10,
37 eBoidRuleType_FollowPath = 11,
39 eBoidRuleType_FollowWall = 12,
40#endif
42
43/* boidrule->flag */
44enum {
48};
49typedef struct BoidRule {
50 struct BoidRule *next, *prev;
51 int type, flag;
52 char name[32];
54enum {
58};
59typedef struct BoidRuleGoalAvoid {
61 struct Object *ob;
64
65 /* signals */
68enum {
71};
77#define BRULE_LEADER_IN_LINE (1 << 0)
94
102
103typedef struct BoidData {
104 float health, acc[3];
107
108/* Planned for near future. */
109// typedef enum BoidConditionMode {
110// eBoidConditionType_Then = 0,
111// eBoidConditionType_And = 1,
112// eBoidConditionType_Or = 2,
113// NUM_BOID_CONDITION_MODES
114//} BoidConditionMode;
115// typedef enum BoidConditionType {
116// eBoidConditionType_None = 0,
117// eBoidConditionType_Signal = 1,
118// eBoidConditionType_NoSignal = 2,
119// eBoidConditionType_HealthBelow = 3,
120// eBoidConditionType_HealthAbove = 4,
121// eBoidConditionType_See = 5,
122// eBoidConditionType_NotSee = 6,
123// eBoidConditionType_StateTime = 7,
124// eBoidConditionType_Touching = 8,
125// NUM_BOID_CONDITION_TYPES
126//} BoidConditionType;
127// typedef struct BoidCondition {
128// struct BoidCondition *next, *prev;
129// int state_id;
130// short type, mode;
131// float threshold, probability;
132//
133// /* signals */
134// int signal_id, channels;
135//} BoidCondition;
136
142#define BOIDSTATE_CURRENT 1
143typedef struct BoidState {
144 struct BoidState *next, *prev;
148 char name[32];
149 int id, flag;
150
151 /* rules */
154
155 /* signal */
159
160/* Planned for near future. */
161// typedef struct BoidSignal {
162// struct BoidSignal *next, *prev;
163// float loc[3];
164// float volume, falloff;
165// int id;
166//} BoidSignal;
167// typedef struct BoidSignalDefine {
168// struct BoidSignalDefine *next, *prev;
169// int id, _pad[4];
170// char name[32];
171//} BoidSignalDefine;
172
173// typedef struct BoidSimulationData {
174// ListBase signal_defines;/* list of defined signals */
175// ListBase signals[20]; /* gathers signals from all channels */
176// struct KDTree_3d *signaltrees[20];
177// char channel_names[20][32];
178// int last_signal_id; /* used for incrementing signal ids */
179// int flag; /* switches for drawing stuff */
180//} BoidSimulationData;
181
204
206enum {
210};
211
212/* boidrule->options */
213// #define BOID_RULE_FOLLOW_LINE (1 << 0) /* follow leader */
214// #define BOID_RULE_PREDICT (1 << 1) /* goal/avoid */
215// #define BOID_RULE_ARRIVAL (1 << 2) /* goal */
216// #define BOID_RULE_LAND (1 << 3) /* goal */
217// #define BOID_RULE_WITH_BOIDS (1 << 4) /* avoid collision */
218// #define BOID_RULE_WITH_DEFLECTORS (1 << 5) /* avoid collision */
struct BoidRuleGoalAvoid BoidRuleGoalAvoid
@ BOIDRULE_CURRENT
@ BOIDRULE_IN_AIR
@ BOIDRULE_ON_LAND
eBoidMode
@ eBoidMode_OnLand
@ eBoidMode_Liftoff
@ eBoidMode_Climbing
@ eBoidMode_Falling
@ eBoidMode_InAir
struct BoidRuleFight BoidRuleFight
struct BoidRuleAvoidCollision BoidRuleAvoidCollision
struct BoidRuleAverageSpeed BoidRuleAverageSpeed
eBoidRulesetType
@ eBoidRulesetType_Average
@ eBoidRulesetType_Fuzzy
@ eBoidRulesetType_Random
struct BoidData BoidData
@ BOID_ALLOW_FLIGHT
@ BOID_ALLOW_LAND
@ BOID_ALLOW_CLIMB
struct BoidRule BoidRule
struct BoidSettings BoidSettings
struct BoidRuleFollowLeader BoidRuleFollowLeader
struct BoidState BoidState
@ BRULE_ACOLL_WITH_DEFLECTORS
@ BRULE_ACOLL_WITH_BOIDS
eBoidRuleType
@ eBoidRuleType_Flock
@ eBoidRuleType_Separate
@ eBoidRuleType_Goal
@ eBoidRuleType_None
@ eBoidRuleType_Fight
@ eBoidRuleType_Avoid
@ eBoidRuleType_FollowLeader
@ eBoidRuleType_AvoidCollision
@ eBoidRuleType_AverageSpeed
@ BRULE_GOAL_AVOID_PREDICT
@ BRULE_GOAL_AVOID_SIGNAL
@ BRULE_GOAL_AVOID_ARRIVE
These structs are the foundation for all linked lists in the library system.
float acc[3]
struct Object * ob
struct Object * ob
struct BoidRule * next
struct BoidRule * prev
struct ListBase states
float landing_smoothness
float air_personal_space
float land_personal_space
ListBase conditions
struct BoidState * prev
ListBase actions
float rule_fuzziness
ListBase rules
struct BoidState * next