aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2013-06-11 15:36:52 -0700
committerDiva Canto2013-06-11 15:36:52 -0700
commita0fed03e1012f76195ac6fd02912bf5979b9a27f (patch)
tree898336047dd123c2603a69d56666c50f18a2b01c /OpenSim
parentReally bad idea to lock m_UserCache for so long in UserManagementModule. Adde... (diff)
parentPut the "script saved" and "notecard saved" messages back into the bottom (diff)
downloadopensim-SC_OLD-a0fed03e1012f76195ac6fd02912bf5979b9a27f.zip
opensim-SC_OLD-a0fed03e1012f76195ac6fd02912bf5979b9a27f.tar.gz
opensim-SC_OLD-a0fed03e1012f76195ac6fd02912bf5979b9a27f.tar.bz2
opensim-SC_OLD-a0fed03e1012f76195ac6fd02912bf5979b9a27f.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/SQLite/Resources/RegionStore.migrations8
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs24
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs3
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs12
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs5
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs2
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs4
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapes.cs35
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt44
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs41
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs25
13 files changed, 153 insertions, 74 deletions
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
index c6f4b48..bff039d 100644
--- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
@@ -592,3 +592,11 @@ ALTER TABLE prims ADD COLUMN `Friction` double NOT NULL default '0.6';
592ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5'; 592ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5';
593 593
594COMMIT; 594COMMIT;
595
596:VERSION 29 #---------------- Keyframes
597
598BEGIN;
599
600ALTER TABLE prims ADD COLUMN `KeyframeMotion` blob;
601
602COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index d4734a6..70b76c9 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -732,6 +732,8 @@ namespace OpenSim.Data.SQLite
732 } 732 }
733 733
734 SceneObjectGroup group = new SceneObjectGroup(prim); 734 SceneObjectGroup group = new SceneObjectGroup(prim);
735 if (prim.KeyframeMotion != null)
736 prim.KeyframeMotion.UpdateSceneObject(group);
735 createdObjects.Add(group.UUID, group); 737 createdObjects.Add(group.UUID, group);
736 retvals.Add(group); 738 retvals.Add(group);
737 LoadItems(prim); 739 LoadItems(prim);
@@ -1241,6 +1243,7 @@ namespace OpenSim.Data.SQLite
1241 createCol(prims, "Friction", typeof(Double)); 1243 createCol(prims, "Friction", typeof(Double));
1242 createCol(prims, "Restitution", typeof(Double)); 1244 createCol(prims, "Restitution", typeof(Double));
1243 1245
1246 createCol(prims, "KeyframeMotion", typeof(Byte[]));
1244 // Add in contraints 1247 // Add in contraints
1245 prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; 1248 prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] };
1246 1249
@@ -1736,6 +1739,20 @@ namespace OpenSim.Data.SQLite
1736 prim.Friction = Convert.ToSingle(row["Friction"]); 1739 prim.Friction = Convert.ToSingle(row["Friction"]);
1737 prim.Restitution = Convert.ToSingle(row["Restitution"]); 1740 prim.Restitution = Convert.ToSingle(row["Restitution"]);
1738 1741
1742
1743 if (!(row["KeyframeMotion"] is DBNull))
1744 {
1745 Byte[] data = (byte[])row["KeyframeMotion"];
1746 if (data.Length > 0)
1747 prim.KeyframeMotion = KeyframeMotion.FromData(null, data);
1748 else
1749 prim.KeyframeMotion = null;
1750 }
1751 else
1752 {
1753 prim.KeyframeMotion = null;
1754 }
1755
1739 return prim; 1756 return prim;
1740 } 1757 }
1741 1758
@@ -2168,6 +2185,13 @@ namespace OpenSim.Data.SQLite
2168 row["GravityModifier"] = (double)prim.GravityModifier; 2185 row["GravityModifier"] = (double)prim.GravityModifier;
2169 row["Friction"] = (double)prim.Friction; 2186 row["Friction"] = (double)prim.Friction;
2170 row["Restitution"] = (double)prim.Restitution; 2187 row["Restitution"] = (double)prim.Restitution;
2188
2189 if (prim.KeyframeMotion != null)
2190 row["KeyframeMotion"] = prim.KeyframeMotion.Serialize();
2191 else
2192 row["KeyframeMotion"] = new Byte[0];
2193
2194
2171 } 2195 }
2172 2196
2173 /// <summary> 2197 /// <summary>
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index eb7c578..96a030b 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -1805,6 +1805,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1805 1805
1806 // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events 1806 // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events
1807 m_PollServiceManager = new PollServiceRequestManager(this, 3, 25000); 1807 m_PollServiceManager = new PollServiceRequestManager(this, 3, 25000);
1808 m_PollServiceManager.Start();
1808 HTTPDRunning = true; 1809 HTTPDRunning = true;
1809 1810
1810 //HttpListenerContext context; 1811 //HttpListenerContext context;
@@ -1855,7 +1856,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1855 HTTPDRunning = false; 1856 HTTPDRunning = false;
1856 try 1857 try
1857 { 1858 {
1858// m_PollServiceManager.Stop(); 1859 m_PollServiceManager.Stop();
1859 1860
1860 m_httpListener2.ExceptionThrown -= httpServerException; 1861 m_httpListener2.ExceptionThrown -= httpServerException;
1861 //m_httpListener2.DisconnectHandler = null; 1862 //m_httpListener2.DisconnectHandler = null;
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index a5380c1..aee3e3c 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -66,14 +66,17 @@ namespace OpenSim.Framework.Servers.HttpServer
66 m_server = pSrv; 66 m_server = pSrv;
67 m_WorkerThreadCount = pWorkerThreadCount; 67 m_WorkerThreadCount = pWorkerThreadCount;
68 m_workerThreads = new Thread[m_WorkerThreadCount]; 68 m_workerThreads = new Thread[m_WorkerThreadCount];
69 }
69 70
71 public void Start()
72 {
70 //startup worker threads 73 //startup worker threads
71 for (uint i = 0; i < m_WorkerThreadCount; i++) 74 for (uint i = 0; i < m_WorkerThreadCount; i++)
72 { 75 {
73 m_workerThreads[i] 76 m_workerThreads[i]
74 = Watchdog.StartThread( 77 = Watchdog.StartThread(
75 PoolWorkerJob, 78 PoolWorkerJob,
76 String.Format("PollServiceWorkerThread{0}", i), 79 string.Format("PollServiceWorkerThread{0}:{1}", i, m_server.Port),
77 ThreadPriority.Normal, 80 ThreadPriority.Normal,
78 false, 81 false,
79 false, 82 false,
@@ -83,7 +86,7 @@ namespace OpenSim.Framework.Servers.HttpServer
83 86
84 m_retrysThread = Watchdog.StartThread( 87 m_retrysThread = Watchdog.StartThread(
85 this.CheckRetries, 88 this.CheckRetries,
86 "PollServiceWatcherThread", 89 string.Format("PollServiceWatcherThread:{0}", m_server.Port),
87 ThreadPriority.Normal, 90 ThreadPriority.Normal,
88 false, 91 false,
89 true, 92 true,
@@ -91,7 +94,6 @@ namespace OpenSim.Framework.Servers.HttpServer
91 1000 * 60 * 10); 94 1000 * 60 * 10);
92 } 95 }
93 96
94
95 private void ReQueueEvent(PollServiceHttpRequest req) 97 private void ReQueueEvent(PollServiceHttpRequest req)
96 { 98 {
97 if (m_running) 99 if (m_running)
@@ -142,14 +144,14 @@ namespace OpenSim.Framework.Servers.HttpServer
142 } 144 }
143 } 145 }
144 146
145 ~PollServiceRequestManager() 147 public void Stop()
146 { 148 {
147 m_running = false; 149 m_running = false;
148// m_timeout = -10000; // cause all to expire 150// m_timeout = -10000; // cause all to expire
149 Thread.Sleep(1000); // let the world move 151 Thread.Sleep(1000); // let the world move
150 152
151 foreach (Thread t in m_workerThreads) 153 foreach (Thread t in m_workerThreads)
152 Watchdog.AbortThread(t.ManagedThreadId); 154 Watchdog.AbortThread(t.ManagedThreadId);
153 155
154 try 156 try
155 { 157 {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 880205a..1203192 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -260,7 +260,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
260 return UUID.Zero; 260 return UUID.Zero;
261 } 261 }
262 262
263 remoteClient.SendAgentAlertMessage("Notecard saved", false); 263 remoteClient.SendAlertMessage("Notecard saved");
264 } 264 }
265 else if ((InventoryType)item.InvType == InventoryType.LSL) 265 else if ((InventoryType)item.InvType == InventoryType.LSL)
266 { 266 {
@@ -270,7 +270,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
270 return UUID.Zero; 270 return UUID.Zero;
271 } 271 }
272 272
273 remoteClient.SendAgentAlertMessage("Script saved", false); 273 remoteClient.SendAlertMessage("Script saved");
274 } 274 }
275 275
276 AssetBase asset = 276 AssetBase asset =
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs
index 1982473..7073433 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs
@@ -93,7 +93,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests
93 LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); 93 LocalAssetServicesConnector lasc = new LocalAssetServicesConnector();
94 lasc.Initialise(config); 94 lasc.Initialise(config);
95 95
96 // If it is local, it should not be stored
96 AssetBase a1 = AssetHelpers.CreateNotecardAsset(); 97 AssetBase a1 = AssetHelpers.CreateNotecardAsset();
98 a1.Local = true;
97 a1.Temporary = true; 99 a1.Temporary = true;
98 100
99 lasc.Store(a1); 101 lasc.Store(a1);
@@ -102,6 +104,24 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests
102 Assert.That(lasc.GetData(a1.ID), Is.Null); 104 Assert.That(lasc.GetData(a1.ID), Is.Null);
103 Assert.That(lasc.GetMetadata(a1.ID), Is.Null); 105 Assert.That(lasc.GetMetadata(a1.ID), Is.Null);
104 106
107 // If it is remote, it should be stored
108 // AssetBase a2 = AssetHelpers.CreateNotecardAsset();
109 // a2.Local = false;
110 // a2.Temporary = true;
111
112 // lasc.Store(a2);
113
114 // AssetBase retreivedA2 = lasc.Get(a2.ID);
115 // Assert.That(retreivedA2.ID, Is.EqualTo(a2.ID));
116 // Assert.That(retreivedA2.Metadata.ID, Is.EqualTo(a2.Metadata.ID));
117 // Assert.That(retreivedA2.Data.Length, Is.EqualTo(a2.Data.Length));
118
119 // AssetMetadata retrievedA2Metadata = lasc.GetMetadata(a2.ID);
120 // Assert.That(retrievedA2Metadata.ID, Is.EqualTo(a2.ID));
121
122 // byte[] retrievedA2Data = lasc.GetData(a2.ID);
123 // Assert.That(retrievedA2Data.Length, Is.EqualTo(a2.Data.Length));
124
105 // TODO: Add cache and check that this does receive a copy of the asset 125 // TODO: Add cache and check that this does receive a copy of the asset
106 } 126 }
107 127
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index ff3f738..482d958 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -779,7 +779,8 @@ namespace OpenSim.Region.Framework.Scenes
779 } 779 }
780 780
781 // Tell the physics engines that this prim changed. 781 // Tell the physics engines that this prim changed.
782 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); 782 if (ParentGroup != null && ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null)
783 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
783 } 784 }
784 catch (Exception e) 785 catch (Exception e)
785 { 786 {
@@ -892,7 +893,7 @@ namespace OpenSim.Region.Framework.Scenes
892 //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString()); 893 //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString());
893 } 894 }
894 895
895 if (ParentGroup != null) 896 if (ParentGroup != null && ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null)
896 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); 897 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
897 //} 898 //}
898 } 899 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
index cca887a..a4c5e08 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
@@ -148,7 +148,7 @@ public abstract class BSPhysObject : PhysicsActor
148 // The asset state is first 'Unknown' then 'Waiting' then either 'Failed' or 'Fetched'. 148 // The asset state is first 'Unknown' then 'Waiting' then either 'Failed' or 'Fetched'.
149 public enum PrimAssetCondition 149 public enum PrimAssetCondition
150 { 150 {
151 Unknown, Waiting, Failed, Fetched 151 Unknown, Waiting, FailedAssetFetch, FailedMeshing, Fetched
152 } 152 }
153 public PrimAssetCondition PrimAssetState { get; set; } 153 public PrimAssetCondition PrimAssetState { get; set; }
154 154
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 423c389..dec6b6f 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -249,7 +249,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
249 TerrainManager.CreateInitialGroundPlaneAndTerrain(); 249 TerrainManager.CreateInitialGroundPlaneAndTerrain();
250 250
251 // Put some informational messages into the log file. 251 // Put some informational messages into the log file.
252 m_log.WarnFormat("{0} Linksets implemented with {1}", LogHeader, (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation); 252 m_log.InfoFormat("{0} Linksets implemented with {1}", LogHeader, (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation);
253 253
254 InTaintTime = false; 254 InTaintTime = false;
255 m_initialized = true; 255 m_initialized = true;
@@ -374,7 +374,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
374 } 374 }
375 else 375 else
376 { 376 {
377 m_log.WarnFormat("{0} Selected bullet engine {1} -> {2}/{3}", LogHeader, engineName, ret.BulletEngineName, ret.BulletEngineVersion); 377 m_log.InfoFormat("{0} Selected bullet engine {1} -> {2}/{3}", LogHeader, engineName, ret.BulletEngineName, ret.BulletEngineVersion);
378 } 378 }
379 379
380 return ret; 380 return ret;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
index 867d2ab..202a4ce 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
@@ -167,7 +167,7 @@ public abstract class BSShape
167 // Prevent trying to keep fetching the mesh by declaring failure. 167 // Prevent trying to keep fetching the mesh by declaring failure.
168 if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Fetched) 168 if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Fetched)
169 { 169 {
170 prim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed; 170 prim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedMeshing;
171 physicsScene.Logger.WarnFormat("{0} Fetched asset would not mesh. {1}, texture={2}", 171 physicsScene.Logger.WarnFormat("{0} Fetched asset would not mesh. {1}, texture={2}",
172 LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture); 172 LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture);
173 physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,setFailed,objNam={1},tex={2}", 173 physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,setFailed,objNam={1},tex={2}",
@@ -177,7 +177,8 @@ public abstract class BSShape
177 { 177 {
178 // If this mesh has an underlying asset and we have not failed getting it before, fetch the asset 178 // If this mesh has an underlying asset and we have not failed getting it before, fetch the asset
179 if (prim.BaseShape.SculptEntry 179 if (prim.BaseShape.SculptEntry
180 && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.Failed 180 && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.FailedAssetFetch
181 && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.FailedMeshing
181 && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.Waiting 182 && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.Waiting
182 && prim.BaseShape.SculptTexture != OMV.UUID.Zero 183 && prim.BaseShape.SculptTexture != OMV.UUID.Zero
183 ) 184 )
@@ -219,7 +220,7 @@ public abstract class BSShape
219 } 220 }
220 if (!assetFound) 221 if (!assetFound)
221 { 222 {
222 yprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed; 223 yprim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedAssetFetch;
223 } 224 }
224 physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,fetchAssetCallback,found={1},isSculpt={2},ids={3}", 225 physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,fetchAssetCallback,found={1},isSculpt={2},ids={3}",
225 yprim.LocalID, assetFound, yprim.BaseShape.SculptEntry, mismatchIDs ); 226 yprim.LocalID, assetFound, yprim.BaseShape.SculptEntry, mismatchIDs );
@@ -227,7 +228,7 @@ public abstract class BSShape
227 } 228 }
228 else 229 else
229 { 230 {
230 xprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed; 231 xprim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedAssetFetch;
231 physicsScene.Logger.ErrorFormat("{0} Physical object requires asset but no asset provider. Name={1}", 232 physicsScene.Logger.ErrorFormat("{0} Physical object requires asset but no asset provider. Name={1}",
232 LogHeader, physicsScene.Name); 233 LogHeader, physicsScene.Name);
233 } 234 }
@@ -235,13 +236,20 @@ public abstract class BSShape
235 } 236 }
236 else 237 else
237 { 238 {
238 if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed) 239 if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedAssetFetch)
239 { 240 {
240 physicsScene.Logger.WarnFormat("{0} Mesh failed to fetch asset. obj={1}, texture={2}", 241 physicsScene.Logger.WarnFormat("{0} Mesh failed to fetch asset. obj={1}, texture={2}",
241 LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture); 242 LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture);
242 physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,wasFailed,objNam={1},tex={2}", 243 physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,wasFailed,objNam={1},tex={2}",
243 prim.LocalID, prim.PhysObjectName, prim.BaseShape.SculptTexture); 244 prim.LocalID, prim.PhysObjectName, prim.BaseShape.SculptTexture);
244 } 245 }
246 if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedMeshing)
247 {
248 physicsScene.Logger.WarnFormat("{0} Mesh asset would not mesh. obj={1}, texture={2}",
249 LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture);
250 physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,wasFailedMeshing,objNam={1},tex={2}",
251 prim.LocalID, prim.PhysObjectName, prim.BaseShape.SculptTexture);
252 }
245 } 253 }
246 } 254 }
247 255
@@ -374,7 +382,9 @@ public class BSShapeMesh : BSShape
374 382
375 // Check to see if mesh was created (might require an asset). 383 // Check to see if mesh was created (might require an asset).
376 newShape = VerifyMeshCreated(physicsScene, newShape, prim); 384 newShape = VerifyMeshCreated(physicsScene, newShape, prim);
377 if (!newShape.isNativeShape || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed) 385 if (!newShape.isNativeShape
386 || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedMeshing
387 || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedAssetFetch)
378 { 388 {
379 // If a mesh was what was created, remember the built shape for later sharing. 389 // If a mesh was what was created, remember the built shape for later sharing.
380 // Also note that if meshing failed we put it in the mesh list as there is nothing else to do about the mesh. 390 // Also note that if meshing failed we put it in the mesh list as there is nothing else to do about the mesh.
@@ -517,7 +527,7 @@ public class BSShapeMesh : BSShape
517 else 527 else
518 { 528 {
519 // Force the asset condition to 'failed' so we won't try to keep fetching and processing this mesh. 529 // Force the asset condition to 'failed' so we won't try to keep fetching and processing this mesh.
520 prim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed; 530 prim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedMeshing;
521 physicsScene.Logger.DebugFormat("{0} All mesh triangles degenerate. Prim {1} at {2} in {3}", 531 physicsScene.Logger.DebugFormat("{0} All mesh triangles degenerate. Prim {1} at {2} in {3}",
522 LogHeader, prim.PhysObjectName, prim.RawPosition, physicsScene.Name); 532 LogHeader, prim.PhysObjectName, prim.RawPosition, physicsScene.Name);
523 physicsScene.DetailLog("{0},BSShapeMesh.CreatePhysicalMesh,allDegenerate,key={1}", prim.LocalID, newMeshKey); 533 physicsScene.DetailLog("{0},BSShapeMesh.CreatePhysicalMesh,allDegenerate,key={1}", prim.LocalID, newMeshKey);
@@ -559,7 +569,9 @@ public class BSShapeHull : BSShape
559 569
560 // Check to see if hull was created (might require an asset). 570 // Check to see if hull was created (might require an asset).
561 newShape = VerifyMeshCreated(physicsScene, newShape, prim); 571 newShape = VerifyMeshCreated(physicsScene, newShape, prim);
562 if (!newShape.isNativeShape || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed) 572 if (!newShape.isNativeShape
573 || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedMeshing
574 || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedAssetFetch)
563 { 575 {
564 // If a mesh was what was created, remember the built shape for later sharing. 576 // If a mesh was what was created, remember the built shape for later sharing.
565 Hulls.Add(newHullKey, retHull); 577 Hulls.Add(newHullKey, retHull);
@@ -1079,10 +1091,13 @@ public class BSShapeGImpact : BSShape
1079 // Check to see if mesh was created (might require an asset). 1091 // Check to see if mesh was created (might require an asset).
1080 newShape = VerifyMeshCreated(physicsScene, newShape, prim); 1092 newShape = VerifyMeshCreated(physicsScene, newShape, prim);
1081 newShape.shapeKey = newMeshKey; 1093 newShape.shapeKey = newMeshKey;
1082 if (!newShape.isNativeShape || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed) 1094 if (!newShape.isNativeShape
1095 || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedMeshing
1096 || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedAssetFetch)
1083 { 1097 {
1084 // If a mesh was what was created, remember the built shape for later sharing. 1098 // If a mesh was what was created, remember the built shape for later sharing.
1085 // Also note that if meshing failed we put it in the mesh list as there is nothing else to do about the mesh. 1099 // Also note that if meshing failed we put it in the mesh list as there is nothing
1100 // else to do about the mesh.
1086 GImpacts.Add(newMeshKey, retGImpact); 1101 GImpacts.Add(newMeshKey, retGImpact);
1087 } 1102 }
1088 1103
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
index df1da63..1e01526 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
@@ -2,11 +2,6 @@ CURRENT PROBLEMS TO FIX AND/OR LOOK AT
2================================================= 2=================================================
3Script changing rotation of child prim while vehicle moving (eg turning wheel) causes 3Script changing rotation of child prim while vehicle moving (eg turning wheel) causes
4 the wheel to appear to jump back. Looks like sending position from previous update. 4 the wheel to appear to jump back. Looks like sending position from previous update.
5Vehicle ride, get up, ride again. Second time vehicle does not act correctly.
6 Have to rez new vehicle and delete the old to fix situation.
7Hitting RESET on Nebadon's vehicle while riding causes vehicle to get into odd
8 position state where it will not settle onto ground properly, etc
9Two of Nebadon vehicles in a sim max the CPU. This is new.
10Enable vehicle border crossings (at least as poorly as ODE) 5Enable vehicle border crossings (at least as poorly as ODE)
11 Terrain skirts 6 Terrain skirts
12 Avatar created in previous region and not new region when crossing border 7 Avatar created in previous region and not new region when crossing border
@@ -23,24 +18,17 @@ vehicle angular banking
23Center-of-gravity 18Center-of-gravity
24Vehicle angular deflection 19Vehicle angular deflection
25 Preferred orientation angular correction fix 20 Preferred orientation angular correction fix
26when should angular and linear motor targets be zeroed? when selected?
27 Need a vehicle.clear()? Or an 'else' in prestep if not physical.
28Teravus llMoveToTarget script debug 21Teravus llMoveToTarget script debug
29 Mixing of hover, buoyancy/gravity, moveToTarget, into one force 22 Mixing of hover, buoyancy/gravity, moveToTarget, into one force
30 Setting hover height to zero disables hover even if hover flags are on (from SL wiki) 23 Setting hover height to zero disables hover even if hover flags are on (from SL wiki)
31limitMotorUp calibration (more down?) 24limitMotorUp calibration (more down?)
32llRotLookAt 25llRotLookAt
33llLookAt 26llLookAt
34Avatars walking up stairs (HALF DONE) 27Convert to avatar mesh capsule. Include rotation of capsule.
35Avatar movement
36 flying into a wall doesn't stop avatar who keeps appearing to move through the obstacle (DONE)
37 walking up stairs is not calibrated correctly (stairs out of Kepler cabin) (DONE)
38 avatar capsule rotation completed (NOT DONE - Bullet's capsule shape is not the solution)
39Vehicle script tuning/debugging 28Vehicle script tuning/debugging
40 Avanti speed script 29 Avanti speed script
41 Weapon shooter script 30 Weapon shooter script
42Move material definitions (friction, ...) into simulator. 31Move material definitions (friction, ...) into simulator.
43Add material densities to the material types.
44One sided meshes? Should terrain be built into a closed shape? 32One sided meshes? Should terrain be built into a closed shape?
45 When meshes get partially wedged into the terrain, they cannot push themselves out. 33 When meshes get partially wedged into the terrain, they cannot push themselves out.
46 It is possible that Bullet processes collisions whether entering or leaving a mesh. 34 It is possible that Bullet processes collisions whether entering or leaving a mesh.
@@ -53,12 +41,8 @@ LINEAR_MOTOR_DIRECTION values should be clamped to reasonable numbers.
53 Same for other velocity settings. 41 Same for other velocity settings.
54UBit improvements to remove rubber-banding of avatars sitting on vehicle child prims: 42UBit improvements to remove rubber-banding of avatars sitting on vehicle child prims:
55 https://github.com/UbitUmarov/Ubit-opensim 43 https://github.com/UbitUmarov/Ubit-opensim
56Border crossing with linked vehicle causes crash
57 20121129.1411: editting/moving phys object across region boundries causes crash
58 getPos-> btRigidBody::upcast -> getBodyType -> BOOM
59Vehicles (Move smoothly) 44Vehicles (Move smoothly)
60Some vehicles should not be able to turn if no speed or off ground. 45Some vehicles should not be able to turn if no speed or off ground.
61What to do if vehicle and prim buoyancy differ?
62Cannot edit/move a vehicle being ridden: it jumps back to the origional position. 46Cannot edit/move a vehicle being ridden: it jumps back to the origional position.
63Neb car jiggling left and right 47Neb car jiggling left and right
64 Happens on terrain and any other mesh object. Flat cubes are much smoother. 48 Happens on terrain and any other mesh object. Flat cubes are much smoother.
@@ -68,8 +52,6 @@ For limitMotorUp, use raycast down to find if vehicle is in the air.
68Verify llGetVel() is returning a smooth and good value for vehicle movement. 52Verify llGetVel() is returning a smooth and good value for vehicle movement.
69llGetVel() should return the root's velocity if requested in a child prim. 53llGetVel() should return the root's velocity if requested in a child prim.
70Implement function efficiency for lineaar and angular motion. 54Implement function efficiency for lineaar and angular motion.
71After getting off a vehicle, the root prim is phantom (can be walked through)
72 Need to force a position update for the root prim after compound shape destruction
73Linkset explosion after three "rides" on Nebadon lite vehicle (LinksetConstraint) 55Linkset explosion after three "rides" on Nebadon lite vehicle (LinksetConstraint)
74Remove vehicle angular velocity zeroing in BSPrim.UpdateProperties(). 56Remove vehicle angular velocity zeroing in BSPrim.UpdateProperties().
75 A kludge that isn't fixing the real problem of Bullet adding extra motion. 57 A kludge that isn't fixing the real problem of Bullet adding extra motion.
@@ -78,11 +60,10 @@ Incorporate inter-relationship of angular corrections. For instance, angularDefl
78 creates over-correction and over-shoot and wabbling. 60 creates over-correction and over-shoot and wabbling.
79Vehicle attributes are not restored when a vehicle is rezzed on region creation 61Vehicle attributes are not restored when a vehicle is rezzed on region creation
80 Create vehicle, setup vehicle properties, restart region, vehicle is not reinitialized. 62 Create vehicle, setup vehicle properties, restart region, vehicle is not reinitialized.
63What to do if vehicle and prim buoyancy differ?
81 64
82GENERAL TODO LIST: 65GENERAL TODO LIST:
83================================================= 66=================================================
84Explore btGImpactMeshShape as alternative to convex hulls for simplified physical objects.
85 Regular triangle meshes don't do physical collisions.
86Resitution of a prim works on another prim but not on terrain. 67Resitution of a prim works on another prim but not on terrain.
87 The dropped prim doesn't bounce properly on the terrain. 68 The dropped prim doesn't bounce properly on the terrain.
88Add a sanity check for PIDTarget location. 69Add a sanity check for PIDTarget location.
@@ -359,4 +340,25 @@ Lock axis (DONE 20130401)
359Terrain detail: double terrain mesh detail (DONE) 340Terrain detail: double terrain mesh detail (DONE)
360Use the HACD convex hull routine in Bullet rather than the C# version. 341Use the HACD convex hull routine in Bullet rather than the C# version.
361 Speed up hullifying large meshes. (DONE) 342 Speed up hullifying large meshes. (DONE)
343Vehicle ride, get up, ride again. Second time vehicle does not act correctly.
344 Have to rez new vehicle and delete the old to fix situation.
345 (DONE 20130520: normalize rotations)
346Hitting RESET on Nebadon's vehicle while riding causes vehicle to get into odd
347 position state where it will not settle onto ground properly, etc
348 (DONE 20130520: normalize rotations)
349Two of Nebadon vehicles in a sim max the CPU. This is new.
350 (DONE 20130520: two problems: if asset failed to mesh, constantly refetched
351 asset; vehicle was sending too many messages to all linkset members)
352Add material densities to the material types. (WILL NOT BE DONE: not how it is done)
353Avatars walking up stairs (DONE)
354Avatar movement
355 flying into a wall doesn't stop avatar who keeps appearing to move through the obstacle (DONE)
356 walking up stairs is not calibrated correctly (stairs out of Kepler cabin) (DONE)
357 avatar capsule rotation completed (NOT DONE - Bullet's capsule shape is not the solution)
358After getting off a vehicle, the root prim is phantom (can be walked through)
359 Need to force a position update for the root prim after compound shape destruction
360 (DONE)
361Explore btGImpactMeshShape as alternative to convex hulls for simplified physical objects.
362 Regular triangle meshes don't do physical collisions.
363 (DONE: discovered GImpact is VERY CPU intensive)
362 364
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ec5aa49..e1630b3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4665,35 +4665,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4665 public LSL_Vector llRot2Axis(LSL_Rotation rot) 4665 public LSL_Vector llRot2Axis(LSL_Rotation rot)
4666 { 4666 {
4667 m_host.AddScriptLPS(1); 4667 m_host.AddScriptLPS(1);
4668 double x,y,z; 4668 double x, y, z;
4669 4669
4670 if (rot.s > 1) // normalization needed 4670 if (Math.Abs(rot.s) > 1) // normalization needed
4671 { 4671 rot.Normalize();
4672 double length = Math.Sqrt(rot.x * rot.x + rot.y * rot.y +
4673 rot.z * rot.z + rot.s * rot.s);
4674
4675 rot.x /= length;
4676 rot.y /= length;
4677 rot.z /= length;
4678 rot.s /= length;
4679
4680 }
4681 4672
4682 // double angle = 2 * Math.Acos(rot.s);
4683 double s = Math.Sqrt(1 - rot.s * rot.s); 4673 double s = Math.Sqrt(1 - rot.s * rot.s);
4684 if (s < 0.001) 4674 if (s < 0.001)
4685 { 4675 {
4686 x = 1; 4676 return new LSL_Vector(1, 0, 0);
4687 y = z = 0;
4688 } 4677 }
4689 else 4678 else
4690 { 4679 {
4691 x = rot.x / s; // normalise axis 4680 double invS = 1.0 / s;
4692 y = rot.y / s; 4681 if (rot.s < 0) invS = -invS;
4693 z = rot.z / s; 4682 return new LSL_Vector(rot.x * invS, rot.y * invS, rot.z * invS);
4694 } 4683 }
4695
4696 return new LSL_Vector(x,y,z);
4697 } 4684 }
4698 4685
4699 4686
@@ -4702,18 +4689,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4702 { 4689 {
4703 m_host.AddScriptLPS(1); 4690 m_host.AddScriptLPS(1);
4704 4691
4705 if (rot.s > 1) // normalization needed 4692 if (Math.Abs(rot.s) > 1) // normalization needed
4706 { 4693 rot.Normalize();
4707 double length = Math.Sqrt(rot.x * rot.x + rot.y * rot.y +
4708 rot.z * rot.z + rot.s * rot.s);
4709
4710 rot.x /= length;
4711 rot.y /= length;
4712 rot.z /= length;
4713 rot.s /= length;
4714 }
4715 4694
4716 double angle = 2 * Math.Acos(rot.s); 4695 double angle = 2 * Math.Acos(rot.s);
4696 if (angle > Math.PI)
4697 angle = 2 * Math.PI - angle;
4717 4698
4718 return angle; 4699 return angle;
4719 } 4700 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 9ca5ca9..50f9377 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -371,6 +371,31 @@ namespace OpenSim.Region.ScriptEngine.Shared
371 371
372 #endregion 372 #endregion
373 373
374 #region Methods
375 public Quaternion Normalize()
376 {
377 double length = Math.Sqrt(x * x + y * y + z * z + s * s);
378 if (length < float.Epsilon)
379 {
380 x = 0;
381 y = 0;
382 z = 0;
383 s = 1;
384 }
385 else
386 {
387
388 double invLength = 1.0 / length;
389 x *= invLength;
390 y *= invLength;
391 z *= invLength;
392 s *= invLength;
393 }
394
395 return this;
396 }
397 #endregion
398
374 #region Overriders 399 #region Overriders
375 400
376 public override int GetHashCode() 401 public override int GetHashCode()