Changeset 8393 for code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
- Timestamp:
- May 3, 2011, 5:07:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
r8351 r8393 711 711 (void)timeStep; 712 712 713 } 714 715 716 void btGeneric6DofConstraint::setFrames(const btTransform& frameA, const btTransform& frameB) 717 { 718 m_frameInA = frameA; 719 m_frameInB = frameB; 720 buildJacobian(); 721 calculateTransforms(); 713 722 } 714 723 … … 1039 1048 return retVal; 1040 1049 } 1050 1051 1052 1053 void btGeneric6DofConstraint::setAxis(const btVector3& axis1,const btVector3& axis2) 1054 { 1055 btVector3 zAxis = axis1.normalized(); 1056 btVector3 yAxis = axis2.normalized(); 1057 btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system 1058 1059 btTransform frameInW; 1060 frameInW.setIdentity(); 1061 frameInW.getBasis().setValue( xAxis[0], yAxis[0], zAxis[0], 1062 xAxis[1], yAxis[1], zAxis[1], 1063 xAxis[2], yAxis[2], zAxis[2]); 1064 1065 // now get constraint frame in local coordinate systems 1066 m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW; 1067 m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW; 1068 1069 calculateTransforms(); 1070 }
Note: See TracChangeset
for help on using the changeset viewer.