Changeset 2908 for code/branches/questsystem5/src/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
r2907 r2908 29 29 30 30 class btRigidBody; 31 32 33 31 34 32 … … 95 93 bool isLimited() 96 94 { 97 if(m_loLimit >m_hiLimit) return false;95 if(m_loLimit>=m_hiLimit) return false; 98 96 return true; 99 97 } … … 113 111 114 112 //! apply the correction impulses for two bodies 115 btScalar solveAngularLimits(btScalar timeStep,btVector3& axis, btScalar jacDiagABInv,btRigidBody * body0, btSolverBody& bodyA,btRigidBody * body1,btSolverBody& bodyB); 113 btScalar solveAngularLimits(btScalar timeStep,btVector3& axis, btScalar jacDiagABInv,btRigidBody * body0, btRigidBody * body1); 114 116 115 117 116 }; … … 131 130 btScalar m_restitution;//! Bounce parameter for linear limit 132 131 //!@} 133 bool m_enableMotor[3];134 btVector3 m_targetVelocity;//!< target motor velocity135 btVector3 m_maxMotorForce;//!< max force on motor136 btVector3 m_currentLimitError;//! How much is violated this limit137 int m_currentLimit[3];//!< 0=free, 1=at lower limit, 2=at upper limit138 132 139 133 btTranslationalLimitMotor() … … 146 140 m_damping = btScalar(1.0f); 147 141 m_restitution = btScalar(0.5f); 148 for(int i=0; i < 3; i++)149 {150 m_enableMotor[i] = false;151 m_targetVelocity[i] = btScalar(0.f);152 m_maxMotorForce[i] = btScalar(0.f);153 }154 142 } 155 143 … … 163 151 m_damping = other.m_damping; 164 152 m_restitution = other.m_restitution; 165 for(int i=0; i < 3; i++)166 {167 m_enableMotor[i] = other.m_enableMotor[i];168 m_targetVelocity[i] = other.m_targetVelocity[i];169 m_maxMotorForce[i] = other.m_maxMotorForce[i];170 }171 153 } 172 154 … … 182 164 return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]); 183 165 } 184 inline bool needApplyForce(int limitIndex)185 {186 if(m_currentLimit[limitIndex] == 0 && m_enableMotor[limitIndex] == false) return false;187 return true;188 }189 int testLimitValue(int limitIndex, btScalar test_value);190 166 191 167 … … 193 169 btScalar timeStep, 194 170 btScalar jacDiagABInv, 195 btRigidBody& body1, btSolverBody& bodyA,const btVector3 &pointInA,196 btRigidBody& body2, btSolverBody& bodyB,const btVector3 &pointInB,171 btRigidBody& body1,const btVector3 &pointInA, 172 btRigidBody& body2,const btVector3 &pointInB, 197 173 int limit_index, 198 174 const btVector3 & axis_normal_on_a, … … 272 248 btVector3 m_calculatedAxisAngleDiff; 273 249 btVector3 m_calculatedAxis[3]; 274 btVector3 m_calculatedLinearDiff;275 250 276 251 btVector3 m_AnchorPos; // point betwen pivots of bodies A and B to solve linear axes … … 288 263 289 264 290 int setAngularLimits(btConstraintInfo2 *info, int row_offset);291 292 int setLinearLimits(btConstraintInfo2 *info);293 265 294 266 void buildLinearJacobian( … … 298 270 void buildAngularJacobian(btJacobianEntry & jacAngular,const btVector3 & jointAxisW); 299 271 300 // tests linear limits301 void calculateLinearInfo();302 272 303 273 //! calcs the euler angles between the two bodies. … … 307 277 308 278 public: 309 310 ///for backwards compatibility during the transition to 'getInfo/getInfo2'311 bool m_useSolveConstraintObsolete;312 313 279 btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA); 314 280 … … 365 331 virtual void buildJacobian(); 366 332 367 virtual void getInfo1 (btConstraintInfo1* info); 368 369 virtual void getInfo2 (btConstraintInfo2* info); 370 371 virtual void solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar timeStep); 333 virtual void solveConstraint(btScalar timeStep); 372 334 373 335 void updateRHS(btScalar timeStep); … … 471 433 virtual void calcAnchorPos(void); // overridable 472 434 473 int get_limit_motor_info2( btRotationalLimitMotor * limot,474 btRigidBody * body0, btRigidBody * body1,475 btConstraintInfo2 *info, int row, btVector3& ax1, int rotational);476 477 478 435 }; 479 436
Note: See TracChangeset
for help on using the changeset viewer.