diff options
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 5fcfe404d82..e314d249e6d 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3613,8 +3613,6 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv bb.align = part->bb_align; bb.anim = part->bb_anim; bb.lock = part->draw & PART_DRAW_BB_LOCK; - bb.offset[0] = part->bb_offset[0]; - bb.offset[1] = part->bb_offset[1]; break; case PART_DRAW_PATH: break; @@ -3784,7 +3782,20 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* create actiual particle data */ if(draw_as == PART_DRAW_BB) { - bb.size = pa_size; + bb.offset[0] = part->bb_offset[0]; + bb.offset[1] = part->bb_offset[1]; + bb.size[0] = part->bb_size[0] * pa_size; + if (part->bb_align==PART_BB_VEL) { + float pa_vel = len_v3(state.vel); + float head = part->bb_vel_head*pa_vel; + float tail = part->bb_vel_tail*pa_vel; + bb.size[1] = part->bb_size[1]*pa_size + head + tail; + /* use offset to adjust the particle center. this is relative to size, so need to divide! */ + if (bb.size[1] > 0.0f) + bb.offset[1] += (head-tail) / bb.size[1]; + } + else + bb.size[1] = part->bb_size[1] * pa_size; bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt); bb.time = ct; } @@ -3804,7 +3815,20 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* create actiual particle data */ if(draw_as == PART_DRAW_BB) { - bb.size = pa_size; + bb.offset[0] = part->bb_offset[0]; + bb.offset[1] = part->bb_offset[1]; + bb.size[0] = part->bb_size[0] * pa_size; + if (part->bb_align==PART_BB_VEL) { + float pa_vel = len_v3(state.vel); + float head = part->bb_vel_head*pa_vel; + float tail = part->bb_vel_tail*pa_vel; + bb.size[1] = part->bb_size[1]*pa_size + head + tail; + /* use offset to adjust the particle center. this is relative to size, so need to divide! */ + if (bb.size[1] > 0.0f) + bb.offset[1] += (head-tail) / bb.size[1]; + } + else + bb.size[1] = part->bb_size[1] * pa_size; bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt); bb.time = pa_time; } |