| 8 |
|
class DCRollAFunctor : public DCRattleAFunctor{ |
| 9 |
|
public: |
| 10 |
|
DCRollAFunctor(SimInfo* info) : DCRattleAFunctor(info) {} |
| 11 |
< |
//virtual int operator()(ConstraintAtom* consAtom1, ConstraintAtom* consAtom2); |
| 11 |
> |
virtual int operator()(ConstraintAtom* consAtom1, ConstraintAtom* consAtom2); |
| 12 |
|
//virtual int operator()(ConstraintAtom* consAtom,ConstraintRigidBody* consRB); |
| 13 |
|
virtual int operator()(ConstraintRigidBody* consRB1, ConstraintRigidBody* consRB2); |
| 14 |
|
private: |
| 15 |
< |
void getEffInvMassVec(ConstraintRigidBody* consRB, const Vector3d& bondDir, Vector3d& invMassVec); |
| 15 |
> |
|
| 16 |
> |
void calcZeta(ConstraintAtom* consAtom, const Vector3d& bondDir, Vector3d&zeta); |
| 17 |
> |
void integrate(ConstraintAtom* consAtom, const Vector3d& force); |
| 18 |
> |
|
| 19 |
> |
void calcZeta(ConstraintRigidBody* consRB, const Vector3d& bondDir, Vector3d& zeta); |
| 20 |
|
void integrate(ConstraintRigidBody* consRB, const Vector3d& force); |
| 21 |
|
void rotationPropagation(StuntDouble* sd, double ji[3]); |
| 22 |
|
void rotate(int axes1, int axes2, double angle, double ji[3], double A[3][3]); |
| 85 |
|
//////////////////////////////////////////////////////////////////////////////// |
| 86 |
|
//class RattleAlgorithm will encapsulate preConstraint, RattleA and RattleB |
| 87 |
|
//actually, we could use factory pattern to seperate the creation process |
| 88 |
< |
class RollFramework : public ConsAlgoFramework{ |
| 88 |
> |
class RollFramework : public VelVerletConsFramework{ |
| 89 |
|
public: |
| 90 |
< |
RollFramework(SimInfo* rhs) : ConsAlgoFramework(rhs){ |
| 90 |
> |
RollFramework(SimInfo* rhs) : VelVerletConsFramework(rhs){ |
| 91 |
|
raAlgo = new RollA(rhs); |
| 92 |
|
rbAlgo = new RollB(rhs); |
| 93 |
|
} |
| 97 |
|
delete rbAlgo; |
| 98 |
|
} |
| 99 |
|
|
| 100 |
< |
int doRollA(){ |
| 100 |
> |
virtual int doConstrainA(){ |
| 101 |
|
raAlgo->doConstrain(); |
| 102 |
|
return raAlgo->haveError()? -1 : 1; |
| 103 |
|
|
| 104 |
|
} |
| 105 |
|
|
| 106 |
< |
int doRollB(){ |
| 106 |
> |
virtual int doConstrainB(){ |
| 107 |
|
rbAlgo->doConstrain(); |
| 108 |
|
return rbAlgo->haveError()? -1 : 1; |
| 109 |
|
|