Blender V2.61 - r43446
|
#include "DNA_boid_types.h"
Go to the source code of this file.
Classes | |
struct | BoidBrainData |
Typedefs | |
typedef struct BoidBrainData | BoidBrainData |
Functions | |
void | boids_precalc_rules (struct ParticleSettings *part, float cfra) |
void | boid_brain (BoidBrainData *bbd, int p, struct ParticleData *pa) |
void | boid_body (BoidBrainData *bbd, struct ParticleData *pa) |
void | boid_default_settings (BoidSettings *boids) |
BoidRule * | boid_new_rule (int type) |
BoidState * | boid_new_state (BoidSettings *boids) |
BoidState * | boid_duplicate_state (BoidSettings *boids, BoidState *state) |
void | boid_free_settings (BoidSettings *boids) |
BoidSettings * | boid_copy_settings (BoidSettings *boids) |
BoidState * | boid_get_current_state (BoidSettings *boids) |
Definition in file BKE_boids.h.
typedef struct BoidBrainData BoidBrainData |
void boid_body | ( | BoidBrainData * | bbd, |
struct ParticleData * | pa | ||
) |
* gather apparent gravity to r_ve */
* raise boid it's size from surface */
* remove normal component from velocity */
Definition at line 1081 of file boids.c.
References BoidData::acc, add_v3_v3(), angle(), ParticleKey::ave, axis_angle_to_quat(), BoidSettings::banking, BLI_frand(), ParticleData::boid, BOID_ALLOW_FLIGHT, BOID_ALLOW_LAND, boid_climb(), boid_find_ground(), boid_goal_signed_dist(), ParticleSettings::boids, ParticleKey::co, ParticleSimulationData::colliders, copy_particle_key(), copy_qt_qt(), copy_v2_v2(), copy_v3_v3(), cross_v3_v3v3(), ParticleSettings::dampfac, BoidParticle::data, BoidBrainData::dfra, dot_v2v2(), dot_v3v3(), eBoidMode_Climbing, eBoidMode_Falling, eBoidMode_InAir, eBoidMode_Liftoff, eBoidMode_OnLand, ParticleSettings::effector_weights, ParticleSystem::effectors, ELEM, ParticleSettings::flag, BoidBrainData::goal_co, BoidBrainData::goal_nor, BoidBrainData::goal_ob, PhysicsSettings::gravity, BoidParticle::gravity, BoidParticle::ground, BoidSettings::height, BoidSettings::land_stick_force, BoidSettings::landing_smoothness, len_v3(), length(), madd_v3_v3fl(), madd_v3_v3v3fl(), ParticleSettings::mass, mat3_to_quat_is_ok(), MAX2, BoidValues::max_acc, BoidValues::max_ave, BoidValues::max_speed, MIN2, BoidValues::min_speed, BoidData::mode, mul_qt_v3(), mul_v2_fl(), mul_v3_fl(), negate_v3(), negate_v3_v3(), normalize_v2(), normalize_v3(), normalize_v3_v3(), NULL, BoidSettings::options, BoidBrainData::part, PART_SIZEMASS, pd_point_from_particle(), pdDoEffectors(), Scene::physics_settings, BoidSettings::pitch, ParticleData::prev_state, project_v3_v3v3(), ParticleSimulationData::psys, psys_uses_gravity(), MakeCursor::root, ParticleKey::rot, saacos(), sasqrt(), ParticleSimulationData::scene, set_boid_values(), BoidBrainData::sim, ParticleData::size, ParticleData::state, sub_v3_v3v3(), BoidBrainData::timestep, simple_enum_gen::val, ParticleKey::vel, BoidBrainData::wanted_co, and BoidBrainData::wanted_speed.
Referenced by dynamics_step().
void boid_brain | ( | BoidBrainData * | bbd, |
int | p, | ||
struct ParticleData * | pa | ||
) |
Definition at line 930 of file boids.c.
References add_v2_v2v2(), add_v3_v3(), ParticleData::alive, apply_boid_rule(), ParticleKey::ave, BLI_countlist(), BLI_findlink(), ParticleData::boid, BOID_ALLOW_FLIGHT, ParticleSettings::boids, BoidBrainData::cfra, copy_v3_v3(), BoidParticle::data, ParticleData::dietime, dot_v2v2(), eBoidMode_Falling, eBoidMode_Liftoff, eBoidMode_OnLand, eBoidRulesetType_Average, eBoidRulesetType_Fuzzy, eBoidRulesetType_Random, ListBase::first, get_boid_state(), PhysicsSettings::gravity, BoidData::health, BoidValues::jump_speed, len(), len_v2(), BoidValues::max_speed, MIN2, BoidData::mode, mul(), mul_v3_fl(), BoidRule::next, normalize_v2(), normalize_v3(), BoidSettings::options, PARS_DYING, BoidBrainData::part, Scene::physics_settings, ParticleData::prev_state, ParticleSimulationData::psys, PSYS_FRAND, BoidState::rule_fuzziness, BoidState::rules, BoidState::ruleset_type, sasqrt(), ParticleSimulationData::scene, ParticleSystem::seed, set_boid_values(), BoidBrainData::sim, state, simple_enum_gen::val, ParticleKey::vel, BoidBrainData::wanted_co, and BoidBrainData::wanted_speed.
Referenced by dynamics_step().
BoidSettings* boid_copy_settings | ( | BoidSettings * | boids | ) |
Definition at line 1545 of file boids.c.
References BoidState::actions, BLI_duplicatelist(), BoidState::conditions, ListBase::first, MEM_dupallocN(), BoidState::next, NULL, BoidState::rules, state, and BoidSettings::states.
Referenced by psys_copy_settings().
void boid_default_settings | ( | BoidSettings * | boids | ) |
Definition at line 1474 of file boids.c.
References BoidSettings::accuracy, BoidSettings::aggression, BoidSettings::air_max_acc, BoidSettings::air_max_ave, BoidSettings::air_max_speed, BoidSettings::air_personal_space, BoidSettings::banking, BOID_ALLOW_FLIGHT, BoidSettings::health, BoidSettings::height, BoidSettings::land_max_acc, BoidSettings::land_max_ave, BoidSettings::land_max_speed, BoidSettings::land_personal_space, BoidSettings::landing_smoothness, BoidSettings::options, BoidSettings::pitch, BoidSettings::range, and BoidSettings::strength.
Referenced by psys_prepare_physics().
BoidState* boid_duplicate_state | ( | BoidSettings * | boids, |
BoidState * | state | ||
) |
Definition at line 1517 of file boids.c.
References BoidState::actions, BLI_duplicatelist(), BoidState::conditions, BoidState::id, BoidSettings::last_state_id, MEM_dupallocN(), and BoidState::rules.
void boid_free_settings | ( | BoidSettings * | boids | ) |
Definition at line 1529 of file boids.c.
References BoidState::actions, BLI_freelistN(), BoidState::conditions, ListBase::first, MEM_freeN(), BoidState::next, BoidState::rules, state, and BoidSettings::states.
Referenced by psys_free_settings().
BoidState* boid_get_current_state | ( | BoidSettings * | boids | ) |
Definition at line 1568 of file boids.c.
References BOIDSTATE_CURRENT, ListBase::first, BoidState::flag, BoidState::next, state, and BoidSettings::states.
Referenced by rule_add_exec(), rule_del_exec(), rule_move_down_exec(), and rule_move_up_exec().
BoidRule* boid_new_rule | ( | int | type | ) |
Definition at line 1435 of file boids.c.
References BLI_strncpy(), BOIDRULE_IN_AIR, BOIDRULE_ON_LAND, boidrule_type_items, eBoidRuleType_AverageSpeed, eBoidRuleType_Avoid, eBoidRuleType_AvoidCollision, eBoidRuleType_Fight, eBoidRuleType_FollowLeader, eBoidRuleType_Goal, BoidRule::flag, MEM_callocN(), BoidRule::name, EnumPropertyItem::name, NULL, and BoidRule::type.
Referenced by psys_prepare_physics(), and rule_add_exec().
BoidState* boid_new_state | ( | BoidSettings * | boids | ) |
Definition at line 1500 of file boids.c.
References BLI_snprintf(), BoidState::channels, BoidState::id, BoidSettings::last_state_id, MEM_callocN(), BoidState::name, BoidState::rule_fuzziness, state, and BoidState::volume.
Referenced by psys_prepare_physics(), state_add_exec(), and state_del_exec().
void boids_precalc_rules | ( | struct ParticleSettings * | part, |
float | cfra | ||
) |
Definition at line 845 of file boids.c.
References ParticleSettings::boids, BoidRuleFollowLeader::cfra, copy_v3_v3(), eBoidRuleType_FollowLeader, ListBase::first, BoidRuleFollowLeader::loc, BoidState::next, BoidRule::next, BoidRuleFollowLeader::ob, Object::obmat, BoidRuleFollowLeader::oloc, BoidState::rules, state, BoidSettings::states, and BoidRule::type.
Referenced by dynamics_step().