void merge(BindingGroup<T> bg, Matrix m, float epsilon) {
if (bg==this) {
if (m.equalsModuloEpsilon(Matrix.ONE, epsilon)) return;
void merge(BindingGroup<T> bg, Matrix m, float epsilon) {
if (bg==this) {
if (m.equalsModuloEpsilon(Matrix.ONE, epsilon)) return;
// FIXME: what if points do not fall on the merged constraint-line?
constraint = constraint.intersect(m.getAffineConstraint(epsilon), epsilon);
return;
}
// FIXME: what if points do not fall on the merged constraint-line?
constraint = constraint.intersect(m.getAffineConstraint(epsilon), epsilon);
return;
}
for(HasBindingGroup hbg : bg) {
matrices.put((T)hbg, bg.getMatrix((T)hbg).times(m));
hbg.bindingGroup = this;
for(HasBindingGroup hbg : bg) {
matrices.put((T)hbg, bg.getMatrix((T)hbg).times(m));
hbg.bindingGroup = this;
public Iterator<T> iterator() { return matrices.keySet().iterator(); }
/** t1 = getMatrix(t1, t2) * t2 */
public Iterator<T> iterator() { return matrices.keySet().iterator(); }
/** t1 = getMatrix(t1, t2) * t2 */
// t1 = getMatrix(t1) * master
// getMatrix(t2)^-1 * t2 = master
// t1 = getMatrix(t1) * getMatrix(t2)^-1 * t2
return getMatrix(t1).times(getMatrix(t2).inverse());
}
// t1 = getMatrix(t1) * master
// getMatrix(t2)^-1 * t2 = master
// t1 = getMatrix(t1) * getMatrix(t2)^-1 * t2
return getMatrix(t1).times(getMatrix(t2).inverse());
}