private void GenerateParentConstraints() { if (!_constraints.ConstraintsAreRelative) { _parentConstraints = _constraints; } else { _parentConstraints = new OneGrabTranslateConstraints(); _parentConstraints.MinX = new FloatConstraint(); _parentConstraints.MinY = new FloatConstraint(); _parentConstraints.MinZ = new FloatConstraint(); _parentConstraints.MaxX = new FloatConstraint(); _parentConstraints.MaxY = new FloatConstraint(); _parentConstraints.MaxZ = new FloatConstraint(); if (_constraints.MinX.Constrain) { _parentConstraints.MinX.Constrain = true; _parentConstraints.MinX.Value = _constraints.MinX.Value + _initialPosition.x; } if (_constraints.MaxX.Constrain) { _parentConstraints.MaxX.Constrain = true; _parentConstraints.MaxX.Value = _constraints.MaxX.Value + _initialPosition.x; } if (_constraints.MinY.Constrain) { _parentConstraints.MinY.Constrain = true; _parentConstraints.MinY.Value = _constraints.MinY.Value + _initialPosition.y; } if (_constraints.MaxY.Constrain) { _parentConstraints.MaxY.Constrain = true; _parentConstraints.MaxY.Value = _constraints.MaxY.Value + _initialPosition.y; } if (_constraints.MinZ.Constrain) { _parentConstraints.MinZ.Constrain = true; _parentConstraints.MinZ.Value = _constraints.MinZ.Value + _initialPosition.z; } if (_constraints.MaxZ.Constrain) { _parentConstraints.MaxZ.Constrain = true; _parentConstraints.MaxZ.Value = _constraints.MaxZ.Value + _initialPosition.z; } } }
public void InjectOptionalConstraints(OneGrabTranslateConstraints constraints) { _constraints = constraints; }