From 67ac9881faf2034facfe92613538938695c2cda9 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 2 Nov 2009 11:28:35 -0800 Subject: [PATCH] Removing duplicate SceneObjectPart.RotationalVelocity property --- OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs | 8 ++++---- OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 8 ++++---- OpenSim/Data/SQLite/SQLiteRegionData.cs | 8 ++++---- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- .../Framework/Scenes/SceneObjectPart.cs | 20 +++++++------------ .../PointMetaEntity.cs | 11 +++++----- .../SceneObjectGroupDiff.cs | 2 -- .../Shared/Api/Implementation/LSL_Api.cs | 3 +-- 8 files changed, 26 insertions(+), 36 deletions(-) diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs index cff6b00042..6371307fa2 100644 --- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs @@ -1049,7 +1049,7 @@ VALUES if (!(primRow["ParticleSystem"] is DBNull)) prim.ParticleSystem = (Byte[])primRow["ParticleSystem"]; - prim.RotationalVelocity = new Vector3( + prim.AngularVelocity = new Vector3( Convert.ToSingle(primRow["OmegaX"]), Convert.ToSingle(primRow["OmegaY"]), Convert.ToSingle(primRow["OmegaZ"])); @@ -1429,9 +1429,9 @@ VALUES parameters.Add(_Database.CreateParameter("TextureAnimation", prim.TextureAnimation)); parameters.Add(_Database.CreateParameter("ParticleSystem", prim.ParticleSystem)); - parameters.Add(_Database.CreateParameter("OmegaX", prim.RotationalVelocity.X)); - parameters.Add(_Database.CreateParameter("OmegaY", prim.RotationalVelocity.Y)); - parameters.Add(_Database.CreateParameter("OmegaZ", prim.RotationalVelocity.Z)); + parameters.Add(_Database.CreateParameter("OmegaX", prim.AngularVelocity.X)); + parameters.Add(_Database.CreateParameter("OmegaY", prim.AngularVelocity.Y)); + parameters.Add(_Database.CreateParameter("OmegaZ", prim.AngularVelocity.Z)); parameters.Add(_Database.CreateParameter("CameraEyeOffsetX", prim.GetCameraEyeOffset().X)); parameters.Add(_Database.CreateParameter("CameraEyeOffsetY", prim.GetCameraEyeOffset().Y)); diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index a807948bde..c49153f8f2 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs @@ -908,7 +908,7 @@ namespace OpenSim.Data.MySQL if (!(row["ParticleSystem"] is DBNull)) prim.ParticleSystem = (byte[])row["ParticleSystem"]; - prim.RotationalVelocity = new Vector3( + prim.AngularVelocity = new Vector3( (float)(double)row["OmegaX"], (float)(double)row["OmegaY"], (float)(double)row["OmegaZ"] @@ -1240,9 +1240,9 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("TextureAnimation", prim.TextureAnimation); cmd.Parameters.AddWithValue("ParticleSystem", prim.ParticleSystem); - cmd.Parameters.AddWithValue("OmegaX", (double)prim.RotationalVelocity.X); - cmd.Parameters.AddWithValue("OmegaY", (double)prim.RotationalVelocity.Y); - cmd.Parameters.AddWithValue("OmegaZ", (double)prim.RotationalVelocity.Z); + cmd.Parameters.AddWithValue("OmegaX", (double)prim.AngularVelocity.X); + cmd.Parameters.AddWithValue("OmegaY", (double)prim.AngularVelocity.Y); + cmd.Parameters.AddWithValue("OmegaZ", (double)prim.AngularVelocity.Z); cmd.Parameters.AddWithValue("CameraEyeOffsetX", (double)prim.GetCameraEyeOffset().X); cmd.Parameters.AddWithValue("CameraEyeOffsetY", (double)prim.GetCameraEyeOffset().Y); diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 08af7c3eb0..b68de1a87b 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -1213,7 +1213,7 @@ namespace OpenSim.Data.SQLite if (!row.IsNull("ParticleSystem")) prim.ParticleSystem = Convert.FromBase64String(row["ParticleSystem"].ToString()); - prim.RotationalVelocity = new Vector3( + prim.AngularVelocity = new Vector3( Convert.ToSingle(row["OmegaX"]), Convert.ToSingle(row["OmegaY"]), Convert.ToSingle(row["OmegaZ"]) @@ -1530,9 +1530,9 @@ namespace OpenSim.Data.SQLite row["TextureAnimation"] = Convert.ToBase64String(prim.TextureAnimation); row["ParticleSystem"] = Convert.ToBase64String(prim.ParticleSystem); - row["OmegaX"] = prim.RotationalVelocity.X; - row["OmegaY"] = prim.RotationalVelocity.Y; - row["OmegaZ"] = prim.RotationalVelocity.Z; + row["OmegaX"] = prim.AngularVelocity.X; + row["OmegaY"] = prim.AngularVelocity.Y; + row["OmegaZ"] = prim.AngularVelocity.Z; row["CameraEyeOffsetX"] = prim.GetCameraEyeOffset().X; row["CameraEyeOffsetY"] = prim.GetCameraEyeOffset().Y; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 1e7803f96c..a6ee40a0ab 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4635,7 +4635,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart trackedBody = GetSceneObjectPart(joint.TrackedBodyName); // FIXME: causes a sequential lookup if (trackedBody == null) return; // the actor may have been deleted but the joint still lingers around a few frames waiting for deletion. during this time, trackedBody is NULL to prevent further motion of the joint proxy. jointProxyObject.Velocity = trackedBody.Velocity; - jointProxyObject.RotationalVelocity = trackedBody.RotationalVelocity; + jointProxyObject.AngularVelocity = trackedBody.AngularVelocity; switch (joint.Type) { case PhysicsJointType.Ball: diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3d41666b54..474ffdd5eb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -683,12 +683,6 @@ namespace OpenSim.Region.Framework.Scenes } } - public Vector3 RotationalVelocity - { - get { return AngularVelocity; } - set { AngularVelocity = value; } - } - /// public Vector3 AngularVelocity { @@ -1552,9 +1546,9 @@ if (m_shape != null) { m_parentGroup.Scene.PhysicsScene.RequestJointDeletion(Name); // FIXME: what if the name changed? // make sure client isn't interpolating the joint proxy object - Velocity = new Vector3(0, 0, 0); - RotationalVelocity = new Vector3(0, 0, 0); - Acceleration = new Vector3(0, 0, 0); + Velocity = Vector3.Zero; + AngularVelocity = Vector3.Zero; + Acceleration = Vector3.Zero; } } } @@ -2384,7 +2378,7 @@ if (m_shape != null) { byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; remoteClient.SendPrimitiveToClient(new SendPrimitiveData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, m_shape, - lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, _ownerID, + lPos, Velocity, Acceleration, RotationOffset, AngularVelocity, clientFlags, m_uuid, _ownerID, m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment, AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, ParentGroup.GetUpdatePriority(remoteClient))); } @@ -2405,7 +2399,7 @@ if (m_shape != null) { if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || !Acceleration.Equals(m_lastAcceleration) || !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || - !RotationalVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) || + !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) || !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) { @@ -2425,7 +2419,7 @@ if (m_shape != null) { m_lastRotation = RotationOffset; m_lastVelocity = Velocity; m_lastAcceleration = Acceleration; - m_lastAngularVelocity = RotationalVelocity; + m_lastAngularVelocity = AngularVelocity; m_lastTerseSent = Environment.TickCount; } } @@ -3787,7 +3781,7 @@ if (m_shape != null) { remoteClient.SendPrimTerseUpdate(new SendPrimitiveTerseData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, lPos, RotationOffset, Velocity, Acceleration, - RotationalVelocity, state, FromItemID, + AngularVelocity, state, FromItemID, OwnerID, (int)AttachmentPoint, null, ParentGroup.GetUpdatePriority(remoteClient))); } diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs index fbe43d6450..2c5093f58d 100644 --- a/OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs @@ -81,12 +81,11 @@ namespace OpenSim.Region.OptionalModules.ContentManagement y.Scale = new Vector3(0.01f,0.01f,0.01f); y.LastOwnerID = UUID.Zero; y.GroupPosition = groupPos; - y.OffsetPosition = new Vector3(0, 0, 0); - y.RotationOffset = new Quaternion(0,0,0,0); - y.Velocity = new Vector3(0, 0, 0); - y.RotationalVelocity = new Vector3(0, 0, 0); - y.AngularVelocity = new Vector3(0, 0, 0); - y.Acceleration = new Vector3(0, 0, 0); + y.OffsetPosition = Vector3.Zero; + y.RotationOffset = Quaternion.Identity; + y.Velocity = Vector3.Zero; + y.AngularVelocity = Vector3.Zero; + y.Acceleration = Vector3.Zero; y.Flags = 0; y.TrimPermissions(); diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/SceneObjectGroupDiff.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/SceneObjectGroupDiff.cs index e185351615..a6afa5ac74 100644 --- a/OpenSim/Region/OptionalModules/ContentManagementSystem/SceneObjectGroupDiff.cs +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/SceneObjectGroupDiff.cs @@ -172,8 +172,6 @@ namespace OpenSim.Region.OptionalModules.ContentManagement result |= Diff.ANGULARVELOCITY; if (!AreVectorsEquivalent(first.OffsetPosition, second.OffsetPosition)) result |= Diff.OFFSETPOSITION; - if (!AreVectorsEquivalent(first.RotationalVelocity, second.RotationalVelocity)) - result |= Diff.ROTATIONALVELOCITY; if (!AreVectorsEquivalent(first.Scale, second.Scale)) result |= Diff.SCALE; if (!AreVectorsEquivalent(first.Velocity, second.Velocity)) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 64f7c8d4cd..0ea62d77c1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2163,7 +2163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetOmega() { m_host.AddScriptLPS(1); - return new LSL_Vector(m_host.RotationalVelocity.X, m_host.RotationalVelocity.Y, m_host.RotationalVelocity.Z); + return new LSL_Vector(m_host.AngularVelocity.X, m_host.AngularVelocity.Y, m_host.AngularVelocity.Z); } public LSL_Float llGetTimeOfDay() @@ -3159,7 +3159,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) { m_host.AddScriptLPS(1); - m_host.RotationalVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); m_host.ScheduleTerseUpdate(); m_host.SendTerseUpdateToAllClients();