From 138722482175ba7571f8086d9b9172c9975543a6 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 7 Jun 2013 20:09:10 -0400 Subject: Ensure selected module is the only active one --- OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs index bf24030..2bb24ae 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs @@ -57,6 +57,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile public void Initialise(IConfigSource config) { + if(config.Configs["UserProfiles"] != null) + return; + m_log.DebugFormat("[PROFILE MODULE]: Basic Profile Module enabled"); m_Enabled = true; } -- cgit v1.1 From 1cb1245d847fad5a088e0bb727433ee1e53d81da Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 7 Jun 2013 20:14:39 -0400 Subject: SQLite support for UserProfiles --- OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index a97c9b4..72e557c 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -130,6 +130,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles if (profileConfig == null) { + m_log.Debug("[PROFILES]: UserProfiles disabled, no configuration"); Enabled = false; return; } -- cgit v1.1 From 75e4af9d3959b666b652013d2de4d5f4625f9fa2 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sat, 8 Jun 2013 11:00:05 -0400 Subject: Catch exception triggered by incoming avatars using legacy profiles --- .../CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 72e557c..322addd 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -1317,7 +1317,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles Stream rstream = webResponse.GetResponseStream(); OSDMap response = new OSDMap(); - response = (OSDMap)OSDParser.DeserializeJson(rstream); + try + { + response = (OSDMap)OSDParser.DeserializeJson(rstream); + } + catch (Exception e) + { + m_log.DebugFormat("[PROFILES]: JsonRpcRequest Error {0} - remote user with legacy profiles?", e.Message); + return false; + } + if(response.ContainsKey("error")) { data = response["error"]; -- cgit v1.1 From 7de0912a979746c1e1301c080c49152ae7cd57b5 Mon Sep 17 00:00:00 2001 From: Talun Date: Mon, 10 Jun 2013 09:32:14 +0100 Subject: Mantis 5346: llAxisAngle2Rot() should normalize before computing Corrected to agree with http://wiki.secondlife.com/wiki/Llaxisangle2rot#Deep_Notes to normalise the vector before computing the quaternion Signed-off-by: dahlia --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index cd6092d..ec5aa49 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4651,6 +4651,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api s = Math.Cos(angle * 0.5); t = Math.Sin(angle * 0.5); // temp value to avoid 2 more sin() calcs + axis = LSL_Vector.Norm(axis); x = axis.x * t; y = axis.y * t; z = axis.z * t; -- cgit v1.1 From 57141e34bf415861a8acfdaa0086e0e651c679d9 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Mon, 10 Jun 2013 13:26:19 -0700 Subject: Remove Temporary from use to shortcut asset stores. The Local property differentiates between local & grid storage. The Temporary property just says that which service handles the it, the asset can be safely removed in the future. --- OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | 2 +- .../ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index d221d68..9f58175 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs @@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset // a copy of the local asset. m_Cache.Cache(asset); - if (asset.Temporary || asset.Local) + if (asset.Local) { if (m_Cache != null) m_Cache.Cache(asset); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index 480cd69..52b1039 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs @@ -258,7 +258,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (m_Cache != null) m_Cache.Cache(asset); - if (asset.Temporary || asset.Local) + if (asset.Local) { // m_log.DebugFormat( // "[LOCAL ASSET SERVICE CONNECTOR]: Returning asset {0} {1} without querying database since status Temporary = {2}, Local = {3}", -- cgit v1.1 From 795acaa6aa8e32ad0281226208a6b1bbc2292bf5 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 10 Jun 2013 14:12:45 -0700 Subject: BulletSim: add failure flag for meshing failure vs asset fetch failure so error messages make more sense. Change some BulletSim status log messages from WARN to INFO. Update TODO list. --- .../Region/Physics/BulletSPlugin/BSPhysObject.cs | 2 +- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 4 +- OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs | 35 ++++++++++++----- .../Region/Physics/BulletSPlugin/BulletSimTODO.txt | 44 +++++++++++----------- 4 files changed, 51 insertions(+), 34 deletions(-) (limited to 'OpenSim/Region') 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 // The asset state is first 'Unknown' then 'Waiting' then either 'Failed' or 'Fetched'. public enum PrimAssetCondition { - Unknown, Waiting, Failed, Fetched + Unknown, Waiting, FailedAssetFetch, FailedMeshing, Fetched } public PrimAssetCondition PrimAssetState { get; set; } 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 TerrainManager.CreateInitialGroundPlaneAndTerrain(); // Put some informational messages into the log file. - m_log.WarnFormat("{0} Linksets implemented with {1}", LogHeader, (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation); + m_log.InfoFormat("{0} Linksets implemented with {1}", LogHeader, (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation); InTaintTime = false; m_initialized = true; @@ -374,7 +374,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters } else { - m_log.WarnFormat("{0} Selected bullet engine {1} -> {2}/{3}", LogHeader, engineName, ret.BulletEngineName, ret.BulletEngineVersion); + m_log.InfoFormat("{0} Selected bullet engine {1} -> {2}/{3}", LogHeader, engineName, ret.BulletEngineName, ret.BulletEngineVersion); } 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 // Prevent trying to keep fetching the mesh by declaring failure. if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Fetched) { - prim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed; + prim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedMeshing; physicsScene.Logger.WarnFormat("{0} Fetched asset would not mesh. {1}, texture={2}", LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture); physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,setFailed,objNam={1},tex={2}", @@ -177,7 +177,8 @@ public abstract class BSShape { // If this mesh has an underlying asset and we have not failed getting it before, fetch the asset if (prim.BaseShape.SculptEntry - && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.Failed + && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.FailedAssetFetch + && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.FailedMeshing && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.Waiting && prim.BaseShape.SculptTexture != OMV.UUID.Zero ) @@ -219,7 +220,7 @@ public abstract class BSShape } if (!assetFound) { - yprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed; + yprim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedAssetFetch; } physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,fetchAssetCallback,found={1},isSculpt={2},ids={3}", yprim.LocalID, assetFound, yprim.BaseShape.SculptEntry, mismatchIDs ); @@ -227,7 +228,7 @@ public abstract class BSShape } else { - xprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed; + xprim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedAssetFetch; physicsScene.Logger.ErrorFormat("{0} Physical object requires asset but no asset provider. Name={1}", LogHeader, physicsScene.Name); } @@ -235,13 +236,20 @@ public abstract class BSShape } else { - if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed) + if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedAssetFetch) { physicsScene.Logger.WarnFormat("{0} Mesh failed to fetch asset. obj={1}, texture={2}", LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture); physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,wasFailed,objNam={1},tex={2}", prim.LocalID, prim.PhysObjectName, prim.BaseShape.SculptTexture); } + if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedMeshing) + { + physicsScene.Logger.WarnFormat("{0} Mesh asset would not mesh. obj={1}, texture={2}", + LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture); + physicsScene.DetailLog("{0},BSShape.VerifyMeshCreated,wasFailedMeshing,objNam={1},tex={2}", + prim.LocalID, prim.PhysObjectName, prim.BaseShape.SculptTexture); + } } } @@ -374,7 +382,9 @@ public class BSShapeMesh : BSShape // Check to see if mesh was created (might require an asset). newShape = VerifyMeshCreated(physicsScene, newShape, prim); - if (!newShape.isNativeShape || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed) + if (!newShape.isNativeShape + || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedMeshing + || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedAssetFetch) { // If a mesh was what was created, remember the built shape for later sharing. // 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 else { // Force the asset condition to 'failed' so we won't try to keep fetching and processing this mesh. - prim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed; + prim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedMeshing; physicsScene.Logger.DebugFormat("{0} All mesh triangles degenerate. Prim {1} at {2} in {3}", LogHeader, prim.PhysObjectName, prim.RawPosition, physicsScene.Name); physicsScene.DetailLog("{0},BSShapeMesh.CreatePhysicalMesh,allDegenerate,key={1}", prim.LocalID, newMeshKey); @@ -559,7 +569,9 @@ public class BSShapeHull : BSShape // Check to see if hull was created (might require an asset). newShape = VerifyMeshCreated(physicsScene, newShape, prim); - if (!newShape.isNativeShape || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed) + if (!newShape.isNativeShape + || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedMeshing + || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedAssetFetch) { // If a mesh was what was created, remember the built shape for later sharing. Hulls.Add(newHullKey, retHull); @@ -1079,10 +1091,13 @@ public class BSShapeGImpact : BSShape // Check to see if mesh was created (might require an asset). newShape = VerifyMeshCreated(physicsScene, newShape, prim); newShape.shapeKey = newMeshKey; - if (!newShape.isNativeShape || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed) + if (!newShape.isNativeShape + || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedMeshing + || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.FailedAssetFetch) { // If a mesh was what was created, remember the built shape for later sharing. - // Also note that if meshing failed we put it in the mesh list as there is nothing else to do about the mesh. + // Also note that if meshing failed we put it in the mesh list as there is nothing + // else to do about the mesh. GImpacts.Add(newMeshKey, retGImpact); } 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 ================================================= Script changing rotation of child prim while vehicle moving (eg turning wheel) causes the wheel to appear to jump back. Looks like sending position from previous update. -Vehicle ride, get up, ride again. Second time vehicle does not act correctly. - Have to rez new vehicle and delete the old to fix situation. -Hitting RESET on Nebadon's vehicle while riding causes vehicle to get into odd - position state where it will not settle onto ground properly, etc -Two of Nebadon vehicles in a sim max the CPU. This is new. Enable vehicle border crossings (at least as poorly as ODE) Terrain skirts Avatar created in previous region and not new region when crossing border @@ -23,24 +18,17 @@ vehicle angular banking Center-of-gravity Vehicle angular deflection Preferred orientation angular correction fix -when should angular and linear motor targets be zeroed? when selected? - Need a vehicle.clear()? Or an 'else' in prestep if not physical. Teravus llMoveToTarget script debug Mixing of hover, buoyancy/gravity, moveToTarget, into one force Setting hover height to zero disables hover even if hover flags are on (from SL wiki) limitMotorUp calibration (more down?) llRotLookAt llLookAt -Avatars walking up stairs (HALF DONE) -Avatar movement - flying into a wall doesn't stop avatar who keeps appearing to move through the obstacle (DONE) - walking up stairs is not calibrated correctly (stairs out of Kepler cabin) (DONE) - avatar capsule rotation completed (NOT DONE - Bullet's capsule shape is not the solution) +Convert to avatar mesh capsule. Include rotation of capsule. Vehicle script tuning/debugging Avanti speed script Weapon shooter script Move material definitions (friction, ...) into simulator. -Add material densities to the material types. One sided meshes? Should terrain be built into a closed shape? When meshes get partially wedged into the terrain, they cannot push themselves out. 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. Same for other velocity settings. UBit improvements to remove rubber-banding of avatars sitting on vehicle child prims: https://github.com/UbitUmarov/Ubit-opensim -Border crossing with linked vehicle causes crash - 20121129.1411: editting/moving phys object across region boundries causes crash - getPos-> btRigidBody::upcast -> getBodyType -> BOOM Vehicles (Move smoothly) Some vehicles should not be able to turn if no speed or off ground. -What to do if vehicle and prim buoyancy differ? Cannot edit/move a vehicle being ridden: it jumps back to the origional position. Neb car jiggling left and right 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. Verify llGetVel() is returning a smooth and good value for vehicle movement. llGetVel() should return the root's velocity if requested in a child prim. Implement function efficiency for lineaar and angular motion. -After getting off a vehicle, the root prim is phantom (can be walked through) - Need to force a position update for the root prim after compound shape destruction Linkset explosion after three "rides" on Nebadon lite vehicle (LinksetConstraint) Remove vehicle angular velocity zeroing in BSPrim.UpdateProperties(). 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 creates over-correction and over-shoot and wabbling. Vehicle attributes are not restored when a vehicle is rezzed on region creation Create vehicle, setup vehicle properties, restart region, vehicle is not reinitialized. +What to do if vehicle and prim buoyancy differ? GENERAL TODO LIST: ================================================= -Explore btGImpactMeshShape as alternative to convex hulls for simplified physical objects. - Regular triangle meshes don't do physical collisions. Resitution of a prim works on another prim but not on terrain. The dropped prim doesn't bounce properly on the terrain. Add a sanity check for PIDTarget location. @@ -359,4 +340,25 @@ Lock axis (DONE 20130401) Terrain detail: double terrain mesh detail (DONE) Use the HACD convex hull routine in Bullet rather than the C# version. Speed up hullifying large meshes. (DONE) +Vehicle ride, get up, ride again. Second time vehicle does not act correctly. + Have to rez new vehicle and delete the old to fix situation. + (DONE 20130520: normalize rotations) +Hitting RESET on Nebadon's vehicle while riding causes vehicle to get into odd + position state where it will not settle onto ground properly, etc + (DONE 20130520: normalize rotations) +Two of Nebadon vehicles in a sim max the CPU. This is new. + (DONE 20130520: two problems: if asset failed to mesh, constantly refetched + asset; vehicle was sending too many messages to all linkset members) +Add material densities to the material types. (WILL NOT BE DONE: not how it is done) +Avatars walking up stairs (DONE) +Avatar movement + flying into a wall doesn't stop avatar who keeps appearing to move through the obstacle (DONE) + walking up stairs is not calibrated correctly (stairs out of Kepler cabin) (DONE) + avatar capsule rotation completed (NOT DONE - Bullet's capsule shape is not the solution) +After getting off a vehicle, the root prim is phantom (can be walked through) + Need to force a position update for the root prim after compound shape destruction + (DONE) +Explore btGImpactMeshShape as alternative to convex hulls for simplified physical objects. + Regular triangle meshes don't do physical collisions. + (DONE: discovered GImpact is VERY CPU intensive) -- cgit v1.1 From 82e3b9a6e0f0e1731df9080e4de63bc7c7079ec4 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Mon, 10 Jun 2013 15:14:55 -0700 Subject: Fix test for adding temporary assets. Code for non-local temporary assets is there but commented out. --- .../Asset/Tests/AssetConnectorTests.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region') 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 LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); lasc.Initialise(config); + // If it is local, it should not be stored AssetBase a1 = AssetHelpers.CreateNotecardAsset(); + a1.Local = true; a1.Temporary = true; lasc.Store(a1); @@ -102,6 +104,24 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests Assert.That(lasc.GetData(a1.ID), Is.Null); Assert.That(lasc.GetMetadata(a1.ID), Is.Null); + // If it is remote, it should be stored + // AssetBase a2 = AssetHelpers.CreateNotecardAsset(); + // a2.Local = false; + // a2.Temporary = true; + + // lasc.Store(a2); + + // AssetBase retreivedA2 = lasc.Get(a2.ID); + // Assert.That(retreivedA2.ID, Is.EqualTo(a2.ID)); + // Assert.That(retreivedA2.Metadata.ID, Is.EqualTo(a2.Metadata.ID)); + // Assert.That(retreivedA2.Data.Length, Is.EqualTo(a2.Data.Length)); + + // AssetMetadata retrievedA2Metadata = lasc.GetMetadata(a2.ID); + // Assert.That(retrievedA2Metadata.ID, Is.EqualTo(a2.ID)); + + // byte[] retrievedA2Data = lasc.GetData(a2.ID); + // Assert.That(retrievedA2Data.Length, Is.EqualTo(a2.Data.Length)); + // TODO: Add cache and check that this does receive a copy of the asset } -- cgit v1.1 From a949556c4ea74c993fc15bcfdcbc672d9f971897 Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 10 Jun 2013 16:42:49 -0700 Subject: add a Normalize() method for LSL_Rotation --- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 9ca5ca9..f6d94a3 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 #endregion + #region Methods + public Quaternion Normalize() + { + double length = Math.Sqrt(x * x + y * y + z * z + s * s); + if (length < float.Epsilon) + { + x = 1; + y = 0; + z = 0; + s = 0; + } + else + { + + double invLength = 1.0 / length; + x *= invLength; + y *= invLength; + z *= invLength; + s *= invLength; + } + + return this; + } + #endregion + #region Overriders public override int GetHashCode() -- cgit v1.1 From 1c7fbb86c21f79938e4ea9dafef1e8d8f4a29a8d Mon Sep 17 00:00:00 2001 From: teravus Date: Mon, 10 Jun 2013 18:47:08 -0500 Subject: Check For NaN and Infinity in llRot2Axis/Angle Fixes mantis #6669 --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ec5aa49..9427061 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4692,7 +4692,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api y = rot.y / s; z = rot.z / s; } - + if ((double.IsNaN(x)) || double.IsInfinity(x)) x = 0; + if ((double.IsNaN(y)) || double.IsInfinity(y)) y = 0; + if ((double.IsNaN(z)) || double.IsInfinity(z)) z = 0; return new LSL_Vector(x,y,z); } @@ -4714,7 +4716,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } double angle = 2 * Math.Acos(rot.s); - + if ((double.IsNaN(angle)) || double.IsInfinity(angle)) angle = 0; return angle; } -- cgit v1.1