| 57 |
|
|
| 58 |
|
public: |
| 59 |
|
|
| 60 |
< |
ConstraintPair(ConstraintElem* elem1, ConstraintElem* elem2, RealType len) |
| 61 |
< |
: consElem1_(elem1), consElem2_(elem2), dist2(len*len) { } |
| 60 |
> |
ConstraintPair(ConstraintElem* elem1, ConstraintElem* elem2, |
| 61 |
> |
RealType len, bool printForce) |
| 62 |
> |
: consElem1_(elem1), consElem2_(elem2), dist2(len*len), |
| 63 |
> |
printForce_(printForce) { } |
| 64 |
|
|
| 65 |
|
~ConstraintPair() { |
| 66 |
|
delete consElem1_; |
| 74 |
|
|
| 75 |
|
bool isMoved() { return consElem1_->getMoved() || consElem2_->getMoved(); } |
| 76 |
|
RealType getConsDistSquare() {return dist2;} |
| 77 |
+ |
void setConstraintForce(RealType frc) { force_ = frc; } |
| 78 |
+ |
RealType getConstraintForce() { return force_; } |
| 79 |
+ |
bool getPrintForce() {return printForce_;} |
| 80 |
|
|
| 81 |
|
private: |
| 82 |
|
|
| 83 |
|
ConstraintElem* consElem1_; |
| 84 |
|
ConstraintElem* consElem2_; |
| 85 |
|
RealType dist2; |
| 86 |
+ |
RealType force_; |
| 87 |
+ |
bool printForce_; |
| 88 |
|
}; |
| 89 |
|
|
| 90 |
|
} |