| 1556 | } |
| 1557 | |
| 1558 | bool PhysicsDirect::getJointInfo(int bodyIndex, int jointIndex, struct b3JointInfo& info) const |
| 1559 | { |
| 1560 | BodyJointInfoCache2** bodyJointsPtr = m_data->m_bodyJointMap[bodyIndex]; |
| 1561 | if (bodyJointsPtr && *bodyJointsPtr) |
| 1562 | { |
| 1563 | BodyJointInfoCache2* bodyJoints = *bodyJointsPtr; |
| 1564 | if ((jointIndex >= 0) && (jointIndex < bodyJoints->m_jointInfo.size())) |
| 1565 | { |
| 1566 | info = bodyJoints->m_jointInfo[jointIndex]; |
| 1567 | info.m_qSize = 0; |
| 1568 | info.m_uSize = 0; |
| 1569 | |
| 1570 | switch (info.m_jointType) |
| 1571 | { |
| 1572 | case eSphericalType: |
| 1573 | { |
| 1574 | info.m_qSize = 4;//quaterion x,y,z,w |
| 1575 | info.m_uSize = 3; |
| 1576 | break; |
| 1577 | } |
| 1578 | case ePlanarType: |
| 1579 | { |
| 1580 | info.m_qSize = 2; |
| 1581 | info.m_uSize = 2; |
| 1582 | break; |
| 1583 | } |
| 1584 | case ePrismaticType: |
| 1585 | case eRevoluteType: |
| 1586 | { |
| 1587 | info.m_qSize = 1; |
| 1588 | info.m_uSize = 1; |
| 1589 | break; |
| 1590 | } |
| 1591 | |
| 1592 | default: |
| 1593 | { |
| 1594 | } |
| 1595 | } |
| 1596 | |
| 1597 | |
| 1598 | return true; |
| 1599 | } |
| 1600 | } |
| 1601 | return false; |
| 1602 | } |
| 1603 | |
| 1604 | void PhysicsDirect::setSharedMemoryKey(int key) |
| 1605 | { |