From 7f03246653a6f277505d2055528cbb8dd2e1f4c1 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 10 Jul 2007 17:56:31 +0000 Subject: Gird mode in sugilite should now work in so far as you should be able to login and move between regions in the same instance. Moving to regions in a different instance of opensim still needs implementing (working on it now). Also trying to look at the map in grid mode will crash the server. --- OpenSim/Region/Environment/Scenes/EntityBase.cs | 4 +- OpenSim/Region/Environment/Scenes/Primitive.cs | 38 ++++++------- OpenSim/Region/Environment/Scenes/PrimitiveOld.cs | 2 +- .../Environment/Scenes/Scene.PacketHandlers.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 3 -- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 62 ++++++++++++---------- 6 files changed, 57 insertions(+), 54 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index 6360ae1..65a0395 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs @@ -57,7 +57,7 @@ namespace OpenSim.Region.Environment.Scenes protected Quaternion m_rotation = new Quaternion(0,0,1,0); - public virtual Quaternion rotation + public virtual Quaternion Rotation { get { @@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Scenes m_pos = new LLVector3(); m_velocity = new LLVector3(); - rotation = new Quaternion(); + Rotation = new Quaternion(); m_name = "(basic entity)"; children = new List(); } diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs index 05bb1f9..d23a569 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive.cs +++ b/OpenSim/Region/Environment/Scenes/Primitive.cs @@ -83,7 +83,7 @@ namespace OpenSim.Region.Environment.Scenes { Primitive parentPrim = (Primitive)this.m_Parent; Axiom.Math.Vector3 offsetPos = new Vector3(this.m_pos.X, this.m_pos.Y, this.m_pos.Z); - offsetPos = parentPrim.rotation * offsetPos; + offsetPos = parentPrim.Rotation * offsetPos; return parentPrim.WorldPos + new LLVector3(offsetPos.x, offsetPos.y, offsetPos.z); } else @@ -139,7 +139,7 @@ namespace OpenSim.Region.Environment.Scenes this.m_isRootPrim = isRoot; this.m_RootParent = rootObject; this.CreateFromPacket(addPacket, ownerID, localID); - this.rotation = Axiom.Math.Quaternion.Identity; + this.Rotation = Axiom.Math.Quaternion.Identity; } /// @@ -169,7 +169,7 @@ namespace OpenSim.Region.Environment.Scenes dupe.LocalId = newLocalID; dupe.Scale = new LLVector3(this.Scale.X, this.Scale.Y, this.Scale.Z); - dupe.rotation = new Quaternion(this.rotation.w, this.rotation.x, this.rotation.y, this.rotation.z); + dupe.Rotation = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z); dupe.Pos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z); return dupe; @@ -278,10 +278,10 @@ namespace OpenSim.Region.Environment.Scenes this.m_RootParent.AddChildToList(this); this.Pos = oldPos; Axiom.Math.Vector3 axPos = new Axiom.Math.Vector3(this.m_pos.X, m_pos.Y, m_pos.Z); - axPos = this.m_Parent.rotation.Inverse() * axPos; + axPos = this.m_Parent.Rotation.Inverse() * axPos; this.m_pos = new LLVector3(axPos.x, axPos.y, axPos.z); - Axiom.Math.Quaternion oldRot = new Quaternion(this.rotation.w, this.rotation.x, this.rotation.y, this.rotation.z); - this.rotation = this.m_Parent.rotation.Inverse() * this.rotation; + Axiom.Math.Quaternion oldRot = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z); + this.Rotation = this.m_Parent.Rotation.Inverse() * this.Rotation; this.updateFlag = 1; foreach (Primitive child in children) @@ -304,7 +304,7 @@ namespace OpenSim.Region.Environment.Scenes axOldPos = oldParentRotation * axOldPos; oldPos = new LLVector3(axOldPos.x, axOldPos.y, axOldPos.z); oldPos += oldParentPosition; - Axiom.Math.Quaternion oldRot = new Quaternion(this.rotation.w, this.rotation.x, this.rotation.y, this.rotation.z); + Axiom.Math.Quaternion oldRot = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z); this.m_isRootPrim = false; this.m_Parent = newParent; this.ParentID = newParent.LocalId; @@ -313,10 +313,10 @@ namespace OpenSim.Region.Environment.Scenes this.m_RootParent.AddChildToList(this); this.Pos = oldPos; Axiom.Math.Vector3 axPos = new Axiom.Math.Vector3(this.m_pos.X, m_pos.Y, m_pos.Z); - axPos = this.m_Parent.rotation.Inverse() * axPos; + axPos = this.m_Parent.Rotation.Inverse() * axPos; this.m_pos = new LLVector3(axPos.x, axPos.y, axPos.z); - this.rotation = oldParentRotation * this.rotation; - this.rotation = this.m_Parent.rotation.Inverse()* this.rotation ; + this.Rotation = oldParentRotation * this.Rotation; + this.Rotation = this.m_Parent.Rotation.Inverse()* this.Rotation ; this.updateFlag = 1; foreach (Primitive child in children) { @@ -401,7 +401,7 @@ namespace OpenSim.Region.Environment.Scenes LLVector3 oldPos = new LLVector3(Pos.X, Pos.Y, Pos.Z); LLVector3 diff = oldPos - newPos; Axiom.Math.Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); - axDiff = this.rotation.Inverse() * axDiff; + axDiff = this.Rotation.Inverse() * axDiff; diff.X = axDiff.x; diff.Y = axDiff.y; diff.Z = axDiff.z; @@ -431,7 +431,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void UpdateGroupRotation(LLQuaternion rot) { - this.rotation = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z); + this.Rotation = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z); this.updateFlag = 2; } @@ -443,7 +443,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void UpdateGroupMouseRotation(LLVector3 pos, LLQuaternion rot) { - this.rotation = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z); + this.Rotation = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z); this.Pos = pos; this.updateFlag = 2; } @@ -456,16 +456,16 @@ namespace OpenSim.Region.Environment.Scenes { //Console.WriteLine("updating single prim rotation"); Axiom.Math.Quaternion axRot = new Axiom.Math.Quaternion(rot.W, rot.X, rot.Y, rot.Z); - Axiom.Math.Quaternion oldParentRot = new Quaternion(this.rotation.w, this.rotation.x, this.rotation.y, this.rotation.z); - this.rotation = axRot; + Axiom.Math.Quaternion oldParentRot = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z); + this.Rotation = axRot; foreach (Primitive prim in this.children) { Axiom.Math.Vector3 axPos = new Vector3(prim.m_pos.X, prim.m_pos.Y, prim.m_pos.Z); axPos = oldParentRot * axPos; axPos = axRot.Inverse() * axPos; prim.m_pos = new LLVector3(axPos.x, axPos.y, axPos.z); - prim.rotation = oldParentRot * prim.rotation ; - prim.rotation = axRot.Inverse()* prim.rotation; + prim.Rotation = oldParentRot * prim.Rotation ; + prim.Rotation = axRot.Inverse()* prim.Rotation; prim.updateFlag = 2; } this.updateFlag = 2; @@ -528,7 +528,7 @@ namespace OpenSim.Region.Environment.Scenes LLVector3 lPos; lPos = this.Pos; LLQuaternion lRot; - lRot = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w); + lRot = new LLQuaternion(this.Rotation.x, this.Rotation.y, this.Rotation.z, this.Rotation.w); remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.m_Shape, lPos, lRot, new LLUUID("00000000-0000-0000-9999-000000000005"), this.m_flags, this.uuid, this.OwnerID, this.Text, this.ParentID); } @@ -571,7 +571,7 @@ namespace OpenSim.Region.Environment.Scenes Quaternion lRot; lPos = this.Pos; - lRot = this.rotation; + lRot = this.Rotation; LLQuaternion mRot = new LLQuaternion(lRot.x, lRot.y, lRot.z, lRot.w); RemoteClient.SendPrimTerseUpdate(this.m_regionHandle, 64096, this.LocalId, lPos, mRot); diff --git a/OpenSim/Region/Environment/Scenes/PrimitiveOld.cs b/OpenSim/Region/Environment/Scenes/PrimitiveOld.cs index 4933b01..91a4162 100644 --- a/OpenSim/Region/Environment/Scenes/PrimitiveOld.cs +++ b/OpenSim/Region/Environment/Scenes/PrimitiveOld.cs @@ -445,7 +445,7 @@ namespace OpenSim.Region.Environment.Scenes else { lPos = this.Pos; - lRot = this.rotation; + lRot = this.Rotation; } LLQuaternion mRot = new LLQuaternion(lRot.x, lRot.y, lRot.z, lRot.w); RemoteClient.SendPrimTerseUpdate(this.m_regionHandle, 64096, this.LocalId, lPos, mRot); diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index e64e147..69eaa75 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Scenes case 1: // Say if ((dis < 30) && (dis > -30)) { - Console.WriteLine("sending chat"); + //Console.WriteLine("sending chat"); client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 81c56c4..cd81384 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -685,15 +685,12 @@ namespace OpenSim.Region.Environment.Scenes /// public void InformClientOfNeighbours(IClientAPI remoteClient) { - // Console.WriteLine("informing client of neighbouring regions"); List neighbours = this.commsManager.GridServer.RequestNeighbours(this.m_regInfo); - //Console.WriteLine("we have " + neighbours.Count + " neighbouring regions"); if (neighbours != null) { for (int i = 0; i < neighbours.Count; i++) { - // Console.WriteLine("sending neighbours data"); AgentCircuitData agent = remoteClient.RequestClientInfo(); agent.BaseFolder = LLUUID.Zero; agent.InventoryFolder = LLUUID.Zero; diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index b0e7710..7330bc5 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Scenes Wearables = AvatarWearable.DefaultWearables; Animations = new ScenePresence.AvatarAnimations(); Animations.LoadAnims(); - + this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); //register for events @@ -160,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes { this.Velocity = new LLVector3(0, 0, 0); this.Pos = new LLVector3(128, 128, 70); - + } } @@ -276,25 +276,31 @@ namespace OpenSim.Region.Environment.Scenes { this.AddNewMovement(agent_control_v3, q); } - UpdateMovementAnimations(update_movementflag); + UpdateMovementAnimations(update_movementflag); } - protected void UpdateMovementAnimations(bool update_movementflag) - { - if (update_movementflag) - { - if (movementflag != 0) { - if (this._physActor.Flying) { - this.SendAnimPack(Animations.AnimsLLUUID["FLY"], 1); - } else { - this.SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); - } - } else { - this.SendAnimPack(Animations.AnimsLLUUID["STAND"], 1); - } - } - - } + protected void UpdateMovementAnimations(bool update_movementflag) + { + if (update_movementflag) + { + if (movementflag != 0) + { + if (this._physActor.Flying) + { + this.SendAnimPack(Animations.AnimsLLUUID["FLY"], 1); + } + else + { + this.SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); + } + } + else + { + this.SendAnimPack(Animations.AnimsLLUUID["STAND"], 1); + } + } + + } protected void AddNewMovement(Vector3 vec, Quaternion rotation) @@ -423,13 +429,13 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendAnimPack(LLUUID animID, int seq) { - this.current_anim = animID; - this.anim_seq = anim_seq; - List avatars = this.m_world.RequestAvatarList(); - for (int i = 0; i < avatars.Count; i++) - { - avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId); - } + this.current_anim = animID; + this.anim_seq = anim_seq; + List avatars = this.m_world.RequestAvatarList(); + for (int i = 0; i < avatars.Count; i++) + { + avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId); + } } /// @@ -437,7 +443,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SendAnimPack() { - this.SendAnimPack(this.current_anim, this.anim_seq); + this.SendAnimPack(this.current_anim, this.anim_seq); } #endregion @@ -506,7 +512,7 @@ namespace OpenSim.Region.Environment.Scenes if (res) { this.MakeChildAgent(); - this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.InternalEndPoint ); + this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.InternalEndPoint); } } } -- cgit v1.1