- for(unsigned j=0; j<other_eps.size(); ++j)
- {
- if(other.get_link(j))
- continue;
-
- Vector epp2 = other.get_endpoint_position(j);
- float dx = epp2.x-epp.x;
- float dy = epp2.y-epp.y;
- float dz = epp2.z-epp.z;
- if(dx*dx+dy*dy<limit && dz*dz<limit)
- {
- if(!link || (!flex && !other.get_flex()))
- {
- set_rotation(other.rot+other_eps[j].dir-eps[i].dir+M_PI);
- Vector p(epp2.x-(eps[i].pos.x*cos(rot)-eps[i].pos.y*sin(rot)),
- epp2.y-(eps[i].pos.y*cos(rot)+eps[i].pos.x*sin(rot)),
- epp2.z);
- if(eps.size()==2 && i==1)
- p.z -= slope;
- set_position(p);
- }
-
- if(link)
- {
- if(links[i])
- break_link(*links[i]);
- links[i] = &other;
- other.links[j] = this;
- layout.create_blocks(*this);
-
- signal_link_changed.emit(i, &other);
- other.signal_link_changed.emit(j, this);
- }
+ result.position = position+rotated_vector(ep.pos, rotation);
+ if(eps.size()==2 && i==1)
+ result.position.z += slope;