Fix for [#27112] Boid Particles get Z clamped to 0.0 when "Allow Flighting"
authorJanne Karhu <jhkarh@gmail.com>
Mon, 25 Apr 2011 12:26:33 +0000 (12:26 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Mon, 25 Apr 2011 12:26:33 +0000 (12:26 +0000)
* Boids that can only fly shouldn't care about ground unless there's actually a collision object below them.

source/blender/blenkernel/intern/boids.c

index 11ea3384c963212492797e95e9966e3a15b4e351..9f808704eeef0c712a26c1c9ba86810968dc5c95 100644 (file)
@@ -1299,7 +1299,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                                        bpa->data.mode = eBoidMode_OnLand;
                                }
                                /* fly above ground */
                                        bpa->data.mode = eBoidMode_OnLand;
                                }
                                /* fly above ground */
-                               else {
+                               else if(bpa->ground) {
                                        pa->state.co[2] = ground_co[2] + pa->size * boids->height;
                                        pa->state.vel[2] = 0.0f;
                                }
                                        pa->state.co[2] = ground_co[2] + pa->size * boids->height;
                                        pa->state.vel[2] = 0.0f;
                                }