From 867d72c9569e672d99dc5f50aca6b1a4f2ddf906 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 7 Jul 2008 20:12:14 +0000 Subject: change SitTarget calls from functions to properties --- OpenSim/Data/MSSQL/MSSQLDataStore.cs | 29 +++++------ OpenSim/Data/MySQL/MySQLDataStore.cs | 29 +++++------ OpenSim/Data/SQLite/SQLiteRegionData.cs | 29 +++++------ .../Region/Environment/Scenes/SceneObjectPart.cs | 56 +++++++--------------- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 12 ++--- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 3 +- .../Shared/Api/Implementation/LSL_Api.cs | 3 +- .../OpenSim.DataStore.MSSQL/MSSQLDataStore.cs | 29 +++++------ 8 files changed, 87 insertions(+), 103 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MSSQL/MSSQLDataStore.cs b/OpenSim/Data/MSSQL/MSSQLDataStore.cs index 4cb2b45..d9d41e0 100644 --- a/OpenSim/Data/MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Data/MSSQL/MSSQLDataStore.cs @@ -932,18 +932,19 @@ namespace OpenSim.Data.MSSQL ); try { - prim.SetSitTargetLL(new LLVector3( - Convert.ToSingle(row["SitTargetOffsetX"]), - Convert.ToSingle(row["SitTargetOffsetY"]), - Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion( - Convert.ToSingle( - row["SitTargetOrientX"]), - Convert.ToSingle( - row["SitTargetOrientY"]), - Convert.ToSingle( - row["SitTargetOrientZ"]), - Convert.ToSingle( - row["SitTargetOrientW"]))); + prim.SitTargetPositionLL = new LLVector3( + Convert.ToSingle(row["SitTargetOffsetX"]), + Convert.ToSingle(row["SitTargetOffsetY"]), + Convert.ToSingle(row["SitTargetOffsetZ"])); + prim.SitTargetOrientationLL = new LLQuaternion( + Convert.ToSingle( + row["SitTargetOrientX"]), + Convert.ToSingle( + row["SitTargetOrientY"]), + Convert.ToSingle( + row["SitTargetOrientZ"]), + Convert.ToSingle( + row["SitTargetOrientW"])); } catch (InvalidCastException) { @@ -1136,12 +1137,12 @@ namespace OpenSim.Data.MSSQL try { // Sit target - LLVector3 sitTargetPos = prim.GetSitTargetPositionLL(); + LLVector3 sitTargetPos = prim.SitTargetPositionLL; row["SitTargetOffsetX"] = sitTargetPos.X; row["SitTargetOffsetY"] = sitTargetPos.Y; row["SitTargetOffsetZ"] = sitTargetPos.Z; - LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL(); + LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL; row["SitTargetOrientW"] = sitTargetOrient.W; row["SitTargetOrientX"] = sitTargetOrient.X; row["SitTargetOrientY"] = sitTargetOrient.Y; diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index 7dc5b0c..254e526 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs @@ -1314,18 +1314,19 @@ namespace OpenSim.Data.MySQL ); try { - prim.SetSitTargetLL(new LLVector3( - Convert.ToSingle(row["SitTargetOffsetX"]), - Convert.ToSingle(row["SitTargetOffsetY"]), - Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion( - Convert.ToSingle( - row["SitTargetOrientX"]), - Convert.ToSingle( - row["SitTargetOrientY"]), - Convert.ToSingle( - row["SitTargetOrientZ"]), - Convert.ToSingle( - row["SitTargetOrientW"]))); + prim.SitTargetPositionLL = new LLVector3( + Convert.ToSingle(row["SitTargetOffsetX"]), + Convert.ToSingle(row["SitTargetOffsetY"]), + Convert.ToSingle(row["SitTargetOffsetZ"])); + prim.SitTargetOrientationLL = new LLQuaternion( + Convert.ToSingle( + row["SitTargetOrientX"]), + Convert.ToSingle( + row["SitTargetOrientY"]), + Convert.ToSingle( + row["SitTargetOrientZ"]), + Convert.ToSingle( + row["SitTargetOrientW"])); } catch (InvalidCastException) { @@ -1584,12 +1585,12 @@ namespace OpenSim.Data.MySQL try { // Sit target - LLVector3 sitTargetPos = prim.GetSitTargetPositionLL(); + LLVector3 sitTargetPos = prim.SitTargetPositionLL; row["SitTargetOffsetX"] = sitTargetPos.X; row["SitTargetOffsetY"] = sitTargetPos.Y; row["SitTargetOffsetZ"] = sitTargetPos.Z; - LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL(); + LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL; row["SitTargetOrientW"] = sitTargetOrient.W; row["SitTargetOrientX"] = sitTargetOrient.X; row["SitTargetOrientY"] = sitTargetOrient.Y; diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index effee9b..0e67fb9 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -992,18 +992,19 @@ namespace OpenSim.Data.SQLite try { - prim.SetSitTargetLL(new LLVector3( - Convert.ToSingle(row["SitTargetOffsetX"]), - Convert.ToSingle(row["SitTargetOffsetY"]), - Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion( - Convert.ToSingle( - row["SitTargetOrientX"]), - Convert.ToSingle( - row["SitTargetOrientY"]), - Convert.ToSingle( - row["SitTargetOrientZ"]), - Convert.ToSingle( - row["SitTargetOrientW"]))); + prim.SitTargetPositionLL = new LLVector3( + Convert.ToSingle(row["SitTargetOffsetX"]), + Convert.ToSingle(row["SitTargetOffsetY"]), + Convert.ToSingle(row["SitTargetOffsetZ"])); + prim.SitTargetOrientationLL = new LLQuaternion( + Convert.ToSingle( + row["SitTargetOrientX"]), + Convert.ToSingle( + row["SitTargetOrientY"]), + Convert.ToSingle( + row["SitTargetOrientZ"]), + Convert.ToSingle( + row["SitTargetOrientW"])); } catch (InvalidCastException) { @@ -1334,12 +1335,12 @@ namespace OpenSim.Data.SQLite row["RotationW"] = prim.RotationOffset.W; // Sit target - LLVector3 sitTargetPos = prim.GetSitTargetPositionLL(); + LLVector3 sitTargetPos = prim.SitTargetPositionLL; row["SitTargetOffsetX"] = sitTargetPos.X; row["SitTargetOffsetY"] = sitTargetPos.Y; row["SitTargetOffsetZ"] = sitTargetPos.Z; - LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL(); + LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL; row["SitTargetOrientW"] = sitTargetOrient.W; row["SitTargetOrientX"] = sitTargetOrient.X; row["SitTargetOrientY"] = sitTargetOrient.Y; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 2b40ad2..685a3d5 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1508,28 +1508,6 @@ namespace OpenSim.Region.Environment.Scenes return LLUUID.Zero; } - public Quaternion GetSitTargetOrientation() - { - return m_sitTargetOrientation; - } - - public LLQuaternion GetSitTargetOrientationLL() - { - return - new LLQuaternion(m_sitTargetOrientation.x, m_sitTargetOrientation.y, m_sitTargetOrientation.z, - m_sitTargetOrientation.w); - } - - public Vector3 GetSitTargetPosition() - { - return m_sitTargetPosition; - } - - public LLVector3 GetSitTargetPositionLL() - { - return new LLVector3(m_sitTargetPosition.x, m_sitTargetPosition.y, m_sitTargetPosition.z); - } - /// /// Method for a prim to get it's world position from the group. /// Remember, the Group Position simply gives the position of the group itself @@ -2382,23 +2360,23 @@ namespace OpenSim.Region.Environment.Scenes aggregateScriptEvents(); } - public void SetSitTarget(Vector3 offset, Quaternion orientation) - { - m_sitTargetPosition = offset; - m_sitTargetOrientation = orientation; - } - - // Utility function so the databases don't have to reference axiom.math - public void SetSitTargetLL(LLVector3 offset, LLQuaternion orientation) - { - if ( - !(offset.X == 0 && offset.Y == 0 && offset.Z == 0 && (orientation.W == 0 || orientation.W == 1) && - orientation.X == 0 && orientation.Y == 0 && orientation.Z == 0)) - { - m_sitTargetPosition = new Vector3(offset.X, offset.Y, offset.Z); - m_sitTargetOrientation = new Quaternion(orientation.W, orientation.X, orientation.Y, orientation.Z); - } - } + // public void SetSitTarget(Vector3 offset, Quaternion orientation) + // { + // m_sitTargetPosition = offset; + // m_sitTargetOrientation = orientation; + // } + + // // Utility function so the databases don't have to reference axiom.math + // public void SetSitTargetLL(LLVector3 offset, LLQuaternion orientation) + // { + // if ( + // !(offset.X == 0 && offset.Y == 0 && offset.Z == 0 && (orientation.W == 0 || orientation.W == 1) && + // orientation.X == 0 && orientation.Y == 0 && orientation.Z == 0)) + // { + // m_sitTargetPosition = new Vector3(offset.X, offset.Y, offset.Z); + // m_sitTargetOrientation = new Quaternion(orientation.W, orientation.X, orientation.Y, orientation.Z); + // } + // } /// /// Set the text displayed for this part. diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 22ca159..a0a76cf 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1096,8 +1096,8 @@ namespace OpenSim.Region.Environment.Scenes foreach (SceneObjectPart part in partArray) { // Is a sit target available? - Vector3 avSitOffSet = part.GetSitTargetPosition(); - Quaternion avSitOrientation = part.GetSitTargetOrientation(); + Vector3 avSitOffSet = part.SitTargetPosition; + Quaternion avSitOrientation = part.SitTargetOrientation; LLUUID avOnTargetAlready = part.GetAvatarOnSitTarget(); bool SitTargetUnOccupied = (!(avOnTargetAlready != LLUUID.Zero)); @@ -1130,8 +1130,8 @@ namespace OpenSim.Region.Environment.Scenes // see http://wiki.secondlife.com/wiki/User:Andrew_Linden/Office_Hours/2007_11_06 for details on how LL does it // Is a sit target available? - Vector3 avSitOffSet = part.GetSitTargetPosition(); - Quaternion avSitOrientation = part.GetSitTargetOrientation(); + Vector3 avSitOffSet = part.SitTargetPosition; + Quaternion avSitOrientation = part.SitTargetOrientation; LLUUID avOnTargetAlready = part.GetAvatarOnSitTarget(); bool SitTargetUnOccupied = (!(avOnTargetAlready != LLUUID.Zero)); @@ -1222,8 +1222,8 @@ namespace OpenSim.Region.Environment.Scenes { if (part.GetAvatarOnSitTarget() == UUID) { - Vector3 sitTargetPos = part.GetSitTargetPosition(); - Quaternion sitTargetOrient = part.GetSitTargetOrientation(); + Vector3 sitTargetPos = part.SitTargetPosition; + Quaternion sitTargetOrient = part.SitTargetOrientation; //Quaternion vq = new Quaternion(sitTargetPos.x, sitTargetPos.y+0.2f, sitTargetPos.z+0.2f, 0); //Quaternion nq = new Quaternion(sitTargetOrient.w, -sitTargetOrient.x, -sitTargetOrient.y, -sitTargetOrient.z); diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 1aa7ae3..e0b6e5d 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -4494,7 +4494,8 @@ namespace OpenSim.Region.ScriptEngine.Common if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0) rot.z = 1; // ZERO_ROTATION = 0,0,0,1 - m_host.SetSitTarget(new Vector3((float)offset.x, (float)offset.y, (float)offset.z), new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z)); + m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z); + m_host.SitTargetOrientation = new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z); } public string llAvatarOnSitTarget() diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2525de0..b89965a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4369,7 +4369,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0) rot.z = 1; // ZERO_ROTATION = 0,0,0,1 - m_host.SetSitTarget(new Vector3((float)offset.x, (float)offset.y, (float)offset.z), new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z)); + m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z); + m_host.SitTargetOrientation = new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z); } public string llAvatarOnSitTarget() diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs index 8db5d7d..6dfcb3c 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs @@ -557,18 +557,19 @@ namespace OpenSim.DataStore.MSSQL try { - prim.SetSitTargetLL(new LLVector3( - Convert.ToSingle(row["SitTargetOffsetX"]), - Convert.ToSingle(row["SitTargetOffsetY"]), - Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion( - Convert.ToSingle( - row["SitTargetOrientX"]), - Convert.ToSingle( - row["SitTargetOrientY"]), - Convert.ToSingle( - row["SitTargetOrientZ"]), - Convert.ToSingle( - row["SitTargetOrientW"]))); + prim.SitTargetPositionLL = new LLVector3( + Convert.ToSingle(row["SitTargetOffsetX"]), + Convert.ToSingle(row["SitTargetOffsetY"]), + Convert.ToSingle(row["SitTargetOffsetZ"])); + prim.SitTargetOrientationLL = new LLQuaternion( + Convert.ToSingle( + row["SitTargetOrientX"]), + Convert.ToSingle( + row["SitTargetOrientY"]), + Convert.ToSingle( + row["SitTargetOrientZ"]), + Convert.ToSingle( + row["SitTargetOrientW"])); } catch (InvalidCastException) { @@ -628,12 +629,12 @@ namespace OpenSim.DataStore.MSSQL try { // Sit target - LLVector3 sitTargetPos = prim.GetSitTargetPositionLL(); + LLVector3 sitTargetPos = prim.SitTargetPositionLL; row["SitTargetOffsetX"] = sitTargetPos.X; row["SitTargetOffsetY"] = sitTargetPos.Y; row["SitTargetOffsetZ"] = sitTargetPos.Z; - LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL(); + LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL; row["SitTargetOrientW"] = sitTargetOrient.W; row["SitTargetOrientX"] = sitTargetOrient.X; row["SitTargetOrientY"] = sitTargetOrient.Y; -- cgit v1.1