aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorTeravus Ovares2008-04-23 15:32:19 +0000
committerTeravus Ovares2008-04-23 15:32:19 +0000
commit2a3bdde0fa78c5a59c530e6d974dfd6709aa1519 (patch)
treed2857d6fc06cde42bef42a731e115caf60add086 /OpenSim/Region/Environment
parentTwo small changes: (diff)
downloadopensim-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 '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs42
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs17
2 files changed, 56 insertions, 3 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 {