diff options
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 92373cd..391f644 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -2733,28 +2733,29 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2733 | 2733 | ||
2734 | 2734 | ||
2735 | 2735 | ||
2736 | /* | 2736 | |
2737 | // Inverse Inertia Matrix, set the X, Y, and/r Z inertia to 0 then invert it again. | 2737 | // Inverse Inertia Matrix, set the X, Y, and/r Z inertia to 0 then invert it again. |
2738 | d.Mass objMass; | 2738 | d.Mass objMass; |
2739 | d.MassSetZero(out objMass); | 2739 | d.MassSetZero(out objMass); |
2740 | DMassCopy(ref pMass, ref objMass); | 2740 | DMassCopy(ref pMass, ref objMass); |
2741 | 2741 | ||
2742 | m_log.DebugFormat("1-{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, ", objMass.I.M00, objMass.I.M01, objMass.I.M02, objMass.I.M10, objMass.I.M11, objMass.I.M12, objMass.I.M20, objMass.I.M21, objMass.I.M22); | 2742 | //m_log.DebugFormat("1-{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, ", objMass.I.M00, objMass.I.M01, objMass.I.M02, objMass.I.M10, objMass.I.M11, objMass.I.M12, objMass.I.M20, objMass.I.M21, objMass.I.M22); |
2743 | 2743 | ||
2744 | Matrix4 dMassMat = FromDMass(objMass); | 2744 | Matrix4 dMassMat = FromDMass(objMass); |
2745 | 2745 | ||
2746 | Matrix4 mathmat = Inverse(dMassMat); | 2746 | Matrix4 mathmat = Inverse(dMassMat); |
2747 | 2747 | ||
2748 | m_log.DebugFormat("2-{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, ", mathmat[0, 0], mathmat[0, 1], mathmat[0, 2], mathmat[1, 0], mathmat[1, 1], mathmat[1, 2], mathmat[2, 0], mathmat[2, 1], mathmat[2, 2]); | 2748 | /* |
2749 | //m_log.DebugFormat("2-{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, ", mathmat[0, 0], mathmat[0, 1], mathmat[0, 2], mathmat[1, 0], mathmat[1, 1], mathmat[1, 2], mathmat[2, 0], mathmat[2, 1], mathmat[2, 2]); | ||
2749 | 2750 | ||
2750 | mathmat = Inverse(mathmat); | 2751 | mathmat = Inverse(mathmat); |
2751 | 2752 | ||
2752 | 2753 | ||
2753 | objMass = FromMatrix4(mathmat, ref objMass); | 2754 | objMass = FromMatrix4(mathmat, ref objMass); |
2754 | m_log.DebugFormat("3-{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, ", objMass.I.M00, objMass.I.M01, objMass.I.M02, objMass.I.M10, objMass.I.M11, objMass.I.M12, objMass.I.M20, objMass.I.M21, objMass.I.M22); | 2755 | //m_log.DebugFormat("3-{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, ", objMass.I.M00, objMass.I.M01, objMass.I.M02, objMass.I.M10, objMass.I.M11, objMass.I.M12, objMass.I.M20, objMass.I.M21, objMass.I.M22); |
2755 | 2756 | ||
2756 | mathmat = Inverse(mathmat); | 2757 | mathmat = Inverse(mathmat); |
2757 | 2758 | */ | |
2758 | if (axis.X == 0) | 2759 | if (axis.X == 0) |
2759 | { | 2760 | { |
2760 | mathmat.M33 = 50.0000001f; | 2761 | mathmat.M33 = 50.0000001f; |
@@ -2775,12 +2776,18 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2775 | 2776 | ||
2776 | mathmat = Inverse(mathmat); | 2777 | mathmat = Inverse(mathmat); |
2777 | objMass = FromMatrix4(mathmat, ref objMass); | 2778 | objMass = FromMatrix4(mathmat, ref objMass); |
2778 | m_log.DebugFormat("4-{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, ", objMass.I.M00, objMass.I.M01, objMass.I.M02, objMass.I.M10, objMass.I.M11, objMass.I.M12, objMass.I.M20, objMass.I.M21, objMass.I.M22); | 2779 | //m_log.DebugFormat("4-{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, ", objMass.I.M00, objMass.I.M01, objMass.I.M02, objMass.I.M10, objMass.I.M11, objMass.I.M12, objMass.I.M20, objMass.I.M21, objMass.I.M22); |
2779 | 2780 | ||
2780 | //return; | 2781 | //return; |
2782 | if (d.MassCheck(ref objMass)) | ||
2783 | { | ||
2784 | d.BodySetMass(Body, ref objMass); | ||
2785 | } | ||
2786 | else | ||
2787 | { | ||
2788 | //m_log.Debug("[PHYSICS]: Mass invalid, ignoring"); | ||
2789 | } | ||
2781 | 2790 | ||
2782 | d.BodySetMass(Body, ref objMass); | ||
2783 | */ | ||
2784 | if (axisnum <= 0) | 2791 | if (axisnum <= 0) |
2785 | return; | 2792 | return; |
2786 | int dAMotorEuler = 1; | 2793 | int dAMotorEuler = 1; |