Start of replacing the old SceneObject/Primitive classes with the new versions.

PLEASE NOTE: that with this revision some prim related features may be broke for a while. (things like linking prims and the parcel prim count.)
Also this revision may not work on mono, but that will be fixed soon.
afrisby
MW 2007-08-09 17:54:22 +00:00
parent 4fbecd94b6
commit d451dddcd0
19 changed files with 301 additions and 233 deletions

View File

@ -304,7 +304,7 @@ namespace OpenSim.Region.Capabilities
private LLUUID newAssetID; private LLUUID newAssetID;
private LLUUID inventoryItemID; private LLUUID inventoryItemID;
private BaseHttpServer httpListener; private BaseHttpServer httpListener;
private bool SaveAssets = true; private bool SaveAssets = false;
private string m_assetName = ""; private string m_assetName = "";
/// <summary> /// <summary>

View File

@ -47,10 +47,10 @@ namespace OpenSim.Region.Interfaces
/// <param name="dbname">The name of the database to store to (may not be applicable)</param> /// <param name="dbname">The name of the database to store to (may not be applicable)</param>
void Initialise(string filename, string dbname); void Initialise(string filename, string dbname);
void StoreObject(SceneObject obj); void StoreObject(SceneObjectGroup obj);
void RemoveObject(LLUUID uuid); void RemoveObject(LLUUID uuid);
List<SceneObject> LoadObjects(); List<SceneObjectGroup> LoadObjects();
void StoreTerrain(double[,] terrain); void StoreTerrain(double[,] terrain);
double[,] LoadTerrain(); double[,] LoadTerrain();

View File

@ -16,7 +16,7 @@ namespace OpenSim.Region.Environment.LandManagement
{ {
#region Member Variables #region Member Variables
public LandData landData = new LandData(); public LandData landData = new LandData();
public List<SceneObject> primsOverMe = new List<SceneObject>(); public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
public Scene m_scene; public Scene m_scene;
@ -426,21 +426,21 @@ namespace OpenSim.Region.Environment.LandManagement
public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client) public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client)
{ {
List<uint> resultLocalIDs = new List<uint>(); List<uint> resultLocalIDs = new List<uint>();
foreach (SceneObject obj in primsOverMe) foreach (SceneObjectGroup obj in primsOverMe)
{ {
if (obj.rootLocalID > 0) if (obj.LocalId > 0)
{ {
if (request_type == LandManager.LAND_SELECT_OBJECTS_OWNER && obj.rootPrimitive.OwnerID == this.landData.ownerID) if (request_type == LandManager.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == this.landData.ownerID)
{ {
resultLocalIDs.Add(obj.rootLocalID); resultLocalIDs.Add(obj.LocalId);
} }
else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && false) //TODO: change false to group support! else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && false) //TODO: change false to group support!
{ {
} }
else if (request_type == LandManager.LAND_SELECT_OBJECTS_OTHER && obj.rootPrimitive.OwnerID != remote_client.AgentId) else if (request_type == LandManager.LAND_SELECT_OBJECTS_OTHER && obj.OwnerID != remote_client.AgentId)
{ {
resultLocalIDs.Add(obj.rootLocalID); resultLocalIDs.Add(obj.LocalId);
} }
} }
} }
@ -486,13 +486,13 @@ namespace OpenSim.Region.Environment.LandManagement
public void sendLandObjectOwners(IClientAPI remote_client) public void sendLandObjectOwners(IClientAPI remote_client)
{ {
Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>(); Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>();
foreach (SceneObject obj in primsOverMe) foreach (SceneObjectGroup obj in primsOverMe)
{ {
if (!ownersAndCount.ContainsKey(obj.rootPrimitive.OwnerID)) if (!ownersAndCount.ContainsKey(obj.OwnerID))
{ {
ownersAndCount.Add(obj.rootPrimitive.OwnerID, 0); ownersAndCount.Add(obj.OwnerID, 0);
} }
ownersAndCount[obj.rootPrimitive.OwnerID] += obj.primCount; ownersAndCount[obj.OwnerID] += obj.PrimCount;
} }
if (ownersAndCount.Count > 0) if (ownersAndCount.Count > 0)
{ {
@ -525,7 +525,7 @@ namespace OpenSim.Region.Environment.LandManagement
#endregion #endregion
#region Object Returning #region Object Returning
public void returnObject(SceneObject obj) public void returnObject(SceneObjectGroup obj)
{ {
} }
public void returnLandObjects(int type, LLUUID owner) public void returnLandObjects(int type, LLUUID owner)
@ -544,12 +544,12 @@ namespace OpenSim.Region.Environment.LandManagement
primsOverMe.Clear(); primsOverMe.Clear();
} }
public void addPrimToCount(SceneObject obj) public void addPrimToCount(SceneObjectGroup obj)
{ {
LLUUID prim_owner = obj.rootPrimitive.OwnerID; LLUUID prim_owner = obj.OwnerID;
int prim_count = obj.primCount; int prim_count = obj.PrimCount;
if (obj.isSelected) if (obj.IsSelected)
{ {
landData.selectedPrims += prim_count; landData.selectedPrims += prim_count;
} }
@ -569,12 +569,12 @@ namespace OpenSim.Region.Environment.LandManagement
} }
public void removePrimFromCount(SceneObject obj) public void removePrimFromCount(SceneObjectGroup obj)
{ {
if (primsOverMe.Contains(obj)) if (primsOverMe.Contains(obj))
{ {
LLUUID prim_owner = obj.rootPrimitive.OwnerID; LLUUID prim_owner = obj.OwnerID;
int prim_count = obj.primCount; int prim_count = obj.PrimCount;
if (prim_owner == landData.ownerID) if (prim_owner == landData.ownerID)
{ {

View File

@ -552,7 +552,7 @@ namespace OpenSim.Region.Environment.LandManagement
this.landPrimCountTainted = true; this.landPrimCountTainted = true;
} }
public void addPrimToLandPrimCounts(SceneObject obj) public void addPrimToLandPrimCounts(SceneObjectGroup obj)
{ {
LLVector3 position = obj.Pos; LLVector3 position = obj.Pos;
Land landUnderPrim = getLandObject(position.X, position.Y); Land landUnderPrim = getLandObject(position.X, position.Y);
@ -562,7 +562,7 @@ namespace OpenSim.Region.Environment.LandManagement
} }
} }
public void removePrimFromLandPrimCounts(SceneObject obj) public void removePrimFromLandPrimCounts(SceneObjectGroup obj)
{ {
foreach (Land p in landList.Values) foreach (Land p in landList.Values)
{ {

View File

@ -53,11 +53,11 @@ namespace OpenSim.Region.Environment
bool permission = false; bool permission = false;
// If it's not an object, we cant edit it. // If it's not an object, we cant edit it.
if (!(m_scene.Entities[obj] is SceneObject)) if (!(m_scene.Entities[obj] is SceneObjectGroup))
return false; return false;
SceneObject task = (SceneObject)m_scene.Entities[obj]; SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[obj];
LLUUID taskOwner = task.rootPrimitive.OwnerID; LLUUID taskOwner = null;
// Object owners should be able to edit their own content // Object owners should be able to edit their own content
if (user == taskOwner) if (user == taskOwner)

View File

@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Scenes
private PrimitiveBaseShape m_shape; private PrimitiveBaseShape m_shape;
private byte[] m_particleSystem = new byte[0]; private byte[] m_particleSystem = new byte[0];
public SceneObject m_RootParent; public SceneObjectOLD m_RootParent;
public bool m_isRootPrim; public bool m_isRootPrim;
public EntityBase m_Parent; public EntityBase m_Parent;
@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Constructors #region Constructors
public Primitive(ulong regionHandle, Scene scene, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent, public Primitive(ulong regionHandle, Scene scene, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent,
SceneObject rootObject, PrimitiveBaseShape shape, LLVector3 pos) SceneObjectOLD rootObject, PrimitiveBaseShape shape, LLVector3 pos)
{ {
m_regionHandle = regionHandle; m_regionHandle = regionHandle;
m_scene = scene; m_scene = scene;
@ -184,7 +184,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Duplication #region Duplication
public Primitive Copy(EntityBase parent, SceneObject rootParent) public Primitive Copy(EntityBase parent, SceneObjectOLD rootParent)
{ {
Primitive dupe = (Primitive)MemberwiseClone(); Primitive dupe = (Primitive)MemberwiseClone();
@ -204,7 +204,7 @@ namespace OpenSim.Region.Environment.Scenes
dupe.m_uuid = LLUUID.Random(); dupe.m_uuid = LLUUID.Random();
dupe.LocalId = newLocalID; dupe.LocalId = newLocalID;
if (parent is SceneObject) if (parent is SceneObjectGroup)
{ {
dupe.m_isRootPrim = true; dupe.m_isRootPrim = true;
dupe.ParentID = 0; dupe.ParentID = 0;
@ -314,13 +314,13 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <param name="linkObject"></param> /// <param name="linkObject"></param>
public void AddNewChildren(SceneObject linkObject) public void AddNewChildren(SceneObjectOLD linkObject)
{ {
// Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")"); // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")");
//TODO check permissions //TODO check permissions
m_children.Add(linkObject.rootPrimitive); m_children.Add(linkObject.rootPrimitive);
linkObject.rootPrimitive.SetNewParent(this, m_RootParent); linkObject.rootPrimitive.SetNewParent(this, m_RootParent);
m_scene.DeleteEntity(linkObject.rootUUID); m_scene.DeleteEntity(linkObject.rootUUID);
linkObject.DeleteAllChildren(); linkObject.DeleteAllChildren();
@ -333,7 +333,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="newParent"></param> /// <param name="newParent"></param>
/// <param name="rootParent"></param> /// <param name="rootParent"></param>
public void SetNewParent(Primitive newParent, SceneObject rootParent) public void SetNewParent(Primitive newParent, SceneObjectOLD rootParent)
{ {
LLVector3 oldPos = new LLVector3(Pos.X, Pos.Y, Pos.Z); LLVector3 oldPos = new LLVector3(Pos.X, Pos.Y, Pos.Z);
m_isRootPrim = false; m_isRootPrim = false;
@ -363,7 +363,7 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <param name="newRoot"></param> /// <param name="newRoot"></param>
public void SetRootParent(SceneObject newRoot, Primitive newParent, LLVector3 oldParentPosition, public void SetRootParent(SceneObjectOLD newRoot, Primitive newParent, LLVector3 oldParentPosition,
Quaternion oldParentRotation) Quaternion oldParentRotation)
{ {
LLVector3 oldPos = new LLVector3(Pos.X, Pos.Y, Pos.Z); LLVector3 oldPos = new LLVector3(Pos.X, Pos.Y, Pos.Z);

View File

@ -272,14 +272,14 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="flags"></param> /// <param name="flags"></param>
public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags) public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags)
{ {
SceneObject originPrim = null; SceneObjectGroup originPrim = null;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
if (((SceneObject)ent).rootLocalID == originalPrim) if (((SceneObjectGroup)ent).LocalId == originalPrim)
{ {
originPrim = (SceneObject)ent; originPrim = (SceneObjectGroup)ent;
break; break;
} }
} }
@ -287,15 +287,16 @@ namespace OpenSim.Region.Environment.Scenes
if (originPrim != null) if (originPrim != null)
{ {
SceneObject copy = originPrim.Copy(); SceneObjectGroup copy = originPrim.Copy();
copy.Pos = copy.Pos + offset; copy.Pos = copy.Pos + offset;
this.Entities.Add(copy.rootUUID, copy); this.Entities.Add(copy.UUID, copy);
List<ScenePresence> avatars = this.RequestAvatarList(); copy.ScheduleGroupForFullUpdate();
/* List<ScenePresence> avatars = this.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++) for (int i = 0; i < avatars.Count; i++)
{ {
copy.SendAllChildPrimsToClient(avatars[i].ControllingClient); // copy.SendAllChildPrimsToClient(avatars[i].ControllingClient);
} }*/
} }
else else
@ -312,40 +313,40 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="childPrims"></param> /// <param name="childPrims"></param>
public void LinkObjects(uint parentPrim, List<uint> childPrims) public void LinkObjects(uint parentPrim, List<uint> childPrims)
{ {
SceneObject parenPrim = null; SceneObjectGroup parenPrim = null;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
if (((SceneObject)ent).rootLocalID == parentPrim) if (((SceneObjectGroup)ent).LocalId == parentPrim)
{ {
parenPrim = (SceneObject)ent; parenPrim = (SceneObjectGroup)ent;
break; break;
} }
} }
} }
List<SceneObject> children = new List<SceneObject>(); List<SceneObjectGroup> children = new List<SceneObjectGroup>();
if (parenPrim != null) if (parenPrim != null)
{ {
for (int i = 0; i < childPrims.Count; i++) for (int i = 0; i < childPrims.Count; i++)
{ {
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
if (((SceneObject)ent).rootLocalID == childPrims[i]) if (((SceneObjectGroup)ent).LocalId == childPrims[i])
{ {
children.Add((SceneObject)ent); children.Add((SceneObjectGroup)ent);
} }
} }
} }
} }
} }
foreach (SceneObject sceneObj in children) foreach (SceneObjectGroup sceneObj in children)
{ {
parenPrim.AddNewChildPrims(sceneObj); parenPrim.LinkToGroup(sceneObj);
} }
} }
@ -356,15 +357,15 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="shapeBlock"></param> /// <param name="shapeBlock"></param>
public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock) public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(primLocalID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (prim != null) if (hasPrim != false)
{ {
prim.UpdateShape(shapeBlock); ((SceneObjectGroup)ent).UpdateShape(shapeBlock, primLocalID);
break; break;
} }
} }
@ -373,15 +374,15 @@ namespace OpenSim.Region.Environment.Scenes
public void UpdateExtraParam(uint primLocalID, ushort type, bool inUse, byte[] data) public void UpdateExtraParam(uint primLocalID, ushort type, bool inUse, byte[] data)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(primLocalID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (prim != null) if (hasPrim != false)
{ {
prim.UpdateExtraParam(type, inUse, data); ((SceneObjectGroup)ent).UpdateExtraParam(primLocalID, type, inUse, data);
break; break;
} }
} }
@ -395,15 +396,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="primLocalID"></param> /// <param name="primLocalID"></param>
public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID) public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
{ {
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(primLocalID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (prim != null) if (hasPrim != false)
{ {
prim.GetInventory(remoteClient, primLocalID); ((SceneObjectGroup)ent).GetPartInventory(remoteClient, primLocalID);
break; break;
} }
} }
@ -419,12 +421,12 @@ namespace OpenSim.Region.Environment.Scenes
{ {
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
if (((SceneObject)ent).rootLocalID == primLocalID) if (((SceneObjectGroup)ent).LocalId == primLocalID)
{ {
((SceneObject)ent).GetProperites(remoteClient); ((SceneObjectGroup)ent).GetProperites(remoteClient);
((SceneObject)ent).isSelected = true; ((SceneObjectGroup)ent).IsSelected = true;
this.LandManager.setPrimsTainted(); this.LandManager.setPrimsTainted();
break; break;
} }
@ -441,11 +443,11 @@ namespace OpenSim.Region.Environment.Scenes
{ {
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
if (((SceneObject)ent).rootLocalID == primLocalID) if (((SceneObjectGroup)ent).LocalId == primLocalID)
{ {
((SceneObject)ent).isSelected = false; ((SceneObjectGroup)ent).IsSelected = false;
this.LandManager.setPrimsTainted(); this.LandManager.setPrimsTainted();
break; break;
} }
@ -460,15 +462,15 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="description"></param> /// <param name="description"></param>
public void PrimDescription(uint primLocalID, string description) public void PrimDescription(uint primLocalID, string description)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(primLocalID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (prim != null) if (hasPrim != false)
{ {
prim.Description = description; ((SceneObjectGroup)ent).SetPartDescription(description, primLocalID);
break; break;
} }
} }
@ -482,15 +484,15 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="description"></param> /// <param name="description"></param>
public void PrimName(uint primLocalID, string name) public void PrimName(uint primLocalID, string name)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(primLocalID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (prim != null) if (hasPrim != false)
{ {
prim.Name = name; ((SceneObjectGroup)ent).SetPartName(name, primLocalID);
break; break;
} }
} }
@ -499,27 +501,19 @@ namespace OpenSim.Region.Environment.Scenes
public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(objectID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(objectID);
if (prim != null) if (hasPrim != false)
{ {
((SceneObject)ent).GrapMovement(offset, pos, remoteClient); ((SceneObjectGroup)ent).GrapMovement(offset, pos, remoteClient);
break; break;
} }
} }
} }
/*
if (this.Entities.ContainsKey(objectID))
{
if (this.Entities[objectID] is SceneObject)
{
((SceneObject)this.Entities[objectID]).GrapMovement(offset, pos, remoteClient);
}
}*/
} }
/// <summary> /// <summary>
@ -541,15 +535,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(localID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
if (prim != null) if (hasPrim != false)
{ {
prim.UpdateTextureEntry(texture); ((SceneObjectGroup)ent).UpdateTextureEntry(localID, texture);
break;
} }
} }
} }
@ -563,15 +558,15 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient) public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(localID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
if (prim != null) if (hasPrim != false)
{ {
prim.UpdateGroupPosition(pos); ((SceneObjectGroup)ent).UpdateGroupPosition(pos);
break; break;
} }
} }
@ -583,9 +578,9 @@ namespace OpenSim.Region.Environment.Scenes
Primitive prim = null; Primitive prim = null;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(localID); //prim = ((SceneObject)ent).HasChildPrim(localID);
if (prim != null) if (prim != null)
{ {
prim.UpdateSinglePosition(pos); prim.UpdateSinglePosition(pos);
@ -604,15 +599,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void UpdatePrimRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient) public void UpdatePrimRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(localID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
if (prim != null) if (hasPrim != false)
{ {
prim.UpdateGroupMouseRotation(pos, rot); ((SceneObjectGroup)ent).UpdateGroupRotation(pos, rot);
// prim.UpdateGroupMouseRotation(pos, rot);
break; break;
} }
} }
@ -627,15 +623,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(localID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
if (prim != null) if (hasPrim != false)
{ {
prim.UpdateGroupRotation(rot); ((SceneObjectGroup)ent).UpdateGroupRotation(rot);
//prim.UpdateGroupRotation(rot);
break; break;
} }
} }
@ -654,9 +651,9 @@ namespace OpenSim.Region.Environment.Scenes
Primitive prim = null; Primitive prim = null;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(localID); // prim = ((SceneObject)ent).HasChildPrim(localID);
if (prim != null) if (prim != null)
{ {
prim.UpdateSingleRotation(rot); prim.UpdateSingleRotation(rot);
@ -674,15 +671,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient) public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient)
{ {
Primitive prim = null; bool hasPrim = false;
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
prim = ((SceneObject)ent).HasChildPrim(localID); hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
if (prim != null) if (hasPrim != false)
{ {
prim.ResizeGoup(scale); ((SceneObjectGroup)ent).Resize(scale, localID);
// prim.ResizeGoup(scale);
break; break;
} }
} }

View File

@ -54,7 +54,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
protected Timer m_heartbeatTimer = new Timer(); protected Timer m_heartbeatTimer = new Timer();
protected Dictionary<LLUUID, ScenePresence> Avatars; protected Dictionary<LLUUID, ScenePresence> Avatars;
protected Dictionary<LLUUID, SceneObject> Prims; protected Dictionary<LLUUID, SceneObjectGroup> Prims;
protected PhysicsScene phyScene; protected PhysicsScene phyScene;
protected float timeStep = 0.1f; protected float timeStep = 0.1f;
private Random Rand = new Random(); private Random Rand = new Random();
@ -109,7 +109,7 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_scriptManager; } get { return m_scriptManager; }
} }
public Dictionary<LLUUID, SceneObject> Objects public Dictionary<LLUUID, SceneObjectGroup> Objects
{ {
get { return Prims; } get { return Prims; }
} }
@ -149,11 +149,11 @@ namespace OpenSim.Region.Environment.Scenes
MainLog.Instance.Verbose("Creating new entitities instance"); MainLog.Instance.Verbose("Creating new entitities instance");
Entities = new Dictionary<LLUUID, EntityBase>(); Entities = new Dictionary<LLUUID, EntityBase>();
Avatars = new Dictionary<LLUUID, ScenePresence>(); Avatars = new Dictionary<LLUUID, ScenePresence>();
Prims = new Dictionary<LLUUID, SceneObject>(); Prims = new Dictionary<LLUUID, SceneObjectGroup>();
MainLog.Instance.Verbose("Loading objects from datastore"); MainLog.Instance.Verbose("Loading objects from datastore");
List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects(); List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects();
foreach (SceneObject prim in PrimsFromDB) foreach (SceneObjectGroup prim in PrimsFromDB)
{ {
AddEntity(prim); AddEntity(prim);
} }
@ -463,10 +463,10 @@ namespace OpenSim.Region.Environment.Scenes
public void LoadPrimsFromStorage() public void LoadPrimsFromStorage()
{ {
MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives"); MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives");
List<SceneObject> NewObjectsList = storageManager.DataStore.LoadObjects(); List<SceneObjectGroup> NewObjectsList = storageManager.DataStore.LoadObjects();
foreach (SceneObject obj in NewObjectsList) foreach (SceneObjectGroup obj in NewObjectsList)
{ {
this.Objects.Add(obj.rootUUID, obj); this.Objects.Add(obj.UUID, obj);
} }
} }
@ -501,7 +501,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="ownerID"></param> /// <param name="ownerID"></param>
public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape) public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape)
{ {
SceneObject sceneOb = new SceneObject(this, m_eventManager, ownerID, PrimIDAllocate(), pos, shape); SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
AddEntity(sceneOb); AddEntity(sceneOb);
} }
@ -509,28 +509,28 @@ namespace OpenSim.Region.Environment.Scenes
{ {
foreach (EntityBase obj in Entities.Values) foreach (EntityBase obj in Entities.Values)
{ {
if (obj is SceneObject) if (obj is SceneObjectGroup)
{ {
if (((SceneObject) obj).LocalId == localID) if (((SceneObjectGroup) obj).LocalId == localID)
{ {
RemoveEntity((SceneObject) obj); RemoveEntity((SceneObjectGroup) obj);
return; return;
} }
} }
} }
} }
public void AddEntity(SceneObject sceneObject) public void AddEntity(SceneObjectGroup sceneObject)
{ {
Entities.Add(sceneObject.rootUUID, sceneObject); Entities.Add(sceneObject.UUID, sceneObject);
} }
public void RemoveEntity(SceneObject sceneObject) public void RemoveEntity(SceneObjectGroup sceneObject)
{ {
if (Entities.ContainsKey(sceneObject.rootUUID)) if (Entities.ContainsKey(sceneObject.UUID))
{ {
m_LandManager.removePrimFromLandPrimCounts(sceneObject); m_LandManager.removePrimFromLandPrimCounts(sceneObject);
Entities.Remove(sceneObject.rootUUID); Entities.Remove(sceneObject.UUID);
m_LandManager.setPrimsTainted(); m_LandManager.setPrimsTainted();
} }
} }
@ -779,9 +779,9 @@ namespace OpenSim.Region.Environment.Scenes
{ {
foreach (EntityBase ent in Entities.Values) foreach (EntityBase ent in Entities.Values)
{ {
if (ent is SceneObject) if (ent is SceneObjectGroup)
{ {
((SceneObject) ent).SendAllChildPrimsToClient(client); // ((SceneObject) ent).SendAllChildPrimsToClient(client);
} }
} }
} }

View File

@ -22,7 +22,7 @@ namespace OpenSim.Region.Environment.Scenes
public delegate void OnParcelPrimCountUpdateDelegate(); public delegate void OnParcelPrimCountUpdateDelegate();
public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate; public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
public delegate void OnParcelPrimCountAddDelegate(SceneObject obj); public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd; public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
public delegate void OnScriptConsoleDelegate(string[] args); public delegate void OnScriptConsoleDelegate(string[] args);
@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes
OnParcelPrimCountUpdate(); OnParcelPrimCountUpdate();
} }
} }
public void TriggerParcelPrimCountAdd(SceneObject obj) public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
{ {
if (OnParcelPrimCountAdd != null) if (OnParcelPrimCountAdd != null)
{ {

View File

@ -38,7 +38,7 @@ using OpenSim.Physics.Manager;
namespace OpenSim.Region.Environment.Scenes namespace OpenSim.Region.Environment.Scenes
{ {
public class SceneObject : EntityBase public class SceneObjectOLD : EntityBase
{ {
private Encoding enc = Encoding.ASCII; private Encoding enc = Encoding.ASCII;
private Dictionary<LLUUID, Primitive> ChildPrimitives = new Dictionary<LLUUID, Primitive>(); //list of all primitive id's that are part of this group private Dictionary<LLUUID, Primitive> ChildPrimitives = new Dictionary<LLUUID, Primitive>(); //list of all primitive id's that are part of this group
@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public SceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) public SceneObjectOLD(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
{ {
m_regionHandle = world.RegionInfo.RegionHandle; m_regionHandle = world.RegionInfo.RegionHandle;
m_scene = world; m_scene = world;
@ -102,7 +102,7 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <remarks>Need a null constructor for duplication</remarks> /// <remarks>Need a null constructor for duplication</remarks>
public SceneObject() public SceneObjectOLD()
{ {
} }
@ -125,7 +125,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="datastore"></param> /// <param name="datastore"></param>
public void ProcessBackup(OpenSim.Region.Interfaces.IRegionDataStore datastore) public void ProcessBackup(OpenSim.Region.Interfaces.IRegionDataStore datastore)
{ {
datastore.StoreObject(this); // datastore.StoreObject(this);
} }
/// <summary> /// <summary>
@ -134,7 +134,7 @@ namespace OpenSim.Region.Environment.Scenes
private void ProcessParcelPrimCountUpdate() private void ProcessParcelPrimCountUpdate()
{ {
m_eventManager.TriggerParcelPrimCountAdd(this); // m_eventManager.TriggerParcelPrimCountAdd(this);
} }
/// <summary> /// <summary>
@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Scenes
public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos) public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
{ {
this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_scene, agentID, localID, true, this, this, shape, pos); // this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_scene, agentID, localID, true, this, this, shape, pos);
this.m_children.Add(rootPrimitive); this.m_children.Add(rootPrimitive);
this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive); this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
@ -165,9 +165,9 @@ namespace OpenSim.Region.Environment.Scenes
/// Makes a copy of this SceneObject (and child primitives) /// Makes a copy of this SceneObject (and child primitives)
/// </summary> /// </summary>
/// <returns>A complete copy of the object</returns> /// <returns>A complete copy of the object</returns>
public new SceneObject Copy() public new SceneObjectOLD Copy()
{ {
SceneObject dupe = new SceneObject(); SceneObjectOLD dupe = new SceneObjectOLD();
dupe.m_scene = this.m_scene; dupe.m_scene = this.m_scene;
dupe.m_eventManager = this.m_eventManager; dupe.m_eventManager = this.m_eventManager;
@ -207,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <param name="primObject"></param> /// <param name="primObject"></param>
public void AddNewChildPrims(SceneObject primObject) public void AddNewChildPrims(SceneObjectOLD primObject)
{ {
this.rootPrimitive.AddNewChildren(primObject); this.rootPrimitive.AddNewChildren(primObject);
} }

View File

@ -11,12 +11,12 @@ namespace OpenSim.Region.Environment.Scenes
{ {
// public delegate void PrimCountTaintedDelegate(); // public delegate void PrimCountTaintedDelegate();
public class AllNewSceneObjectGroup2 : EntityBase public class SceneObjectGroup : EntityBase
{ {
private Encoding enc = Encoding.ASCII; private Encoding enc = Encoding.ASCII;
protected AllNewSceneObjectPart2 m_rootPart; protected SceneObjectPart m_rootPart;
protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>(); protected Dictionary<LLUUID, SceneObjectPart> m_parts = new Dictionary<LLUUID, SceneObjectPart>();
protected ulong m_regionHandle; protected ulong m_regionHandle;
@ -38,6 +38,12 @@ namespace OpenSim.Region.Environment.Scenes
get { return new LLVector3(0, 0, 0); } get { return new LLVector3(0, 0, 0); }
} }
public Dictionary<LLUUID, SceneObjectPart> Children
{
get { return this.m_parts; }
set { m_parts = value; }
}
public override LLVector3 Pos public override LLVector3 Pos
{ {
get { return m_rootPart.GroupPosition; } get { return m_rootPart.GroupPosition; }
@ -45,7 +51,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
lock (this.m_parts) lock (this.m_parts)
{ {
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) foreach (SceneObjectPart part in this.m_parts.Values)
{ {
part.GroupPosition = value; part.GroupPosition = value;
} }
@ -65,10 +71,29 @@ namespace OpenSim.Region.Environment.Scenes
set { m_rootPart.UUID = value; } set { m_rootPart.UUID = value; }
} }
public LLUUID OwnerID
{
get { return m_rootPart.OwnerID; }
}
/// <summary>
/// Added because the Parcel code seems to use it
/// but not sure a object should have this
/// as what does it tell us? that some avatar has selected it
/// think really there should be a list (or whatever) in each scenepresence
/// saying what prim(s) that user has selected at any time.
/// </summary>
protected bool m_isSelected = false;
public bool IsSelected
{
get{ return m_isSelected;}
set { m_isSelected = value; }
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public AllNewSceneObjectGroup2() public SceneObjectGroup()
{ {
} }
@ -76,7 +101,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public AllNewSceneObjectGroup2(byte[] data) public SceneObjectGroup(byte[] data)
{ {
} }
@ -84,14 +109,14 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public AllNewSceneObjectGroup2(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
{ {
m_regionHandle = regionHandle; m_regionHandle = regionHandle;
m_scene = scene; m_scene = scene;
this.Pos = pos; this.Pos = pos;
LLVector3 rootOffset = new LLVector3(0, 0, 0); LLVector3 rootOffset = new LLVector3(0, 0, 0);
AllNewSceneObjectPart2 newPart = new AllNewSceneObjectPart2(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset); SceneObjectPart newPart = new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset);
this.m_parts.Add(newPart.UUID, newPart); this.m_parts.Add(newPart.UUID, newPart);
this.SetPartAsRoot(newPart); this.SetPartAsRoot(newPart);
} }
@ -102,16 +127,16 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public new AllNewSceneObjectGroup2 Copy() public new SceneObjectGroup Copy()
{ {
AllNewSceneObjectGroup2 dupe = (AllNewSceneObjectGroup2)this.MemberwiseClone(); SceneObjectGroup dupe = (SceneObjectGroup)this.MemberwiseClone();
dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z); dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z);
dupe.m_scene = m_scene; dupe.m_scene = m_scene;
dupe.m_regionHandle = this.m_regionHandle; dupe.m_regionHandle = this.m_regionHandle;
dupe.CopyRootPart(this.m_rootPart); dupe.CopyRootPart(this.m_rootPart);
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) foreach (SceneObjectPart part in this.m_parts.Values)
{ {
if (part.UUID != this.m_rootPart.UUID) if (part.UUID != this.m_rootPart.UUID)
{ {
@ -125,9 +150,9 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <param name="part"></param> /// <param name="part"></param>
public void CopyRootPart(AllNewSceneObjectPart2 part) public void CopyRootPart(SceneObjectPart part)
{ {
AllNewSceneObjectPart2 newPart = part.Copy(m_scene.PrimIDAllocate()); SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
this.m_parts.Add(newPart.UUID, newPart); this.m_parts.Add(newPart.UUID, newPart);
this.SetPartAsRoot(newPart); this.SetPartAsRoot(newPart);
} }
@ -136,9 +161,9 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <param name="part"></param> /// <param name="part"></param>
public void CopyPart(AllNewSceneObjectPart2 part) public void CopyPart(SceneObjectPart part)
{ {
AllNewSceneObjectPart2 newPart = part.Copy(m_scene.PrimIDAllocate()); SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
this.m_parts.Add(newPart.UUID, newPart); this.m_parts.Add(newPart.UUID, newPart);
this.SetPartAsNonRoot(newPart); this.SetPartAsNonRoot(newPart);
} }
@ -149,7 +174,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public override void Update() public override void Update()
{ {
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) foreach (SceneObjectPart part in this.m_parts.Values)
{ {
part.SendScheduledUpdates(); part.SendScheduledUpdates();
} }
@ -160,7 +185,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void ScheduleGroupForFullUpdate() public void ScheduleGroupForFullUpdate()
{ {
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) foreach (SceneObjectPart part in this.m_parts.Values)
{ {
part.ScheduleFullUpdate(); part.ScheduleFullUpdate();
} }
@ -171,7 +196,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void ScheduleGroupForTerseUpdate() public void ScheduleGroupForTerseUpdate()
{ {
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) foreach (SceneObjectPart part in this.m_parts.Values)
{ {
part.ScheduleTerseUpdate(); part.ScheduleTerseUpdate();
} }
@ -182,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void SendGroupFullUpdate() public void SendGroupFullUpdate()
{ {
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) foreach (SceneObjectPart part in this.m_parts.Values)
{ {
part.SendFullUpdateToAllClients(); part.SendFullUpdateToAllClients();
} }
@ -193,7 +218,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public void SendGroupTerseUpdate() public void SendGroupTerseUpdate()
{ {
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) foreach (SceneObjectPart part in this.m_parts.Values)
{ {
part.SendTerseUpdateToAllClients(); part.SendTerseUpdateToAllClients();
} }
@ -203,7 +228,7 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <param name="objectGroup"></param> /// <param name="objectGroup"></param>
public void LinkToGroup(AllNewSceneObjectGroup2 objectGroup) public void LinkToGroup(SceneObjectGroup objectGroup)
{ {
} }
@ -213,9 +238,9 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="primID"></param> /// <param name="primID"></param>
/// <returns></returns> /// <returns></returns>
private AllNewSceneObjectPart2 GetChildPrim(LLUUID primID) private SceneObjectPart GetChildPrim(LLUUID primID)
{ {
AllNewSceneObjectPart2 childPart = null; SceneObjectPart childPart = null;
if (this.m_parts.ContainsKey(primID)) if (this.m_parts.ContainsKey(primID))
{ {
childPart = this.m_parts[primID]; childPart = this.m_parts[primID];
@ -228,9 +253,9 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="localID"></param> /// <param name="localID"></param>
/// <returns></returns> /// <returns></returns>
private AllNewSceneObjectPart2 GetChildPrim(uint localID) private SceneObjectPart GetChildPrim(uint localID)
{ {
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) foreach (SceneObjectPart part in this.m_parts.Values)
{ {
if (part.LocalID == localID) if (part.LocalID == localID)
{ {
@ -248,7 +273,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public bool HasChildPrim(LLUUID primID) public bool HasChildPrim(LLUUID primID)
{ {
AllNewSceneObjectPart2 childPart = null; SceneObjectPart childPart = null;
if (this.m_parts.ContainsKey(primID)) if (this.m_parts.ContainsKey(primID))
{ {
childPart = this.m_parts[primID]; childPart = this.m_parts[primID];
@ -265,7 +290,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public bool HasChildPrim(uint localID) public bool HasChildPrim(uint localID)
{ {
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) foreach (SceneObjectPart part in this.m_parts.Values)
{ {
if (part.LocalID == localID) if (part.LocalID == localID)
{ {
@ -315,7 +340,7 @@ namespace OpenSim.Region.Environment.Scenes
proper.ObjectData[0].GroupID = LLUUID.Zero; proper.ObjectData[0].GroupID = LLUUID.Zero;
proper.ObjectData[0].InventorySerial = 0; proper.ObjectData[0].InventorySerial = 0;
proper.ObjectData[0].LastOwnerID = this.m_rootPart.LastOwnerID; proper.ObjectData[0].LastOwnerID = this.m_rootPart.LastOwnerID;
proper.ObjectData[0].ObjectID = this.m_uuid; proper.ObjectData[0].ObjectID = this.UUID;
proper.ObjectData[0].OwnerID = this.m_rootPart.OwnerID; proper.ObjectData[0].OwnerID = this.m_rootPart.OwnerID;
proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0"); proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0");
proper.ObjectData[0].TextureID = new byte[0]; proper.ObjectData[0].TextureID = new byte[0];
@ -331,14 +356,36 @@ namespace OpenSim.Region.Environment.Scenes
client.OutPacket(proper); client.OutPacket(proper);
} }
/// <summary>
///
/// </summary>
/// <param name="name"></param>
public void SetPartName(string name, uint localID)
{
SceneObjectPart part = this.GetChildPrim(localID);
if (part != null)
{
part.PartName = name;
}
}
public void SetPartDescription(string des, uint localID)
{
SceneObjectPart part = this.GetChildPrim(localID);
if (part != null)
{
part.Description = des;
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="localID"></param> /// <param name="localID"></param>
public void GetInventory(IClientAPI remoteClient, uint localID) public void GetPartInventory(IClientAPI remoteClient, uint localID)
{ {
AllNewSceneObjectPart2 part = this.GetChildPrim(localID); SceneObjectPart part = this.GetChildPrim(localID);
if (part != null) if (part != null)
{ {
part.GetInventory(remoteClient, localID); part.GetInventory(remoteClient, localID);
@ -354,7 +401,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="data"></param> /// <param name="data"></param>
public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data) public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
{ {
AllNewSceneObjectPart2 part = this.GetChildPrim(localID); SceneObjectPart part = this.GetChildPrim(localID);
if (part != null) if (part != null)
{ {
part.UpdateExtraParam(type, inUse, data); part.UpdateExtraParam(type, inUse, data);
@ -368,7 +415,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="textureEntry"></param> /// <param name="textureEntry"></param>
public void UpdateTextureEntry(uint localID, byte[] textureEntry) public void UpdateTextureEntry(uint localID, byte[] textureEntry)
{ {
AllNewSceneObjectPart2 part = this.GetChildPrim(localID); SceneObjectPart part = this.GetChildPrim(localID);
if (part != null) if (part != null)
{ {
part.UpdateTextureEntry(textureEntry); part.UpdateTextureEntry(textureEntry);
@ -382,7 +429,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="shapeBlock"></param> /// <param name="shapeBlock"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID) public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
{ {
AllNewSceneObjectPart2 part = this.GetChildPrim(localID); SceneObjectPart part = this.GetChildPrim(localID);
if (part != null) if (part != null)
{ {
part.UpdateShape(shapeBlock); part.UpdateShape(shapeBlock);
@ -390,6 +437,20 @@ namespace OpenSim.Region.Environment.Scenes
} }
#endregion #endregion
/// <summary>
///
/// </summary>
/// <param name="scale"></param>
/// <param name="localID"></param>
public void Resize(LLVector3 scale, uint localID)
{
SceneObjectPart part = this.GetChildPrim(localID);
if (part != null)
{
part.Resize(scale);
}
}
#region Position #region Position
/// <summary> /// <summary>
/// ///
@ -407,7 +468,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="localID"></param> /// <param name="localID"></param>
public void UpdateSinglePosition(LLVector3 pos, uint localID) public void UpdateSinglePosition(LLVector3 pos, uint localID)
{ {
AllNewSceneObjectPart2 part = this.GetChildPrim(localID); SceneObjectPart part = this.GetChildPrim(localID);
if (part != null) if (part != null)
{ {
if (part.UUID == this.m_rootPart.UUID) if (part.UUID == this.m_rootPart.UUID)
@ -437,7 +498,7 @@ namespace OpenSim.Region.Environment.Scenes
diff.Y = axDiff.y; diff.Y = axDiff.y;
diff.Z = axDiff.z; diff.Z = axDiff.z;
foreach (AllNewSceneObjectPart2 obPart in this.m_parts.Values) foreach (SceneObjectPart obPart in this.m_parts.Values)
{ {
if (obPart.UUID != this.m_rootPart.UUID) if (obPart.UUID != this.m_rootPart.UUID)
{ {
@ -479,7 +540,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="localID"></param> /// <param name="localID"></param>
public void UpdateSingleRotation(LLQuaternion rot, uint localID) public void UpdateSingleRotation(LLQuaternion rot, uint localID)
{ {
AllNewSceneObjectPart2 part = this.GetChildPrim(localID); SceneObjectPart part = this.GetChildPrim(localID);
if (part != null) if (part != null)
{ {
if (part.UUID == this.m_rootPart.UUID) if (part.UUID == this.m_rootPart.UUID)
@ -503,7 +564,7 @@ namespace OpenSim.Region.Environment.Scenes
Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z); Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
foreach (AllNewSceneObjectPart2 prim in this.m_parts.Values) foreach (SceneObjectPart prim in this.m_parts.Values)
{ {
if (prim.UUID != this.m_rootPart.UUID) if (prim.UUID != this.m_rootPart.UUID)
{ {
@ -524,7 +585,7 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <param name="part"></param> /// <param name="part"></param>
private void SetPartAsRoot(AllNewSceneObjectPart2 part) private void SetPartAsRoot(SceneObjectPart part)
{ {
this.m_rootPart = part; this.m_rootPart = part;
//this.m_uuid= part.UUID; //this.m_uuid= part.UUID;
@ -535,7 +596,7 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <param name="part"></param> /// <param name="part"></param>
private void SetPartAsNonRoot(AllNewSceneObjectPart2 part) private void SetPartAsNonRoot(SceneObjectPart part)
{ {
part.ParentID = this.m_rootPart.LocalID; part.ParentID = this.m_rootPart.LocalID;
} }
@ -554,7 +615,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="part"></param> /// <param name="part"></param>
internal void SendPartFullUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part) internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part)
{ {
if( m_rootPart == part ) if( m_rootPart == part )
{ {
@ -571,7 +632,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="part"></param> /// <param name="part"></param>
internal void SendPartTerseUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part) internal void SendPartTerseUpdate(IClientAPI remoteClient, SceneObjectPart part)
{ {
if (m_rootPart == part) if (m_rootPart == part)
{ {

View File

@ -10,7 +10,7 @@ using OpenSim.Framework.Types;
namespace OpenSim.Region.Environment.Scenes namespace OpenSim.Region.Environment.Scenes
{ {
public class AllNewSceneObjectPart2 public class SceneObjectPart
{ {
private const uint FULL_MASK_PERMISSIONS = 2147483647; private const uint FULL_MASK_PERMISSIONS = 2147483647;
@ -29,7 +29,7 @@ namespace OpenSim.Region.Environment.Scenes
protected byte[] m_particleSystem = new byte[0]; protected byte[] m_particleSystem = new byte[0];
protected AllNewSceneObjectGroup2 m_parentGroup; protected SceneObjectGroup m_parentGroup;
/// <summary> /// <summary>
/// Only used internally to schedule client updates /// Only used internally to schedule client updates
@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Scenes
public LLUUID UUID public LLUUID UUID
{ {
get { return m_uuid; } get { return m_uuid; }
set { value = m_uuid; } set { m_uuid = value ; }
} }
protected uint m_localID; protected uint m_localID;
@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public AllNewSceneObjectPart2() public SceneObjectPart()
{ {
} }
@ -190,8 +190,9 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="localID"></param> /// <param name="localID"></param>
/// <param name="shape"></param> /// <param name="shape"></param>
/// <param name="position"></param> /// <param name="position"></param>
public AllNewSceneObjectPart2(ulong regionHandle, AllNewSceneObjectGroup2 parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition) public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition)
{ {
this.m_partName = "Primitive";
this.m_regionHandle = regionHandle; this.m_regionHandle = regionHandle;
this.m_parentGroup = parent; this.m_parentGroup = parent;
@ -215,6 +216,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
} }
ScheduleFullUpdate();
} }
/// <summary> /// <summary>
@ -226,7 +228,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="localID"></param> /// <param name="localID"></param>
/// <param name="shape"></param> /// <param name="shape"></param>
/// <param name="position"></param> /// <param name="position"></param>
public AllNewSceneObjectPart2(ulong regionHandle, AllNewSceneObjectGroup2 parent, int creationDate, LLUUID ownerID, LLUUID creatorID, LLUUID lastOwnerID, uint localID, PrimitiveBaseShape shape, LLVector3 position, LLQuaternion rotation, uint flags) public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, int creationDate, LLUUID ownerID, LLUUID creatorID, LLUUID lastOwnerID, uint localID, PrimitiveBaseShape shape, LLVector3 position, LLQuaternion rotation, uint flags)
{ {
this.m_regionHandle = regionHandle; this.m_regionHandle = regionHandle;
this.m_parentGroup = parent; this.m_parentGroup = parent;
@ -250,9 +252,9 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public AllNewSceneObjectPart2 Copy(uint localID) public SceneObjectPart Copy(uint localID)
{ {
AllNewSceneObjectPart2 dupe = (AllNewSceneObjectPart2)this.MemberwiseClone(); SceneObjectPart dupe = (SceneObjectPart)this.MemberwiseClone();
dupe.m_shape = m_shape.Copy(); dupe.m_shape = m_shape.Copy();
dupe.m_regionHandle = m_regionHandle; dupe.m_regionHandle = m_regionHandle;
dupe.UUID = LLUUID.Random(); dupe.UUID = LLUUID.Random();
@ -343,6 +345,7 @@ namespace OpenSim.Region.Environment.Scenes
this.m_shape.PathTaperY = shapeBlock.PathTaperY; this.m_shape.PathTaperY = shapeBlock.PathTaperY;
this.m_shape.PathTwist = shapeBlock.PathTwist; this.m_shape.PathTwist = shapeBlock.PathTwist;
this.m_shape.PathTwistBegin = shapeBlock.PathTwistBegin; this.m_shape.PathTwistBegin = shapeBlock.PathTwistBegin;
ScheduleFullUpdate();
} }
#endregion #endregion
@ -384,6 +387,7 @@ namespace OpenSim.Region.Environment.Scenes
public void UpdateTextureEntry(byte[] textureEntry) public void UpdateTextureEntry(byte[] textureEntry)
{ {
this.m_shape.TextureEntry = textureEntry; this.m_shape.TextureEntry = textureEntry;
ScheduleFullUpdate();
} }
#endregion #endregion
@ -403,6 +407,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
this.OffsetPosition = newPos; this.OffsetPosition = newPos;
ScheduleTerseUpdate();
} }
#endregion #endregion
@ -410,6 +415,7 @@ namespace OpenSim.Region.Environment.Scenes
public void UpdateRotation(LLQuaternion rot) public void UpdateRotation(LLQuaternion rot)
{ {
this.RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W); this.RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W);
ScheduleTerseUpdate();
} }
#endregion #endregion
@ -421,6 +427,7 @@ namespace OpenSim.Region.Environment.Scenes
public void Resize(LLVector3 scale) public void Resize(LLVector3 scale)
{ {
this.m_shape.Scale = scale; this.m_shape.Scale = scale;
ScheduleFullUpdate();
} }
#endregion #endregion

View File

@ -26,7 +26,7 @@ namespace OpenSim.Region.Scripting.Examples
void ProcessConsoleMsg(string[] args) void ProcessConsoleMsg(string[] args)
{ {
if (args[0].ToLower() == "lslexport") /*if (args[0].ToLower() == "lslexport")
{ {
string sequence = ""; string sequence = "";
@ -48,12 +48,12 @@ namespace OpenSim.Region.Scripting.Examples
} }
System.Console.WriteLine(sequence); System.Console.WriteLine(sequence);
} }*/
} }
string processPrimitiveToString(OpenSim.Region.Environment.Scenes.Primitive prim) string processPrimitiveToString(OpenSim.Region.Environment.Scenes.Primitive prim)
{ {
string desc = prim.Description; /*string desc = prim.Description;
string name = prim.Name; string name = prim.Name;
LLVector3 pos = prim.Pos; LLVector3 pos = prim.Pos;
LLQuaternion rot = new LLQuaternion(prim.Rotation.x, prim.Rotation.y, prim.Rotation.z, prim.Rotation.w); LLQuaternion rot = new LLQuaternion(prim.Rotation.x, prim.Rotation.y, prim.Rotation.z, prim.Rotation.w);
@ -65,6 +65,8 @@ namespace OpenSim.Region.Scripting.Examples
setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n"; setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n";
return setPrimParams; return setPrimParams;
*/
return "";
} }
} }
} }

View File

@ -40,7 +40,7 @@ namespace OpenSim.Region.Scripting
/// <summary> /// <summary>
/// The object our script is supposed to be in /// The object our script is supposed to be in
/// </summary> /// </summary>
public SceneObject Task public SceneObjectGroup Task
{ {
get { return Scene.Objects[ObjectID]; } get { return Scene.Objects[ObjectID]; }
} }
@ -229,8 +229,8 @@ namespace OpenSim.Region.Scripting
public void osCreateLink(Key target, int parent) public void osCreateLink(Key target, int parent)
{ {
if(Scene.Entities[target] is SceneObject) if(Scene.Entities[target] is SceneObjectGroup)
Task.AddNewChildPrims((SceneObject)Scene.Entities[target]); Task.LinkToGroup((SceneObjectGroup)Scene.Entities[target]);
return; return;
} }

View File

@ -9,12 +9,12 @@ using System.Diagnostics;
namespace SimpleApp namespace SimpleApp
{ {
public class CpuCounterObject : SceneObject public class CpuCounterObject : SceneObjectGroup
{ {
private PerformanceCounter m_counter; private PerformanceCounter m_counter;
public CpuCounterObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) public CpuCounterObject(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
: base(world, eventManager, ownerID, localID, pos, shape ) : base(world, regionHandle, ownerID, localID, pos, shape )
{ {
String objectName = "Processor"; String objectName = "Processor";
String counterName = "% Processor Time"; String counterName = "% Processor Time";
@ -27,7 +27,7 @@ namespace SimpleApp
{ {
float cpu = m_counter.NextValue() / 40f; float cpu = m_counter.NextValue() / 40f;
LLVector3 size = new LLVector3(cpu, cpu, cpu); LLVector3 size = new LLVector3(cpu, cpu, cpu);
rootPrimitive.ResizeGoup( size ); //rootPrimitive.ResizeGoup( size );
base.UpdateMovement(); base.UpdateMovement();
} }

View File

@ -11,16 +11,16 @@ using Primitive=OpenSim.Region.Environment.Scenes.Primitive;
namespace SimpleApp namespace SimpleApp
{ {
public class FileSystemObject : SceneObject public class FileSystemObject : SceneObjectGroup
{ {
public FileSystemObject(Scene world, FileInfo fileInfo, LLVector3 pos) public FileSystemObject(Scene world, FileInfo fileInfo, LLVector3 pos)
: base( world, world.EventManager, LLUUID.Zero, world.NextLocalId, pos, BoxShape.Default ) : base( world, world.RegionInfo.RegionHandle, LLUUID.Zero, world.NextLocalId, pos, BoxShape.Default )
{ {
float size = (float)Math.Pow((double)fileInfo.Length, (double) 1 / 3) / 5; float size = (float)Math.Pow((double)fileInfo.Length, (double) 1 / 3) / 5;
rootPrimitive.ResizeGoup(new LLVector3(size, size, size)); // rootPrimitive.ResizeGoup(new LLVector3(size, size, size));
rootPrimitive.Text = fileInfo.Name; // rootPrimitive.Text = fileInfo.Name;
} }
public override void Update() public override void Update()

View File

@ -69,7 +69,7 @@ namespace SimpleApp
shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
LLVector3 pos = new LLVector3(138, 129, 27); LLVector3 pos = new LLVector3(138, 129, 27);
SceneObject sceneObject = new CpuCounterObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape); SceneObjectGroup sceneObject = new CpuCounterObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape);
scene.AddEntity(sceneObject); scene.AddEntity(sceneObject);
MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager ); MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager );

View File

@ -24,9 +24,9 @@ namespace OpenSim.DataStore.DB4oStorage
globalIDSearch = find; globalIDSearch = find;
} }
public bool Match(SceneObject obj) public bool Match(SceneObjectGroup obj)
{ {
return obj.rootUUID == globalIDSearch; return obj.UUID == globalIDSearch;
} }
} }
@ -43,7 +43,7 @@ namespace OpenSim.DataStore.DB4oStorage
return; return;
} }
public void StoreObject(SceneObject obj) public void StoreObject(SceneObjectGroup obj)
{ {
db.Set(obj); db.Set(obj);
} }
@ -53,21 +53,21 @@ namespace OpenSim.DataStore.DB4oStorage
IObjectSet result = db.Query(new SceneObjectQuery(obj)); IObjectSet result = db.Query(new SceneObjectQuery(obj));
if (result.Count > 0) if (result.Count > 0)
{ {
SceneObject item = (SceneObject)result.Next(); SceneObjectGroup item = (SceneObjectGroup)result.Next();
db.Delete(item); db.Delete(item);
} }
} }
public List<SceneObject> LoadObjects() public List<SceneObjectGroup> LoadObjects()
{ {
IObjectSet result = db.Get(typeof(SceneObject)); IObjectSet result = db.Get(typeof(SceneObjectGroup));
List<SceneObject> retvals = new List<SceneObject>(); List<SceneObjectGroup> retvals = new List<SceneObjectGroup>();
MainLog.Instance.Verbose("DATASTORE", "DB4O - LoadObjects found " + result.Count.ToString() + " objects"); MainLog.Instance.Verbose("DATASTORE", "DB4O - LoadObjects found " + result.Count.ToString() + " objects");
foreach (Object obj in result) foreach (Object obj in result)
{ {
retvals.Add((SceneObject)obj); retvals.Add((SceneObjectGroup)obj);
} }
return retvals; return retvals;

View File

@ -18,7 +18,7 @@ namespace OpenSim.DataStore.NullStorage
return; return;
} }
public void StoreObject(SceneObject obj) public void StoreObject(SceneObjectGroup obj)
{ {
} }
@ -28,9 +28,9 @@ namespace OpenSim.DataStore.NullStorage
} }
public List<SceneObject> LoadObjects() public List<SceneObjectGroup> LoadObjects()
{ {
return new List<SceneObject>(); return new List<SceneObjectGroup>();
} }
public void StoreTerrain(double[,] ter) public void StoreTerrain(double[,] ter)