From 9e9dad1cde362de093d0d7e6c3e247ff00ceac96 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 8 Nov 2007 00:10:40 +0000 Subject: * Added Rotational Velocity reporting for Client Interpolation to Terse Updates * Added Angular Velocity reporting for smooth-ish rotations on object collisions --- OpenSim/Region/Environment/Scenes/EntityBase.cs | 3 ++- .../Region/Environment/Scenes/SceneObjectPart.cs | 30 +++++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index d0cbcf6..1c21159 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs @@ -69,6 +69,7 @@ namespace OpenSim.Region.Environment.Scenes } protected LLVector3 m_velocity; + protected LLVector3 m_rotationalvelocity; /// /// @@ -106,7 +107,7 @@ namespace OpenSim.Region.Environment.Scenes m_velocity = new LLVector3(); Rotation = new Quaternion(); m_name = "(basic entity)"; - + m_rotationalvelocity = new LLVector3(0, 0, 0); m_children = new List(); } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 4c6865a..0e2b186 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -231,6 +231,7 @@ namespace OpenSim.Region.Environment.Scenes } protected LLVector3 m_velocity; + protected LLVector3 m_rotationalvelocity; /// public LLVector3 Velocity @@ -253,6 +254,28 @@ namespace OpenSim.Region.Environment.Scenes } set { m_velocity = value; } } + public LLVector3 RotationalVelocity + { + get + { + //if (PhysActor.Velocity.x != 0 || PhysActor.Velocity.y != 0 + //|| PhysActor.Velocity.z != 0) + //{ + if (PhysActor != null) + { + if (PhysActor.IsPhysical) + { + m_rotationalvelocity.X = PhysActor.RotationalVelocity.X; + m_rotationalvelocity.Y = PhysActor.RotationalVelocity.Y; + m_rotationalvelocity.Z = PhysActor.RotationalVelocity.Z; + } + } + + return m_rotationalvelocity; + } + set { m_rotationalvelocity = value; } + } + protected LLVector3 m_angularVelocity; @@ -384,6 +407,7 @@ namespace OpenSim.Region.Environment.Scenes OffsetPosition = offsetPosition; RotationOffset = rotationOffset; Velocity = new LLVector3(0, 0, 0); + m_rotationalvelocity = new LLVector3(0, 0, 0); AngularVelocity = new LLVector3(0, 0, 0); Acceleration = new LLVector3(0, 0, 0); @@ -1020,7 +1044,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot, Velocity); + remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot, Velocity, RotationalVelocity); } } @@ -1033,8 +1057,8 @@ namespace OpenSim.Region.Environment.Scenes } else { - remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot, Velocity); - //System.Console.WriteLine("Vel:" + Velocity); + remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot, Velocity, RotationalVelocity); + //System.Console.WriteLine("RVel:" + RotationalVelocity); } } -- cgit v1.1