From e7a393d2e1a41d3332a1092a21bd8db1a5060cb6 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Thu, 16 Sep 2010 20:06:10 +0000 Subject: Tiny addition to boids functionality: pitch value * Controls maximum rotation around side vector (as opposed to banking, which controls rotation around forward vector) --- source/blender/blenkernel/intern/boids.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/boids.c') 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; -- cgit v1.2.3