From 827b0fb1993c6f9b1289931a1ac38ff2b810952c Mon Sep 17 00:00:00 2001 From: opensim Date: Wed, 30 Sep 2009 18:51:02 +0200 Subject: Commit initial version of KittoFlora's vehicle changes --- .../Shared/Api/Implementation/LSL_Api.cs | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 02be983..edcf11c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -96,17 +96,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_localID = localID; m_itemID = itemID; - m_ScriptDelayFactor = m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f); - m_ScriptDistanceFactor = m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f); - m_MinTimerInterval = m_ScriptEngine.Config.GetFloat("MinTimerInterval", 0.5f); - m_automaticLinkPermission = m_ScriptEngine.Config.GetBoolean("AutomaticLinkPermission", false); - m_scriptConsoleChannel = m_ScriptEngine.Config.GetInt("ScriptConsoleChannel", 0); - m_scriptConsoleChannelEnabled = (m_scriptConsoleChannel != 0); - m_notecardLineReadCharsMax = m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255); + m_ScriptDelayFactor = + m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f); + m_ScriptDistanceFactor = + m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f); + m_MinTimerInterval = + m_ScriptEngine.Config.GetFloat("MinTimerInterval", 0.5f); + m_automaticLinkPermission = + m_ScriptEngine.Config.GetBoolean("AutomaticLinkPermission", false); + m_notecardLineReadCharsMax = + m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255); if (m_notecardLineReadCharsMax > 65535) m_notecardLineReadCharsMax = 65535; - m_TransferModule = m_ScriptEngine.World.RequestModuleInterface(); + m_TransferModule = + m_ScriptEngine.World.RequestModuleInterface(); m_UrlModule = m_ScriptEngine.World.RequestModuleInterface(); if (m_UrlModule != null) { @@ -1969,7 +1973,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { part.UpdateRotation(rot); // Update rotation does not move the object in the physics scene if it's a linkset. - part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; + +//KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type +// part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; } /// @@ -6747,15 +6753,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // try to let this work as in SL... if (part.ParentID == 0) { - // special case: If we are root, rotate - // complete SOG to new rotation + // special case: If we are root, rotate complete SOG to new rotation SetRot(part, Rot2Quaternion(q)); } else { - // we are a child. The rotation values - // will be set to the one of root modified - // by rot, as in SL. Don't ask. + // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. SceneObjectGroup group = part.ParentGroup; if (group != null) // a bit paranoid, maybe { -- cgit v1.1 From 212e132e79f868fd3bb9bcf9ef2c13eb12f8c14e Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 2 Oct 2009 00:47:01 +0100 Subject: Revert "* Adding Scale to EntityBase * Fixing the incorrect initialization of EntityBase.Rotation * Removed SceneObjectGroup.GroupRotation and added overrides for Scale/Rotation/Velocity" This reverts commit 39842eb4af3b5a8c52d56c0f7f05ad54f0651bb0. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++---- OpenSim/Region/ScriptEngine/Shared/Helpers.cs | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 3051609..11ae661 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2013,10 +2013,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api q = avatar.Rotation; // Currently infrequently updated so may be inaccurate } else - q = part.ParentGroup.Rotation; // Likely never get here but just in case + q = part.ParentGroup.GroupRotation; // Likely never get here but just in case } else - q = part.ParentGroup.Rotation; // just the group rotation + q = part.ParentGroup.GroupRotation; // just the group rotation return new LSL_Rotation(q.X, q.Y, q.Z, q.W); } q = part.GetWorldRotation(); @@ -7184,10 +7184,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else q = avatar.Rotation; // Currently infrequently updated so may be inaccurate else - q = m_host.ParentGroup.Rotation; // Likely never get here but just in case + q = m_host.ParentGroup.GroupRotation; // Likely never get here but just in case } else - q = m_host.ParentGroup.Rotation; // just the group rotation + q = m_host.ParentGroup.GroupRotation; // just the group rotation return new LSL_Rotation(q.X, q.Y, q.Z, q.W); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs index 84ccafe..4855d64 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs @@ -218,14 +218,16 @@ namespace OpenSim.Region.ScriptEngine.Shared } } - Vector3 absPos = part.AbsolutePosition; - Position = new LSL_Types.Vector3(absPos.X, absPos.Y, absPos.Z); + Position = new LSL_Types.Vector3(part.AbsolutePosition.X, + part.AbsolutePosition.Y, + part.AbsolutePosition.Z); - Quaternion wr = part.ParentGroup.Rotation; + Quaternion wr = part.ParentGroup.GroupRotation; Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W); - Vector3 vel = part.Velocity; - Velocity = new LSL_Types.Vector3(vel.X, vel.Y, vel.Z); + Velocity = new LSL_Types.Vector3(part.Velocity.X, + part.Velocity.Y, + part.Velocity.Z); } } -- cgit v1.1 From 47d8b6c5f50a494bca520e2a8532c59561339963 Mon Sep 17 00:00:00 2001 From: Snowcrash Date: Tue, 20 Oct 2009 15:51:19 +0200 Subject: Fix rounding error in PRIM_SIZE portion of llSetPrimitiveParams --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6e17639..c3e89f6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1263,11 +1263,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected void SetScale(SceneObjectPart part, LSL_Vector scale) { // TODO: this needs to trigger a persistance save as well - if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) return; - - if (scale.x < 0.01 || scale.y < 0.01 || scale.z < 0.01) + // scale.x < 0.01 in a manner which handles rounding errors + if (Math.Round(scale.x - 0.01) > 0.0 || Math.Round(scale.y - 0.01) > 0.0 || Math.Round(scale.z - 0.01) > 0.0) return; if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) @@ -1279,12 +1278,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (scale.z > World.m_maxPhys) scale.z = World.m_maxPhys; } + if (scale.x > World.m_maxNonphys) scale.x = World.m_maxNonphys; if (scale.y > World.m_maxNonphys) scale.y = World.m_maxNonphys; if (scale.z > World.m_maxNonphys) scale.z = World.m_maxNonphys; + Vector3 tmp = part.Scale; tmp.X = (float)scale.x; tmp.Y = (float)scale.y; -- cgit v1.1 From 84ac0f56f5c6a52f975efa125e9128d559d47d0e Mon Sep 17 00:00:00 2001 From: Snowcrash Date: Thu, 22 Oct 2009 15:48:21 +0200 Subject: Fixing the patch to the patch --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c3e89f6..435b6e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1265,9 +1265,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // TODO: this needs to trigger a persistance save as well if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) return; - // scale.x < 0.01 in a manner which handles rounding errors - if (Math.Round(scale.x - 0.01) > 0.0 || Math.Round(scale.y - 0.01) > 0.0 || Math.Round(scale.z - 0.01) > 0.0) - return; + if (scale.x < 0.01) + scale.x = 0.01; + if (scale.y < 0.01) + scale.y = 0.01; + if (scale.z < 0.01) + scale.z = 0.01; if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) { -- cgit v1.1