diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs | 174 |
1 files changed, 172 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs index 9ad12a9..ff2b497 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs | |||
@@ -752,6 +752,15 @@ private sealed class BulletConstraintXNA : BulletConstraint | |||
752 | constraint.SetBreakingImpulseThreshold(threshold); | 752 | constraint.SetBreakingImpulseThreshold(threshold); |
753 | return true; | 753 | return true; |
754 | } | 754 | } |
755 | public override bool HingeSetLimits(BulletConstraint pConstraint, float low, float high, float softness, float bias, float relaxation) | ||
756 | { | ||
757 | HingeConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as HingeConstraint; | ||
758 | if (softness == HINGE_NOT_SPECIFIED) | ||
759 | constraint.SetLimit(low, high); | ||
760 | else | ||
761 | constraint.SetLimit(low, high, softness, bias, relaxation); | ||
762 | return true; | ||
763 | } | ||
755 | public override bool SpringEnable(BulletConstraint pConstraint, int index, float numericTrueFalse) | 764 | public override bool SpringEnable(BulletConstraint pConstraint, int index, float numericTrueFalse) |
756 | { | 765 | { |
757 | Generic6DofSpringConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as Generic6DofSpringConstraint; | 766 | Generic6DofSpringConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as Generic6DofSpringConstraint; |
@@ -762,13 +771,13 @@ private sealed class BulletConstraintXNA : BulletConstraint | |||
762 | public override bool SpringSetEquilibriumPoint(BulletConstraint pConstraint, int index, float equilibriumPoint) | 771 | public override bool SpringSetEquilibriumPoint(BulletConstraint pConstraint, int index, float equilibriumPoint) |
763 | { | 772 | { |
764 | Generic6DofSpringConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as Generic6DofSpringConstraint; | 773 | Generic6DofSpringConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as Generic6DofSpringConstraint; |
765 | if (index == -1) | 774 | if (index == SPRING_NOT_SPECIFIED) |
766 | { | 775 | { |
767 | constraint.SetEquilibriumPoint(); | 776 | constraint.SetEquilibriumPoint(); |
768 | } | 777 | } |
769 | else | 778 | else |
770 | { | 779 | { |
771 | if (equilibriumPoint == -1) | 780 | if (equilibriumPoint == SPRING_NOT_SPECIFIED) |
772 | constraint.SetEquilibriumPoint(index); | 781 | constraint.SetEquilibriumPoint(index); |
773 | else | 782 | else |
774 | constraint.SetEquilibriumPoint(index, equilibriumPoint); | 783 | constraint.SetEquilibriumPoint(index, equilibriumPoint); |
@@ -790,6 +799,167 @@ private sealed class BulletConstraintXNA : BulletConstraint | |||
790 | return true; | 799 | return true; |
791 | } | 800 | } |
792 | 801 | ||
802 | public override bool SliderSetLimits(BulletConstraint pConstraint, int lowerUpper, int linAng, float val) | ||
803 | { | ||
804 | SliderConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as SliderConstraint; | ||
805 | switch (lowerUpper) | ||
806 | { | ||
807 | case SLIDER_LOWER_LIMIT: | ||
808 | switch (linAng) | ||
809 | { | ||
810 | case SLIDER_LINEAR: | ||
811 | constraint.SetLowerLinLimit(val); | ||
812 | break; | ||
813 | case SLIDER_ANGULAR: | ||
814 | constraint.SetLowerAngLimit(val); | ||
815 | break; | ||
816 | } | ||
817 | break; | ||
818 | case SLIDER_UPPER_LIMIT: | ||
819 | switch (linAng) | ||
820 | { | ||
821 | case SLIDER_LINEAR: | ||
822 | constraint.SetUpperLinLimit(val); | ||
823 | break; | ||
824 | case SLIDER_ANGULAR: | ||
825 | constraint.SetUpperAngLimit(val); | ||
826 | break; | ||
827 | } | ||
828 | break; | ||
829 | } | ||
830 | return true; | ||
831 | } | ||
832 | public override bool SliderSet(BulletConstraint pConstraint, int softRestDamp, int dirLimOrtho, int linAng, float val) | ||
833 | { | ||
834 | SliderConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as SliderConstraint; | ||
835 | switch (softRestDamp) | ||
836 | { | ||
837 | case SLIDER_SET_SOFTNESS: | ||
838 | switch (dirLimOrtho) | ||
839 | { | ||
840 | case SLIDER_SET_DIRECTION: | ||
841 | switch (linAng) | ||
842 | { | ||
843 | case SLIDER_LINEAR: constraint.SetSoftnessDirLin(val); break; | ||
844 | case SLIDER_ANGULAR: constraint.SetSoftnessDirAng(val); break; | ||
845 | } | ||
846 | break; | ||
847 | case SLIDER_SET_LIMIT: | ||
848 | switch (linAng) | ||
849 | { | ||
850 | case SLIDER_LINEAR: constraint.SetSoftnessLimLin(val); break; | ||
851 | case SLIDER_ANGULAR: constraint.SetSoftnessLimAng(val); break; | ||
852 | } | ||
853 | break; | ||
854 | case SLIDER_SET_ORTHO: | ||
855 | switch (linAng) | ||
856 | { | ||
857 | case SLIDER_LINEAR: constraint.SetSoftnessOrthoLin(val); break; | ||
858 | case SLIDER_ANGULAR: constraint.SetSoftnessOrthoAng(val); break; | ||
859 | } | ||
860 | break; | ||
861 | } | ||
862 | break; | ||
863 | case SLIDER_SET_RESTITUTION: | ||
864 | switch (dirLimOrtho) | ||
865 | { | ||
866 | case SLIDER_SET_DIRECTION: | ||
867 | switch (linAng) | ||
868 | { | ||
869 | case SLIDER_LINEAR: constraint.SetRestitutionDirLin(val); break; | ||
870 | case SLIDER_ANGULAR: constraint.SetRestitutionDirAng(val); break; | ||
871 | } | ||
872 | break; | ||
873 | case SLIDER_SET_LIMIT: | ||
874 | switch (linAng) | ||
875 | { | ||
876 | case SLIDER_LINEAR: constraint.SetRestitutionLimLin(val); break; | ||
877 | case SLIDER_ANGULAR: constraint.SetRestitutionLimAng(val); break; | ||
878 | } | ||
879 | break; | ||
880 | case SLIDER_SET_ORTHO: | ||
881 | switch (linAng) | ||
882 | { | ||
883 | case SLIDER_LINEAR: constraint.SetRestitutionOrthoLin(val); break; | ||
884 | case SLIDER_ANGULAR: constraint.SetRestitutionOrthoAng(val); break; | ||
885 | } | ||
886 | break; | ||
887 | } | ||
888 | break; | ||
889 | case SLIDER_SET_DAMPING: | ||
890 | switch (dirLimOrtho) | ||
891 | { | ||
892 | case SLIDER_SET_DIRECTION: | ||
893 | switch (linAng) | ||
894 | { | ||
895 | case SLIDER_LINEAR: constraint.SetDampingDirLin(val); break; | ||
896 | case SLIDER_ANGULAR: constraint.SetDampingDirAng(val); break; | ||
897 | } | ||
898 | break; | ||
899 | case SLIDER_SET_LIMIT: | ||
900 | switch (linAng) | ||
901 | { | ||
902 | case SLIDER_LINEAR: constraint.SetDampingLimLin(val); break; | ||
903 | case SLIDER_ANGULAR: constraint.SetDampingLimAng(val); break; | ||
904 | } | ||
905 | break; | ||
906 | case SLIDER_SET_ORTHO: | ||
907 | switch (linAng) | ||
908 | { | ||
909 | case SLIDER_LINEAR: constraint.SetDampingOrthoLin(val); break; | ||
910 | case SLIDER_ANGULAR: constraint.SetDampingOrthoAng(val); break; | ||
911 | } | ||
912 | break; | ||
913 | } | ||
914 | break; | ||
915 | } | ||
916 | return true; | ||
917 | } | ||
918 | public override bool SliderMotorEnable(BulletConstraint pConstraint, int linAng, float numericTrueFalse) | ||
919 | { | ||
920 | SliderConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as SliderConstraint; | ||
921 | switch (linAng) | ||
922 | { | ||
923 | case SLIDER_LINEAR: | ||
924 | constraint.SetPoweredLinMotor(numericTrueFalse == 0.0 ? false : true); | ||
925 | break; | ||
926 | case SLIDER_ANGULAR: | ||
927 | constraint.SetPoweredAngMotor(numericTrueFalse == 0.0 ? false : true); | ||
928 | break; | ||
929 | } | ||
930 | return true; | ||
931 | } | ||
932 | public override bool SliderMotor(BulletConstraint pConstraint, int forceVel, int linAng, float val) | ||
933 | { | ||
934 | SliderConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as SliderConstraint; | ||
935 | switch (forceVel) | ||
936 | { | ||
937 | case SLIDER_MOTOR_VELOCITY: | ||
938 | switch (linAng) | ||
939 | { | ||
940 | case SLIDER_LINEAR: | ||
941 | constraint.SetTargetLinMotorVelocity(val); | ||
942 | break; | ||
943 | case SLIDER_ANGULAR: | ||
944 | constraint.SetTargetAngMotorVelocity(val); | ||
945 | break; | ||
946 | } | ||
947 | break; | ||
948 | case SLIDER_MAX_MOTOR_FORCE: | ||
949 | switch (linAng) | ||
950 | { | ||
951 | case SLIDER_LINEAR: | ||
952 | constraint.SetMaxLinMotorForce(val); | ||
953 | break; | ||
954 | case SLIDER_ANGULAR: | ||
955 | constraint.SetMaxAngMotorForce(val); | ||
956 | break; | ||
957 | } | ||
958 | break; | ||
959 | } | ||
960 | return true; | ||
961 | } | ||
962 | |||
793 | //BulletSimAPI.SetAngularDamping(Prim.PhysBody.ptr, angularDamping); | 963 | //BulletSimAPI.SetAngularDamping(Prim.PhysBody.ptr, angularDamping); |
794 | public override void SetAngularDamping(BulletBody pBody, float angularDamping) | 964 | public override void SetAngularDamping(BulletBody pBody, float angularDamping) |
795 | { | 965 | { |