diff options
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 41da2c5a85b..0f498810fb5 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -40,6 +40,7 @@ #include "MTC_matrixops.h" #include "DNA_armature_types.h" +#include "DNA_boid_types.h" #include "DNA_camera_types.h" #include "DNA_curve_types.h" #include "DNA_constraint_types.h" // for drawing constraint @@ -3136,7 +3137,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv Material *ma; float vel[3], imat[4][4]; float timestep, pixsize=1.0, pa_size, r_tilt, r_length; - float pa_time, pa_birthtime, pa_dietime; + float pa_time, pa_birthtime, pa_dietime, pa_health; float cfra= bsystem_time(scene, ob,(float)CFRA,0.0); float ma_r=0.0f, ma_g=0.0f, ma_b=0.0f; int a, totpart, totpoint=0, totve=0, drawn, draw_as, totchild=0; @@ -3362,6 +3363,10 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pa_birthtime=pa->time; pa_dietime = pa->dietime; pa_size=pa->size; + if(part->phystype==PART_PHYS_BOIDS) + pa_health = pa->boid->health; + else + pa_health = -1.0; #if 0 // XXX old animation system if((part->flag&PART_ABS_TIME)==0){ @@ -3424,6 +3429,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pa_size=psys_get_child_size(psys,cpa,cfra,0); + pa_health = -1.0; + r_tilt = 2.0f * cpa->rand[2]; r_length = cpa->rand[1]; } @@ -3506,9 +3513,19 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv setlinestyle(0); } - if(part->draw&PART_DRAW_NUM && !(G.f & G_RENDER_SHADOW)){ + if((part->draw&PART_DRAW_NUM || part->draw&PART_DRAW_HEALTH) && !(G.f & G_RENDER_SHADOW)){ + strcpy(val, ""); + + if(part->draw&PART_DRAW_NUM) + sprintf(val, " %i", a); + + if(part->draw&PART_DRAW_NUM && part->draw&PART_DRAW_HEALTH) + sprintf(val, "%s:", val); + + if(part->draw&PART_DRAW_HEALTH && a < totpart && part->phystype==PART_PHYS_BOIDS) + sprintf(val, "%s %.2f", val, pa_health); + /* in path drawing state.co is the end point */ - sprintf(val," %i",a); view3d_particle_text_draw_add(state.co[0], state.co[1], state.co[2], val, 0); } } |