Correctly set track Z positions when snapped
Eliminate a glitch with new tracks
float dt = (t-last_tick)/Msp::Time::sec;
last_tick = t;
- for(list<Track *>::iterator i=new_tracks.begin(); i!=new_tracks.end(); ++i)
- layout_3d->get_track(**i).get_path().set_mask(0);
- new_tracks.clear();
-
window.get_display().tick();
root->tick();
camera_ctl.tick(dt);
+ for(list<Track *>::iterator i=new_tracks.begin(); i!=new_tracks.end(); ++i)
+ layout_3d->get_track(**i).get_path().set_mask(0);
+ new_tracks.clear();
+
render();
window.swap_buffers();
continue;
Point dp(i->pos.x-snapped->pos.x, i->pos.y-snapped->pos.y, 0);
- i->track->set_position(Point(sp.x+c*dp.x-s*dp.y, sp.y+s*dp.x+c*dp.y, sp.z));
+ i->track->set_position(Point(sp.x+c*dp.x-s*dp.y, sp.y+s*dp.x+c*dp.y, sp.z+i->pos.z-snapped->pos.z));
i->track->set_rotation(i->rot+da);
}
}
Point epp2 = other.get_endpoint_position(j);
float dx = epp2.x-epp.x;
float dy = epp2.y-epp.y;
- if(dx*dx+dy*dy<limit)
+ float dz = epp2.z-epp.z;
+ if(dx*dx+dy*dy<limit && dz*dz<4e-4)
{
if(!link || (!flex && !other.get_flex()))
{