Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2010-09-17 00:06:10 +0400
committerJanne Karhu <jhkarh@gmail.com>2010-09-17 00:06:10 +0400
commite7a393d2e1a41d3332a1092a21bd8db1a5060cb6 (patch)
tree16433079ce7a259ee92e3f2ac6c82ec1ee70a186 /source/blender/blenkernel/intern/boids.c
parent43d2d0c6ea6c74319de455f7ef81b42c597d1e5c (diff)
Tiny addition to boids functionality: pitch value
* Controls maximum rotation around side vector (as opposed to banking, which controls rotation around forward vector)
Diffstat (limited to 'source/blender/blenkernel/intern/boids.c')
-rw-r--r--source/blender/blenkernel/intern/boids.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index 5bf228b2392..e408f73e6c8 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -1386,7 +1386,9 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* save direction to state.ave unless the boid is falling */
/* (boids can't effect their direction when falling) */
if(bpa->data.mode!=eBoidMode_Falling && len_v3(pa->state.vel) > 0.1*pa->size) {
- normalize_v3_v3(pa->state.ave, pa->state.vel);
+ copy_v3_v3(pa->state.ave, pa->state.vel);
+ pa->state.ave[2] *= bbd->part->boids->pitch;
+ normalize_v3(pa->state.ave);
}
/* apply damping */
@@ -1471,6 +1473,7 @@ void boid_default_settings(BoidSettings *boids)
boids->landing_smoothness = 3.0f;
boids->banking = 1.0f;
+ boids->pitch = 1.0f;
boids->height = 1.0f;
boids->health = 1.0f;