diff options
author | Teravus Ovares | 2008-04-23 15:32:19 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-23 15:32:19 +0000 |
commit | 2a3bdde0fa78c5a59c530e6d974dfd6709aa1519 (patch) | |
tree | d2857d6fc06cde42bef42a731e115caf60add086 /OpenSim/Region | |
parent | Two small changes: (diff) | |
download | opensim-SC-2a3bdde0fa78c5a59c530e6d974dfd6709aa1519.zip opensim-SC-2a3bdde0fa78c5a59c530e6d974dfd6709aa1519.tar.gz opensim-SC-2a3bdde0fa78c5a59c530e6d974dfd6709aa1519.tar.bz2 opensim-SC-2a3bdde0fa78c5a59c530e6d974dfd6709aa1519.tar.xz |
* Adds llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z,TF)
* Currently if you apply that to only one or two axis you get unpredictable and sometimes explosive results.
* Three axis works well enough to play with it anyway. More work is needed here.
* Fixed an incorrectly named method in ODE.NET
Diffstat (limited to 'OpenSim/Region')
11 files changed, 252 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 6af7662..4f65cc7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1179,9 +1179,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
1179 | SceneObjectPart rootpart = m_rootPart; | 1179 | SceneObjectPart rootpart = m_rootPart; |
1180 | if (rootpart != null) | 1180 | if (rootpart != null) |
1181 | { | 1181 | { |
1182 | rootpart.PhysActor.PIDTarget = new PhysicsVector(target.X, target.Y, target.Z); | 1182 | if (rootpart.PhysActor != null) |
1183 | rootpart.PhysActor.PIDTau = tau; | 1183 | { |
1184 | rootpart.PhysActor.PIDActive = true; | 1184 | rootpart.PhysActor.PIDTarget = new PhysicsVector(target.X, target.Y, target.Z); |
1185 | rootpart.PhysActor.PIDTau = tau; | ||
1186 | rootpart.PhysActor.PIDActive = true; | ||
1187 | } | ||
1185 | } | 1188 | } |
1186 | } | 1189 | } |
1187 | 1190 | ||
@@ -2229,5 +2232,38 @@ namespace OpenSim.Region.Environment.Scenes | |||
2229 | } | 2232 | } |
2230 | 2233 | ||
2231 | #endregion | 2234 | #endregion |
2235 | |||
2236 | internal void SetAxisRotation(int axis, int rotate10) | ||
2237 | { | ||
2238 | bool setX = false; | ||
2239 | bool setY = false; | ||
2240 | bool setZ = false; | ||
2241 | |||
2242 | int xaxis = 2; | ||
2243 | int yaxis = 4; | ||
2244 | int zaxis = 8; | ||
2245 | |||
2246 | if (m_rootPart != null) | ||
2247 | { | ||
2248 | setX = ((axis & xaxis) != 0) ? true : false; | ||
2249 | setY = ((axis & yaxis) != 0) ? true : false; | ||
2250 | setZ = ((axis & zaxis) != 0) ? true : false; | ||
2251 | |||
2252 | float setval = (rotate10 > 0) ? 1f : 0f; | ||
2253 | |||
2254 | if (setX) | ||
2255 | m_rootPart.m_rotationAxis.X = setval; | ||
2256 | if (setY) | ||
2257 | m_rootPart.m_rotationAxis.Y = setval; | ||
2258 | if (setZ) | ||
2259 | m_rootPart.m_rotationAxis.Z = setval; | ||
2260 | |||
2261 | if (setX || setY || setZ) | ||
2262 | { | ||
2263 | m_rootPart.SetPhysicsAxisRotation(); | ||
2264 | } | ||
2265 | |||
2266 | } | ||
2267 | } | ||
2232 | } | 2268 | } |
2233 | } \ No newline at end of file | 2269 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 4c781c5..9277954 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -104,6 +104,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
104 | private Vector3 m_sitTargetPosition = new Vector3(0, 0, 0); | 104 | private Vector3 m_sitTargetPosition = new Vector3(0, 0, 0); |
105 | private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1); | 105 | private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1); |
106 | public LLUUID m_sitTargetAvatar = LLUUID.Zero; | 106 | public LLUUID m_sitTargetAvatar = LLUUID.Zero; |
107 | [XmlIgnore] public PhysicsVector m_rotationAxis = new PhysicsVector(1f,1f,1f); | ||
107 | 108 | ||
108 | #region Permissions | 109 | #region Permissions |
109 | 110 | ||
@@ -1290,6 +1291,21 @@ namespace OpenSim.Region.Environment.Scenes | |||
1290 | PhysActor.Buoyancy = fvalue; | 1291 | PhysActor.Buoyancy = fvalue; |
1291 | } | 1292 | } |
1292 | } | 1293 | } |
1294 | |||
1295 | public void SetAxisRotation(int axis, int rotate) | ||
1296 | { | ||
1297 | if (m_parentGroup != null) | ||
1298 | { | ||
1299 | m_parentGroup.SetAxisRotation(axis, rotate); | ||
1300 | |||
1301 | } | ||
1302 | } | ||
1303 | |||
1304 | public void SetPhysicsAxisRotation() | ||
1305 | { | ||
1306 | PhysActor.LockAngularMotion(m_rotationAxis); | ||
1307 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | ||
1308 | } | ||
1293 | 1309 | ||
1294 | public void SetFloatOnWater(int floatYN) | 1310 | public void SetFloatOnWater(int floatYN) |
1295 | { | 1311 | { |
@@ -1306,6 +1322,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1306 | 1322 | ||
1307 | } | 1323 | } |
1308 | } | 1324 | } |
1325 | |||
1309 | 1326 | ||
1310 | public LLVector3 GetSitTargetPositionLL() | 1327 | public LLVector3 GetSitTargetPositionLL() |
1311 | { | 1328 | { |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 16ec66e..08fdd80 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -374,6 +374,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
374 | { | 374 | { |
375 | } | 375 | } |
376 | 376 | ||
377 | public override void LockAngularMotion(PhysicsVector axis) | ||
378 | { | ||
379 | |||
380 | } | ||
381 | |||
377 | public void SetAcceleration(PhysicsVector accel) | 382 | public void SetAcceleration(PhysicsVector accel) |
378 | { | 383 | { |
379 | _acceleration = accel; | 384 | _acceleration = accel; |
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index 1ad1201..40de537 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | |||
@@ -809,6 +809,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
809 | { | 809 | { |
810 | 810 | ||
811 | } | 811 | } |
812 | |||
813 | public override void LockAngularMotion(PhysicsVector axis) | ||
814 | { | ||
815 | |||
816 | } | ||
817 | |||
812 | public override float Mass | 818 | public override float Mass |
813 | { | 819 | { |
814 | get { return ActorMass; } | 820 | get { return ActorMass; } |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index b40635c..f48f129 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -123,6 +123,8 @@ namespace OpenSim.Region.Physics.Manager | |||
123 | 123 | ||
124 | public abstract void delink(); | 124 | public abstract void delink(); |
125 | 125 | ||
126 | public abstract void LockAngularMotion(PhysicsVector axis); | ||
127 | |||
126 | public virtual void RequestPhysicsterseUpdate() | 128 | public virtual void RequestPhysicsterseUpdate() |
127 | { | 129 | { |
128 | // Make a temporary copy of the event to avoid possibility of | 130 | // Make a temporary copy of the event to avoid possibility of |
@@ -347,6 +349,9 @@ namespace OpenSim.Region.Physics.Manager | |||
347 | { | 349 | { |
348 | } | 350 | } |
349 | 351 | ||
352 | public override void LockAngularMotion(PhysicsVector axis) | ||
353 | { | ||
354 | } | ||
350 | 355 | ||
351 | public override void AddForce(PhysicsVector force) | 356 | public override void AddForce(PhysicsVector force) |
352 | { | 357 | { |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsVector.cs b/OpenSim/Region/Physics/Manager/PhysicsVector.cs index a916e5e..4ec943c 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsVector.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsVector.cs | |||
@@ -149,7 +149,7 @@ namespace OpenSim.Region.Physics.Manager | |||
149 | { | 149 | { |
150 | PhysicsVector diff = this - v; | 150 | PhysicsVector diff = this - v; |
151 | float d = diff.length(); | 151 | float d = diff.length(); |
152 | if (d < tolerance) | 152 | if (d <= tolerance) |
153 | return true; | 153 | return true; |
154 | 154 | ||
155 | return false; | 155 | return false; |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 042042c..9f6b14e 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -505,7 +505,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
505 | 505 | ||
506 | } | 506 | } |
507 | 507 | ||
508 | // TODO: unused: | 508 | public override void LockAngularMotion(PhysicsVector axis) |
509 | { | ||
510 | |||
511 | } | ||
512 | |||
513 | // This code is very useful. Written by DanX0r. We're just not using it right now. | ||
514 | // Commented out to prevent a warning. | ||
515 | // | ||
509 | // private void standupStraight() | 516 | // private void standupStraight() |
510 | // { | 517 | // { |
511 | // // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air. | 518 | // // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air. |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 8e0640b..7a9734c 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -38,6 +38,10 @@ using OpenSim.Region.Physics.Manager; | |||
38 | 38 | ||
39 | namespace OpenSim.Region.Physics.OdePlugin | 39 | namespace OpenSim.Region.Physics.OdePlugin |
40 | { | 40 | { |
41 | /// <summary> | ||
42 | /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. | ||
43 | /// </summary> | ||
44 | |||
41 | public class OdePrim : PhysicsActor | 45 | public class OdePrim : PhysicsActor |
42 | { | 46 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -55,6 +59,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
55 | private PhysicsVector m_taintsize; | 59 | private PhysicsVector m_taintsize; |
56 | private PhysicsVector m_taintVelocity = PhysicsVector.Zero; | 60 | private PhysicsVector m_taintVelocity = PhysicsVector.Zero; |
57 | private Quaternion m_taintrot; | 61 | private Quaternion m_taintrot; |
62 | private PhysicsVector m_angularlock = new PhysicsVector(1f, 1f, 1f); | ||
63 | private PhysicsVector m_taintAngularLock = new PhysicsVector(1f, 1f, 1f); | ||
64 | private IntPtr Amotor = IntPtr.Zero; | ||
58 | 65 | ||
59 | private PhysicsVector m_PIDTarget = new PhysicsVector(0, 0, 0); | 66 | private PhysicsVector m_PIDTarget = new PhysicsVector(0, 0, 0); |
60 | private float m_PIDTau = 0f; | 67 | private float m_PIDTau = 0f; |
@@ -309,6 +316,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
309 | m_collisionscore = 0; | 316 | m_collisionscore = 0; |
310 | m_disabled = false; | 317 | m_disabled = false; |
311 | 318 | ||
319 | // The body doesn't already have a finite rotation mode set here | ||
320 | if ((!m_angularlock.IsIdentical(PhysicsVector.Zero, 0)) && _parent == null) | ||
321 | { | ||
322 | createAMotor(m_angularlock); | ||
323 | } | ||
324 | |||
312 | _parent_scene.addActivePrim(this); | 325 | _parent_scene.addActivePrim(this); |
313 | } | 326 | } |
314 | 327 | ||
@@ -722,7 +735,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
722 | } | 735 | } |
723 | if (prim_geom != (IntPtr)0) | 736 | if (prim_geom != (IntPtr)0) |
724 | { | 737 | { |
725 | if (m_taintposition != _position) | 738 | if (!_position.IsIdentical(m_taintposition,0f)) |
726 | changemove(timestep); | 739 | changemove(timestep); |
727 | 740 | ||
728 | if (m_taintrot != _orientation) | 741 | if (m_taintrot != _orientation) |
@@ -733,7 +746,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
733 | changePhysicsStatus(timestep); | 746 | changePhysicsStatus(timestep); |
734 | // | 747 | // |
735 | 748 | ||
736 | if (m_taintsize != _size) | 749 | if (!_size.IsIdentical(m_taintsize,0)) |
737 | changesize(timestep); | 750 | changesize(timestep); |
738 | // | 751 | // |
739 | 752 | ||
@@ -750,7 +763,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
750 | if (m_taintselected != m_isSelected) | 763 | if (m_taintselected != m_isSelected) |
751 | changeSelectedStatus(timestep); | 764 | changeSelectedStatus(timestep); |
752 | 765 | ||
753 | if (m_taintVelocity != PhysicsVector.Zero) | 766 | if (!m_taintVelocity.IsIdentical(PhysicsVector.Zero,0)) |
754 | changevelocity(timestep); | 767 | changevelocity(timestep); |
755 | 768 | ||
756 | if (m_taintparent != _parent) | 769 | if (m_taintparent != _parent) |
@@ -759,6 +772,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
759 | if (m_taintCollidesWater != m_collidesWater) | 772 | if (m_taintCollidesWater != m_collidesWater) |
760 | changefloatonwater(timestep); | 773 | changefloatonwater(timestep); |
761 | 774 | ||
775 | if (!m_angularlock.IsIdentical(m_taintAngularLock,0)) | ||
776 | changeAngularLock(timestep); | ||
762 | 777 | ||
763 | } | 778 | } |
764 | else | 779 | else |
@@ -767,6 +782,35 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
767 | } | 782 | } |
768 | } | 783 | } |
769 | 784 | ||
785 | private void changeAngularLock(float timestep) | ||
786 | { | ||
787 | // do we have a Physical object? | ||
788 | if (Body != IntPtr.Zero) | ||
789 | { | ||
790 | //Check that we have a Parent | ||
791 | //If we have a parent then we're not authorative here | ||
792 | if (_parent == null) | ||
793 | { | ||
794 | if (!m_taintAngularLock.IsIdentical(new PhysicsVector(1f,1f,1f), 0)) | ||
795 | { | ||
796 | //d.BodySetFiniteRotationMode(Body, 0); | ||
797 | //d.BodySetFiniteRotationAxis(Body,m_taintAngularLock.X,m_taintAngularLock.Y,m_taintAngularLock.Z); | ||
798 | createAMotor(m_taintAngularLock); | ||
799 | } | ||
800 | else | ||
801 | { | ||
802 | if (Amotor != IntPtr.Zero) | ||
803 | { | ||
804 | d.JointDestroy(Amotor); | ||
805 | Amotor = (IntPtr)0; | ||
806 | } | ||
807 | } | ||
808 | } | ||
809 | } | ||
810 | // Store this for later in case we get turned into a separate body | ||
811 | m_angularlock = new PhysicsVector(m_taintAngularLock.X,m_angularlock.Y,m_angularlock.Z); | ||
812 | } | ||
813 | |||
770 | private void changelink(float timestep) | 814 | private void changelink(float timestep) |
771 | { | 815 | { |
772 | 816 | ||
@@ -1241,6 +1285,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1241 | if (m_isphysical && Body != (IntPtr) 0) | 1285 | if (m_isphysical && Body != (IntPtr) 0) |
1242 | { | 1286 | { |
1243 | d.BodySetQuaternion(Body, ref myrot); | 1287 | d.BodySetQuaternion(Body, ref myrot); |
1288 | if (!m_angularlock.IsIdentical(new PhysicsVector(1, 1, 1), 0)) | ||
1289 | createAMotor(m_angularlock); | ||
1244 | } | 1290 | } |
1245 | 1291 | ||
1246 | resetCollisionAccounting(); | 1292 | resetCollisionAccounting(); |
@@ -1880,6 +1926,17 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1880 | m_taintparent = null; | 1926 | m_taintparent = null; |
1881 | } | 1927 | } |
1882 | 1928 | ||
1929 | |||
1930 | public override void LockAngularMotion(PhysicsVector axis) | ||
1931 | { | ||
1932 | // reverse the zero/non zero values for ODE. | ||
1933 | |||
1934 | axis.X = (axis.X > 0) ? 1f : 0f; | ||
1935 | axis.Y = (axis.Y > 0) ? 1f : 0f; | ||
1936 | axis.Z = (axis.Z > 0) ? 1f : 0f; | ||
1937 | m_taintAngularLock = new PhysicsVector(axis.X, axis.Y, axis.Z); ; | ||
1938 | } | ||
1939 | |||
1883 | public void UpdatePositionAndVelocity() | 1940 | public void UpdatePositionAndVelocity() |
1884 | { | 1941 | { |
1885 | // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! | 1942 | // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! |
@@ -2078,5 +2135,83 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2078 | public override PhysicsVector PIDTarget { set { m_PIDTarget = value; ; } } | 2135 | public override PhysicsVector PIDTarget { set { m_PIDTarget = value; ; } } |
2079 | public override bool PIDActive { set { m_usePID = value; } } | 2136 | public override bool PIDActive { set { m_usePID = value; } } |
2080 | public override float PIDTau { set { m_PIDTau = (value * 0.6f); } } | 2137 | public override float PIDTau { set { m_PIDTau = (value * 0.6f); } } |
2138 | |||
2139 | private void createAMotor(PhysicsVector axis) | ||
2140 | { | ||
2141 | if (Body == IntPtr.Zero) | ||
2142 | return; | ||
2143 | |||
2144 | if (Amotor != IntPtr.Zero) | ||
2145 | { | ||
2146 | d.JointDestroy(Amotor); | ||
2147 | Amotor = IntPtr.Zero; | ||
2148 | } | ||
2149 | |||
2150 | float m_tensor = 0f; | ||
2151 | if (Environment.OSVersion.Platform == PlatformID.Unix) | ||
2152 | { | ||
2153 | m_tensor = 2f; | ||
2154 | } | ||
2155 | else | ||
2156 | { | ||
2157 | m_tensor = 5f; | ||
2158 | } | ||
2159 | |||
2160 | float axisnum = 3; | ||
2161 | |||
2162 | axisnum = (axisnum - (axis.X + axis.Y + axis.Z)); | ||
2163 | |||
2164 | if (axisnum <= 0) | ||
2165 | return; | ||
2166 | int dAMotorEuler = 1; | ||
2167 | |||
2168 | Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); | ||
2169 | d.JointAttach(Amotor, Body, IntPtr.Zero); | ||
2170 | d.JointSetAMotorMode(Amotor, dAMotorEuler); | ||
2171 | |||
2172 | |||
2173 | |||
2174 | d.JointSetAMotorNumAxes(Amotor,(int)axisnum); | ||
2175 | int i = 0; | ||
2176 | |||
2177 | if (axis.X == 0) | ||
2178 | { | ||
2179 | d.JointSetAMotorAxis(Amotor, i, 0, 1, 0, 0); | ||
2180 | i++; | ||
2181 | } | ||
2182 | |||
2183 | if (axis.Y == 0) | ||
2184 | { | ||
2185 | d.JointSetAMotorAxis(Amotor, i, 0, 0, 1, 0); | ||
2186 | i++; | ||
2187 | } | ||
2188 | |||
2189 | |||
2190 | if (axis.Z == 0) | ||
2191 | { | ||
2192 | d.JointSetAMotorAxis(Amotor, i, 0, 0, 0, 1); | ||
2193 | i++; | ||
2194 | } | ||
2195 | for (int j = 0; j < (int)axisnum; j++) | ||
2196 | { | ||
2197 | //d.JointSetAMotorAngle(Amotor, j, 0); | ||
2198 | } | ||
2199 | // | ||
2200 | //d.JointSetAMotorAngle(Amotor, 1, 0); | ||
2201 | //d.JointSetAMotorAngle(Amotor, 2, 0); | ||
2202 | |||
2203 | // These lowstops and high stops are effectively (no wiggle room) | ||
2204 | d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -0.000000000001f); | ||
2205 | d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0.000000000001f); | ||
2206 | d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -0.000000000001f); | ||
2207 | d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.000000000001f); | ||
2208 | d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f); | ||
2209 | d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f); | ||
2210 | |||
2211 | |||
2212 | d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); | ||
2213 | d.JointSetAMotorParam(Amotor, (int)dParam.FMax, m_tensor); | ||
2214 | |||
2215 | } | ||
2081 | } | 2216 | } |
2082 | } | 2217 | } |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs index 12b2d8f..b7f38d4 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs | |||
@@ -502,6 +502,12 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
502 | { | 502 | { |
503 | 503 | ||
504 | } | 504 | } |
505 | |||
506 | public override void LockAngularMotion(PhysicsVector axis) | ||
507 | { | ||
508 | |||
509 | } | ||
510 | |||
505 | public void SetAcceleration(PhysicsVector accel) | 511 | public void SetAcceleration(PhysicsVector accel) |
506 | { | 512 | { |
507 | _acceleration = accel; | 513 | _acceleration = accel; |
@@ -706,6 +712,11 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
706 | { | 712 | { |
707 | } | 713 | } |
708 | 714 | ||
715 | public override void LockAngularMotion(PhysicsVector axis) | ||
716 | { | ||
717 | |||
718 | } | ||
719 | |||
709 | public override bool Selected | 720 | public override bool Selected |
710 | { | 721 | { |
711 | set { return; } | 722 | set { return; } |
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index 2d00bdb..2d40134 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | |||
@@ -392,6 +392,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
392 | 392 | ||
393 | } | 393 | } |
394 | 394 | ||
395 | public override void LockAngularMotion(PhysicsVector axis) | ||
396 | { | ||
397 | |||
398 | } | ||
399 | |||
395 | public override void SetMomentum(PhysicsVector momentum) | 400 | public override void SetMomentum(PhysicsVector momentum) |
396 | { | 401 | { |
397 | } | 402 | } |
@@ -630,6 +635,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
630 | { | 635 | { |
631 | } | 636 | } |
632 | 637 | ||
638 | public override void LockAngularMotion(PhysicsVector axis) | ||
639 | { | ||
640 | |||
641 | } | ||
642 | |||
633 | public override float Mass | 643 | public override float Mass |
634 | { | 644 | { |
635 | get { return 0f; } | 645 | get { return 0f; } |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 3dff98f..09cd4af 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -692,6 +692,9 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
692 | public void llSetStatus(int status, int value) | 692 | public void llSetStatus(int status, int value) |
693 | { | 693 | { |
694 | m_host.AddScriptLPS(1); | 694 | m_host.AddScriptLPS(1); |
695 | |||
696 | int statusrotationaxis = 0; | ||
697 | |||
695 | if ((status & BuiltIn_Commands_BaseClass.STATUS_PHYSICS) == BuiltIn_Commands_BaseClass.STATUS_PHYSICS) | 698 | if ((status & BuiltIn_Commands_BaseClass.STATUS_PHYSICS) == BuiltIn_Commands_BaseClass.STATUS_PHYSICS) |
696 | { | 699 | { |
697 | if (value == 1) | 700 | if (value == 1) |
@@ -713,15 +716,16 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
713 | } | 716 | } |
714 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) | 717 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) |
715 | { | 718 | { |
716 | NotImplemented("llSetStatus - STATUS_ROTATE_X"); | 719 | statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X; |
720 | |||
717 | } | 721 | } |
718 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) | 722 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) |
719 | { | 723 | { |
720 | NotImplemented("llSetStatus - STATUS_ROTATE_Y"); | 724 | statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y; |
721 | } | 725 | } |
722 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) | 726 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z) |
723 | { | 727 | { |
724 | NotImplemented("llSetStatus - STATUS_ROTATE_Z"); | 728 | statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_Z; |
725 | } | 729 | } |
726 | if ((status & BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) == BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) | 730 | if ((status & BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) == BuiltIn_Commands_BaseClass.STATUS_BLOCK_GRAB) |
727 | { | 731 | { |
@@ -739,7 +743,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
739 | { | 743 | { |
740 | NotImplemented("llSetStatus - STATUS_SANDBOX"); | 744 | NotImplemented("llSetStatus - STATUS_SANDBOX"); |
741 | } | 745 | } |
742 | 746 | if (statusrotationaxis != 0) | |
747 | { | ||
748 | m_host.SetAxisRotation(statusrotationaxis, value); | ||
749 | |||
750 | } | ||
743 | return; | 751 | return; |
744 | } | 752 | } |
745 | 753 | ||