From 4b75353cbf50de3cae4c48ec90b55f30c1612c92 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 15 Oct 2009 16:35:27 -0700 Subject: Object update prioritization by Jim Greensky of Intel Labs, part one. This implements a simple distance prioritizer based on initial agent positions. Re-prioritizing and more advanced priority algorithms will follow soon --- OpenSim/Framework/IClientAPI.cs | 254 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 231 insertions(+), 23 deletions(-) (limited to 'OpenSim/Framework/IClientAPI.cs') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 29846f5..4b51e15 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -517,6 +517,233 @@ namespace OpenSim.Framework public float dwell; } + public struct SendAvatarData + { + private ulong m_regionHandle; + private string m_firstName; + private string m_lastName; + private string m_grouptitle; + private UUID m_avatarID; + private uint m_avatarLocalID; + private Vector3 m_Pos; + private byte[] m_textureEntry; + private uint m_parentID; + private Quaternion m_rotation; + + public SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID, + uint avatarLocalID, + Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation) + { + this.m_regionHandle = regionHandle; + this.m_firstName = firstName; + this.m_lastName = lastName; + this.m_grouptitle = grouptitle; + this.m_avatarID = avatarID; + this.m_avatarLocalID = avatarLocalID; + this.m_Pos = Pos; + this.m_textureEntry = textureEntry; + this.m_parentID = parentID; + this.m_rotation = rotation; + } + + public ulong regionHandle { get { return this.m_regionHandle; } } + public string firstName { get { return this.m_firstName; } } + public string lastName { get { return this.m_lastName; } } + public string grouptitle { get { return this.m_grouptitle; } } + public UUID avatarID { get { return this.m_avatarID; } } + public uint avatarLocalID { get { return this.m_avatarLocalID; } } + public Vector3 Pos { get { return this.m_Pos; } } + public byte[] textureEntry { get { return this.m_textureEntry; } } + public uint parentID { get { return this.m_parentID; } } + public Quaternion rotation { get { return this.m_rotation; } } + } + + public struct SendAvatarTerseData + { + private ulong m_regionHandle; + private ushort m_timeDilation; + private uint m_localID; + private Vector3 m_position; + private Vector3 m_velocity; + private Quaternion m_rotation; + private UUID m_agentid; + private double m_priority; + + public SendAvatarTerseData(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, + Vector3 velocity, Quaternion rotation, UUID agentid, double priority) + { + this.m_regionHandle = regionHandle; + this.m_timeDilation = timeDilation; + this.m_localID = localID; + this.m_position = position; + this.m_velocity = velocity; + this.m_rotation = rotation; + this.m_agentid = agentid; + this.m_priority = priority; + } + + public ulong regionHandle { get { return this.m_regionHandle; } } + public ushort timeDilation { get { return this.m_timeDilation; } } + public uint localID { get { return this.m_localID; } } + public Vector3 position { get { return this.m_position; } } + public Vector3 velocity { get { return this.m_velocity; } } + public Quaternion rotation { get { return this.m_rotation; } } + public UUID agentid { get { return this.m_agentid; } } + public double priority { get { return this.m_priority; } } + } + + public struct SendPrimitiveTerseData + { + private ulong m_regionHandle; + private ushort m_timeDilation; + private uint m_localID; + private Vector3 m_position; + private Quaternion m_rotation; + private Vector3 m_velocity; + private Vector3 m_rotationalvelocity; + private byte m_state; + private UUID m_AssetId; + private UUID m_owner; + private int m_attachPoint; + private double m_priority; + + public SendPrimitiveTerseData(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, + Quaternion rotation, Vector3 velocity, Vector3 rotationalvelocity, byte state, + UUID AssetId, UUID owner, int attachPoint, double priority) + { + this.m_regionHandle = regionHandle; + this.m_timeDilation = timeDilation; + this.m_localID = localID; + this.m_position = position; + this.m_rotation = rotation; + this.m_velocity = velocity; + this.m_rotationalvelocity = rotationalvelocity; + this.m_state = state; + this.m_AssetId = AssetId; + this.m_owner = owner; + this.m_attachPoint = attachPoint; + this.m_priority = priority; + } + + public ulong regionHandle { get { return this.m_regionHandle; } } + public ushort timeDilation { get { return this.m_timeDilation; } } + public uint localID { get { return this.m_localID; } } + public Vector3 position { get { return this.m_position; } } + public Quaternion rotation { get { return this.m_rotation; } } + public Vector3 velocity { get { return this.m_velocity; } } + public Vector3 rotationalvelocity { get { return this.m_rotationalvelocity; } } + public byte state { get { return this.m_state; } } + public UUID AssetId { get { return this.m_AssetId; } } + public UUID owner { get { return this.m_owner; } } + public int attachPoint { get { return this.m_attachPoint; } } + public double priority { get { return this.m_priority; } } + } + + public struct SendPrimitiveData + { + private ulong m_regionHandle; + private ushort m_timeDilation; + private uint m_localID; + private PrimitiveBaseShape m_primShape; + private Vector3 m_pos; + private Vector3 m_vel; + private Vector3 m_acc; + private Quaternion m_rotation; + private Vector3 m_rvel; + private uint m_flags; + private UUID m_objectID; + private UUID m_ownerID; + private string m_text; + private byte[] m_color; + private uint m_parentID; + private byte[] m_particleSystem; + private byte m_clickAction; + private byte m_material; + private byte[] m_textureanim; + private bool m_attachment; + private uint m_AttachPoint; + private UUID m_AssetId; + private UUID m_SoundId; + private double m_SoundVolume; + private byte m_SoundFlags; + private double m_SoundRadius; + private double m_priority; + + public SendPrimitiveData(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, + Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, + uint flags, UUID objectID, UUID ownerID, string text, byte[] color, + uint parentID, byte[] particleSystem, byte clickAction, byte material, double priority) : + this(regionHandle, timeDilation, localID, primShape, pos, vel, acc, rotation, rvel, flags, objectID, + ownerID, text, color, parentID, particleSystem, clickAction, material, new byte[0], false, 0, UUID.Zero, + UUID.Zero, 0, 0, 0, priority) { } + + public SendPrimitiveData(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, + Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, + uint flags, + UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, + byte[] particleSystem, + byte clickAction, byte material, byte[] textureanim, bool attachment, + uint AttachPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, + double SoundRadius, double priority) + { + this.m_regionHandle = regionHandle; + this.m_timeDilation = timeDilation; + this.m_localID = localID; + this.m_primShape = primShape; + this.m_pos = pos; + this.m_vel = vel; + this.m_acc = acc; + this.m_rotation = rotation; + this.m_rvel = rvel; + this.m_flags = flags; + this.m_objectID = objectID; + this.m_ownerID = ownerID; + this.m_text = text; + this.m_color = color; + this.m_parentID = parentID; + this.m_particleSystem = particleSystem; + this.m_clickAction = clickAction; + this.m_material = material; + this.m_textureanim = textureanim; + this.m_attachment = attachment; + this.m_AttachPoint = AttachPoint; + this.m_AssetId = AssetId; + this.m_SoundId = SoundId; + this.m_SoundVolume = SoundVolume; + this.m_SoundFlags = SoundFlags; + this.m_SoundRadius = SoundRadius; + this.m_priority = priority; + } + + public ulong regionHandle { get { return this.m_regionHandle; } } + public ushort timeDilation { get { return this.m_timeDilation; } } + public uint localID { get { return this.m_localID; } } + public PrimitiveBaseShape primShape { get { return this.m_primShape; } } + public Vector3 pos { get { return this.m_pos; } } + public Vector3 vel { get { return this.m_vel; } } + public Vector3 acc { get { return this.m_acc; } } + public Quaternion rotation { get { return this.m_rotation; } } + public Vector3 rvel { get { return this.m_rvel; } } + public uint flags { get { return this.m_flags; } } + public UUID objectID { get { return this.m_objectID; } } + public UUID ownerID { get { return this.m_ownerID; } } + public string text { get { return this.m_text; } } + public byte[] color { get { return this.m_color; } } + public uint parentID { get { return this.m_parentID; } } + public byte[] particleSystem { get { return this.m_particleSystem; } } + public byte clickAction { get { return this.m_clickAction; } } + public byte material { get { return this.m_material; } } + public byte[] textureanim { get { return this.m_textureanim; } } + public bool attachment { get { return this.m_attachment; } } + public uint AttachPoint { get { return this.m_AttachPoint; } } + public UUID AssetId { get { return this.m_AssetId; } } + public UUID SoundId { get { return this.m_SoundId; } } + public double SoundVolume { get { return this.m_SoundVolume; } } + public byte SoundFlags { get { return this.m_SoundFlags; } } + public double SoundRadius { get { return this.m_SoundRadius; } } + public double priority { get { return this.m_priority; } } + } + public interface IClientAPI { Vector3 StartPos { get; set; } @@ -877,37 +1104,18 @@ namespace OpenSim.Framework void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance); void SendPayPrice(UUID objectID, int[] payPrice); - void SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID, - uint avatarLocalID, - Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation); + void SendAvatarData(SendAvatarData data); - void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, - Vector3 velocity, Quaternion rotation, UUID agentid); + void SendAvatarTerseUpdate(SendAvatarTerseData data); void SendCoarseLocationUpdate(List users, List CoarseLocations); void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID); void SetChildAgentThrottle(byte[] throttle); - void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, - Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, - uint flags, - UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, - byte[] particleSystem, - byte clickAction, byte material, byte[] textureanim, bool attachment, - uint AttachPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, - double SoundRadius); - + void SendPrimitiveToClient(SendPrimitiveData data); - void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, - Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, - uint flags, UUID objectID, UUID ownerID, string text, byte[] color, - uint parentID, byte[] particleSystem, byte clickAction, byte material); - - - void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, - Quaternion rotation, Vector3 velocity, Vector3 rotationalvelocity, byte state, - UUID AssetId, UUID owner, int attachPoint); + void SendPrimTerseUpdate(SendPrimitiveTerseData data); void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items, List folders, bool fetchFolders, -- cgit v1.1