diff options
author | Robert Adams | 2015-08-06 21:48:50 -0700 |
---|---|---|
committer | Robert Adams | 2015-08-06 21:48:50 -0700 |
commit | 5a1279af8ad22e2ccedaebbdcfb4e3ec561c6d8c (patch) | |
tree | 468b1117ce9169bc683932e9c7b6f89a7bec1c9c /OpenSim/Region/Physics | |
parent | BulletSim: rearrange code and add some tests to try and resolve the (diff) | |
download | opensim-SC-5a1279af8ad22e2ccedaebbdcfb4e3ec561c6d8c.zip opensim-SC-5a1279af8ad22e2ccedaebbdcfb4e3ec561c6d8c.tar.gz opensim-SC-5a1279af8ad22e2ccedaebbdcfb4e3ec561c6d8c.tar.bz2 opensim-SC-5a1279af8ad22e2ccedaebbdcfb4e3ec561c6d8c.tar.xz |
BulletSim: clean up some code for axis locking. No functional change.
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 87 |
1 files changed, 13 insertions, 74 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 5d359e8..a00991f 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -1668,98 +1668,37 @@ public class BSPrim : BSPhysObject | |||
1668 | { | 1668 | { |
1669 | switch ((int)funct) | 1669 | switch ((int)funct) |
1670 | { | 1670 | { |
1671 | // Those that take no parameters | ||
1671 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR: | 1672 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR: |
1672 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR, 0f, 0f); | ||
1673 | index += 1; | ||
1674 | break; | ||
1675 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_X: | 1673 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_X: |
1676 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_X, 0f, 0f); | ||
1677 | index += 1; | ||
1678 | break; | ||
1679 | case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_X: | ||
1680 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_X, (float)pParams[index + 1], (float)pParams[index + 2]); | ||
1681 | index += 3; | ||
1682 | break; | ||
1683 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Y: | 1674 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Y: |
1684 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Y, 0f, 0f); | ||
1685 | index += 1; | ||
1686 | break; | ||
1687 | case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Y: | ||
1688 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Y, (float)pParams[index + 1], (float)pParams[index + 2]); | ||
1689 | index += 3; | ||
1690 | break; | ||
1691 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Z: | 1675 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Z: |
1692 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR_Z, 0f, 0f); | ||
1693 | index += 1; | ||
1694 | break; | ||
1695 | case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Z: | ||
1696 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Z, (float)pParams[index + 1], (float)pParams[index + 2]); | ||
1697 | index += 3; | ||
1698 | break; | ||
1699 | case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR: | 1676 | case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR: |
1700 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR, 0f, 0f); | ||
1701 | index += 1; | ||
1702 | break; | ||
1703 | case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_X: | 1677 | case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_X: |
1704 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_X, 0f, 0f); | ||
1705 | index += 1; | ||
1706 | break; | ||
1707 | case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_X: | ||
1708 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_X, (float)pParams[index + 1], (float)pParams[index + 2]); | ||
1709 | index += 3; | ||
1710 | break; | ||
1711 | case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Y: | 1678 | case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Y: |
1712 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Y, 0f, 0f); | ||
1713 | index += 1; | ||
1714 | break; | ||
1715 | case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Y: | ||
1716 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Y, (float)pParams[index + 1], (float)pParams[index + 2]); | ||
1717 | index += 3; | ||
1718 | break; | ||
1719 | case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Z: | 1679 | case ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Z: |
1720 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LOCK_ANGULAR_Z, 0f, 0f); | ||
1721 | index += 1; | ||
1722 | break; | ||
1723 | case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Z: | ||
1724 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Z, (float)pParams[index + 1], (float)pParams[index + 2]); | ||
1725 | index += 3; | ||
1726 | break; | ||
1727 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR: | 1680 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR: |
1728 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR, 0f, 0f); | ||
1729 | index += 1; | ||
1730 | break; | ||
1731 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_X: | 1681 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_X: |
1732 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_X, 0f, 0f); | ||
1733 | index += 1; | ||
1734 | break; | ||
1735 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Y: | 1682 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Y: |
1736 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Y, 0f, 0f); | ||
1737 | index += 1; | ||
1738 | break; | ||
1739 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Z: | 1683 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Z: |
1740 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_LINEAR_Z, 0f, 0f); | ||
1741 | index += 1; | ||
1742 | break; | ||
1743 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR: | 1684 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR: |
1744 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR, 0f, 0f); | ||
1745 | index += 1; | ||
1746 | break; | ||
1747 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_X: | 1685 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_X: |
1748 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_X, 0f, 0f); | ||
1749 | index += 1; | ||
1750 | break; | ||
1751 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Y: | 1686 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Y: |
1752 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Y, 0f, 0f); | ||
1753 | index += 1; | ||
1754 | break; | ||
1755 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Z: | 1687 | case ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Z: |
1756 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK_ANGULAR_Z, 0f, 0f); | ||
1757 | index += 1; | ||
1758 | break; | ||
1759 | case ExtendedPhysics.PHYS_AXIS_UNLOCK: | 1688 | case ExtendedPhysics.PHYS_AXIS_UNLOCK: |
1760 | ApplyAxisLimits(ExtendedPhysics.PHYS_AXIS_UNLOCK, 0f, 0f); | 1689 | ApplyAxisLimits((int)funct, 0f, 0f); |
1761 | index += 1; | 1690 | index += 1; |
1762 | break; | 1691 | break; |
1692 | // Those that take two parameters (the limits) | ||
1693 | case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_X: | ||
1694 | case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Y: | ||
1695 | case ExtendedPhysics.PHYS_AXIS_LIMIT_LINEAR_Z: | ||
1696 | case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_X: | ||
1697 | case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Y: | ||
1698 | case ExtendedPhysics.PHYS_AXIS_LIMIT_ANGULAR_Z: | ||
1699 | ApplyAxisLimits((int)funct, (float)pParams[index + 1], (float)pParams[index + 2]); | ||
1700 | index += 3; | ||
1701 | break; | ||
1763 | default: | 1702 | default: |
1764 | m_log.WarnFormat("{0} SetSxisLockLimitsExtension. Unknown op={1}", LogHeader, funct); | 1703 | m_log.WarnFormat("{0} SetSxisLockLimitsExtension. Unknown op={1}", LogHeader, funct); |
1765 | index += 1; | 1704 | index += 1; |
@@ -1789,7 +1728,7 @@ public class BSPrim : BSPhysObject | |||
1789 | float linearMax = 23000f; | 1728 | float linearMax = 23000f; |
1790 | float angularMax = (float)Math.PI; | 1729 | float angularMax = (float)Math.PI; |
1791 | 1730 | ||
1792 | switch ((int)funct) | 1731 | switch (funct) |
1793 | { | 1732 | { |
1794 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR: | 1733 | case ExtendedPhysics.PHYS_AXIS_LOCK_LINEAR: |
1795 | this.LockedLinearAxis = new OMV.Vector3(LockedAxis, LockedAxis, LockedAxis); | 1734 | this.LockedLinearAxis = new OMV.Vector3(LockedAxis, LockedAxis, LockedAxis); |