*When avatar crosses parcel, it updates successfully in the viewer

*This includes parcel name in title bar, media and music autoplay, and parcel flag icons
*Yay!
zircon^2
mingchen 2007-06-07 01:04:07 +00:00
parent a12a495c22
commit f1250bd291
2 changed files with 30 additions and 1 deletions

View File

@ -96,7 +96,29 @@ namespace OpenSim.world
}
}
this.positionLastFrame = pos2;
if (positionFrameBeforeLast != pos2)
{
this.positionFrameBeforeLast = this.positionLastFrame;
this.positionLastFrame = pos2;
int tempRoundedX = (int)Math.Round(positionLastFrame.X);
int tempRoundedY = (int)Math.Round(positionLastFrame.Y);
if (this.positionRoundedX != tempRoundedX || this.positionRoundedY != tempRoundedY)
{
this.positionRoundedX = tempRoundedX;
this.positionRoundedY = tempRoundedY;
int currentParcelLocalID = m_world.parcelManager.getParcel(tempRoundedX, tempRoundedY).parcelData.localID;
if(currentParcelLocalID != this.positionParcelHoverLocalID)
{
Console.WriteLine("NEW PARCEL: " + m_world.parcelManager.getParcel(tempRoundedX, tempRoundedY).parcelData.parcelName);
m_world.parcelManager.getParcel(tempRoundedX, tempRoundedY).sendParcelProperties(this.parcelUpdateSequenceIncrement, false, 0,this.ControllingClient);
this.positionParcelHoverLocalID = currentParcelLocalID;
this.parcelUpdateSequenceIncrement++;
}
}
}
if (!this.ControllingClient.m_sandboxMode)
{

View File

@ -57,6 +57,13 @@ namespace OpenSim.world
private byte[] visualParams;
private AvatarWearable[] Wearables;
private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
private LLVector3 positionFrameBeforeLast = new LLVector3(0, 0, 0);
private int positionRoundedX = 0;
private int positionRoundedY = 0;
private int positionParcelHoverLocalID = -1; //Local ID of the last parcel they were over
private int parcelUpdateSequenceIncrement = 1;
private ulong m_regionHandle;
//private Dictionary<uint, ClientView> m_clientThreads;
private string m_regionName;