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 inventoryItemID;
private BaseHttpServer httpListener;
private bool SaveAssets = true;
private bool SaveAssets = false;
private string m_assetName = "";
/// <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>
void Initialise(string filename, string dbname);
void StoreObject(SceneObject obj);
void StoreObject(SceneObjectGroup obj);
void RemoveObject(LLUUID uuid);
List<SceneObject> LoadObjects();
List<SceneObjectGroup> LoadObjects();
void StoreTerrain(double[,] terrain);
double[,] LoadTerrain();

View File

@ -16,7 +16,7 @@ namespace OpenSim.Region.Environment.LandManagement
{
#region Member Variables
public LandData landData = new LandData();
public List<SceneObject> primsOverMe = new List<SceneObject>();
public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
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)
{
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_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)
{
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)
{
@ -525,7 +525,7 @@ namespace OpenSim.Region.Environment.LandManagement
#endregion
#region Object Returning
public void returnObject(SceneObject obj)
public void returnObject(SceneObjectGroup obj)
{
}
public void returnLandObjects(int type, LLUUID owner)
@ -544,12 +544,12 @@ namespace OpenSim.Region.Environment.LandManagement
primsOverMe.Clear();
}
public void addPrimToCount(SceneObject obj)
public void addPrimToCount(SceneObjectGroup obj)
{
LLUUID prim_owner = obj.rootPrimitive.OwnerID;
int prim_count = obj.primCount;
LLUUID prim_owner = obj.OwnerID;
int prim_count = obj.PrimCount;
if (obj.isSelected)
if (obj.IsSelected)
{
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))
{
LLUUID prim_owner = obj.rootPrimitive.OwnerID;
int prim_count = obj.primCount;
LLUUID prim_owner = obj.OwnerID;
int prim_count = obj.PrimCount;
if (prim_owner == landData.ownerID)
{

View File

@ -552,7 +552,7 @@ namespace OpenSim.Region.Environment.LandManagement
this.landPrimCountTainted = true;
}
public void addPrimToLandPrimCounts(SceneObject obj)
public void addPrimToLandPrimCounts(SceneObjectGroup obj)
{
LLVector3 position = obj.Pos;
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)
{

View File

@ -53,11 +53,11 @@ namespace OpenSim.Region.Environment
bool permission = false;
// 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;
SceneObject task = (SceneObject)m_scene.Entities[obj];
LLUUID taskOwner = task.rootPrimitive.OwnerID;
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[obj];
LLUUID taskOwner = null;
// Object owners should be able to edit their own content
if (user == taskOwner)

View File

@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Scenes
private PrimitiveBaseShape m_shape;
private byte[] m_particleSystem = new byte[0];
public SceneObject m_RootParent;
public SceneObjectOLD m_RootParent;
public bool m_isRootPrim;
public EntityBase m_Parent;
@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Constructors
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_scene = scene;
@ -184,7 +184,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Duplication
public Primitive Copy(EntityBase parent, SceneObject rootParent)
public Primitive Copy(EntityBase parent, SceneObjectOLD rootParent)
{
Primitive dupe = (Primitive)MemberwiseClone();
@ -204,7 +204,7 @@ namespace OpenSim.Region.Environment.Scenes
dupe.m_uuid = LLUUID.Random();
dupe.LocalId = newLocalID;
if (parent is SceneObject)
if (parent is SceneObjectGroup)
{
dupe.m_isRootPrim = true;
dupe.ParentID = 0;
@ -314,13 +314,13 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <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 + ")");
//TODO check permissions
m_children.Add(linkObject.rootPrimitive);
linkObject.rootPrimitive.SetNewParent(this, m_RootParent);
linkObject.rootPrimitive.SetNewParent(this, m_RootParent);
m_scene.DeleteEntity(linkObject.rootUUID);
linkObject.DeleteAllChildren();
@ -333,7 +333,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
/// <param name="newParent"></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);
m_isRootPrim = false;
@ -363,7 +363,7 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <param name="newRoot"></param>
public void SetRootParent(SceneObject newRoot, Primitive newParent, LLVector3 oldParentPosition,
public void SetRootParent(SceneObjectOLD newRoot, Primitive newParent, LLVector3 oldParentPosition,
Quaternion oldParentRotation)
{
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>
public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags)
{
SceneObject originPrim = null;
SceneObjectGroup originPrim = null;
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;
}
}
@ -287,15 +287,16 @@ namespace OpenSim.Region.Environment.Scenes
if (originPrim != null)
{
SceneObject copy = originPrim.Copy();
SceneObjectGroup copy = originPrim.Copy();
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++)
{
copy.SendAllChildPrimsToClient(avatars[i].ControllingClient);
}
// copy.SendAllChildPrimsToClient(avatars[i].ControllingClient);
}*/
}
else
@ -312,40 +313,40 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="childPrims"></param>
public void LinkObjects(uint parentPrim, List<uint> childPrims)
{
SceneObject parenPrim = null;
SceneObjectGroup parenPrim = null;
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;
}
}
}
List<SceneObject> children = new List<SceneObject>();
List<SceneObjectGroup> children = new List<SceneObjectGroup>();
if (parenPrim != null)
{
for (int i = 0; i < childPrims.Count; i++)
{
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>
public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(primLocalID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (hasPrim != false)
{
prim.UpdateShape(shapeBlock);
((SceneObjectGroup)ent).UpdateShape(shapeBlock, primLocalID);
break;
}
}
@ -373,15 +374,15 @@ namespace OpenSim.Region.Environment.Scenes
public void UpdateExtraParam(uint primLocalID, ushort type, bool inUse, byte[] data)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(primLocalID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (hasPrim != false)
{
prim.UpdateExtraParam(type, inUse, data);
((SceneObjectGroup)ent).UpdateExtraParam(primLocalID, type, inUse, data);
break;
}
}
@ -395,15 +396,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="primLocalID"></param>
public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(primLocalID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (hasPrim != false)
{
prim.GetInventory(remoteClient, primLocalID);
((SceneObjectGroup)ent).GetPartInventory(remoteClient, primLocalID);
break;
}
}
@ -419,12 +421,12 @@ namespace OpenSim.Region.Environment.Scenes
{
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);
((SceneObject)ent).isSelected = true;
((SceneObjectGroup)ent).GetProperites(remoteClient);
((SceneObjectGroup)ent).IsSelected = true;
this.LandManager.setPrimsTainted();
break;
}
@ -441,11 +443,11 @@ namespace OpenSim.Region.Environment.Scenes
{
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();
break;
}
@ -460,15 +462,15 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="description"></param>
public void PrimDescription(uint primLocalID, string description)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(primLocalID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (hasPrim != false)
{
prim.Description = description;
((SceneObjectGroup)ent).SetPartDescription(description, primLocalID);
break;
}
}
@ -482,15 +484,15 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="description"></param>
public void PrimName(uint primLocalID, string name)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(primLocalID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID);
if (hasPrim != false)
{
prim.Name = name;
((SceneObjectGroup)ent).SetPartName(name, primLocalID);
break;
}
}
@ -499,27 +501,19 @@ namespace OpenSim.Region.Environment.Scenes
public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(objectID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(objectID);
if (hasPrim != false)
{
((SceneObject)ent).GrapMovement(offset, pos, remoteClient);
((SceneObjectGroup)ent).GrapMovement(offset, pos, remoteClient);
break;
}
}
}
/*
if (this.Entities.ContainsKey(objectID))
{
if (this.Entities[objectID] is SceneObject)
{
((SceneObject)this.Entities[objectID]).GrapMovement(offset, pos, remoteClient);
}
}*/
}
/// <summary>
@ -541,15 +535,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param>
public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(localID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
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>
public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(localID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
if (hasPrim != false)
{
prim.UpdateGroupPosition(pos);
((SceneObjectGroup)ent).UpdateGroupPosition(pos);
break;
}
}
@ -583,9 +578,9 @@ namespace OpenSim.Region.Environment.Scenes
Primitive prim = null;
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)
{
prim.UpdateSinglePosition(pos);
@ -604,15 +599,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param>
public void UpdatePrimRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(localID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
if (hasPrim != false)
{
prim.UpdateGroupMouseRotation(pos, rot);
((SceneObjectGroup)ent).UpdateGroupRotation(pos, rot);
// prim.UpdateGroupMouseRotation(pos, rot);
break;
}
}
@ -627,15 +623,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param>
public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(localID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
if (hasPrim != false)
{
prim.UpdateGroupRotation(rot);
((SceneObjectGroup)ent).UpdateGroupRotation(rot);
//prim.UpdateGroupRotation(rot);
break;
}
}
@ -654,9 +651,9 @@ namespace OpenSim.Region.Environment.Scenes
Primitive prim = null;
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)
{
prim.UpdateSingleRotation(rot);
@ -674,15 +671,16 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param>
public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient)
{
Primitive prim = null;
bool hasPrim = false;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
if (ent is SceneObjectGroup)
{
prim = ((SceneObject)ent).HasChildPrim(localID);
if (prim != null)
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
if (hasPrim != false)
{
prim.ResizeGoup(scale);
((SceneObjectGroup)ent).Resize(scale, localID);
// prim.ResizeGoup(scale);
break;
}
}

View File

@ -54,7 +54,7 @@ namespace OpenSim.Region.Environment.Scenes
{
protected Timer m_heartbeatTimer = new Timer();
protected Dictionary<LLUUID, ScenePresence> Avatars;
protected Dictionary<LLUUID, SceneObject> Prims;
protected Dictionary<LLUUID, SceneObjectGroup> Prims;
protected PhysicsScene phyScene;
protected float timeStep = 0.1f;
private Random Rand = new Random();
@ -109,7 +109,7 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_scriptManager; }
}
public Dictionary<LLUUID, SceneObject> Objects
public Dictionary<LLUUID, SceneObjectGroup> Objects
{
get { return Prims; }
}
@ -149,11 +149,11 @@ namespace OpenSim.Region.Environment.Scenes
MainLog.Instance.Verbose("Creating new entitities instance");
Entities = new Dictionary<LLUUID, EntityBase>();
Avatars = new Dictionary<LLUUID, ScenePresence>();
Prims = new Dictionary<LLUUID, SceneObject>();
Prims = new Dictionary<LLUUID, SceneObjectGroup>();
MainLog.Instance.Verbose("Loading objects from datastore");
List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects();
foreach (SceneObject prim in PrimsFromDB)
List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects();
foreach (SceneObjectGroup prim in PrimsFromDB)
{
AddEntity(prim);
}
@ -463,10 +463,10 @@ namespace OpenSim.Region.Environment.Scenes
public void LoadPrimsFromStorage()
{
MainLog.Instance.Verbose("World.cs: LoadPrimsFromStorage() - Loading primitives");
List<SceneObject> NewObjectsList = storageManager.DataStore.LoadObjects();
foreach (SceneObject obj in NewObjectsList)
List<SceneObjectGroup> NewObjectsList = storageManager.DataStore.LoadObjects();
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>
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);
}
@ -509,28 +509,28 @@ namespace OpenSim.Region.Environment.Scenes
{
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;
}
}
}
}
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);
Entities.Remove(sceneObject.rootUUID);
Entities.Remove(sceneObject.UUID);
m_LandManager.setPrimsTainted();
}
}
@ -779,9 +779,9 @@ namespace OpenSim.Region.Environment.Scenes
{
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 event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
public delegate void OnParcelPrimCountAddDelegate(SceneObject obj);
public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
public delegate void OnScriptConsoleDelegate(string[] args);
@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes
OnParcelPrimCountUpdate();
}
}
public void TriggerParcelPrimCountAdd(SceneObject obj)
public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
{
if (OnParcelPrimCountAdd != null)
{

View File

@ -38,7 +38,7 @@ using OpenSim.Physics.Manager;
namespace OpenSim.Region.Environment.Scenes
{
public class SceneObject : EntityBase
public class SceneObjectOLD : EntityBase
{
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
@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <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_scene = world;
@ -102,7 +102,7 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <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>
public void ProcessBackup(OpenSim.Region.Interfaces.IRegionDataStore datastore)
{
datastore.StoreObject(this);
// datastore.StoreObject(this);
}
/// <summary>
@ -134,7 +134,7 @@ namespace OpenSim.Region.Environment.Scenes
private void ProcessParcelPrimCountUpdate()
{
m_eventManager.TriggerParcelPrimCountAdd(this);
// m_eventManager.TriggerParcelPrimCountAdd(this);
}
/// <summary>
@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Scenes
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.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
@ -165,9 +165,9 @@ namespace OpenSim.Region.Environment.Scenes
/// Makes a copy of this SceneObject (and child primitives)
/// </summary>
/// <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_eventManager = this.m_eventManager;
@ -207,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <param name="primObject"></param>
public void AddNewChildPrims(SceneObject primObject)
public void AddNewChildPrims(SceneObjectOLD primObject)
{
this.rootPrimitive.AddNewChildren(primObject);
}

View File

@ -11,12 +11,12 @@ namespace OpenSim.Region.Environment.Scenes
{
// public delegate void PrimCountTaintedDelegate();
public class AllNewSceneObjectGroup2 : EntityBase
public class SceneObjectGroup : EntityBase
{
private Encoding enc = Encoding.ASCII;
protected AllNewSceneObjectPart2 m_rootPart;
protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>();
protected SceneObjectPart m_rootPart;
protected Dictionary<LLUUID, SceneObjectPart> m_parts = new Dictionary<LLUUID, SceneObjectPart>();
protected ulong m_regionHandle;
@ -38,6 +38,12 @@ namespace OpenSim.Region.Environment.Scenes
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
{
get { return m_rootPart.GroupPosition; }
@ -45,7 +51,7 @@ namespace OpenSim.Region.Environment.Scenes
{
lock (this.m_parts)
{
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
foreach (SceneObjectPart part in this.m_parts.Values)
{
part.GroupPosition = value;
}
@ -65,10 +71,29 @@ namespace OpenSim.Region.Environment.Scenes
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>
public AllNewSceneObjectGroup2()
public SceneObjectGroup()
{
}
@ -76,7 +101,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary>
///
/// </summary>
public AllNewSceneObjectGroup2(byte[] data)
public SceneObjectGroup(byte[] data)
{
}
@ -84,14 +109,14 @@ namespace OpenSim.Region.Environment.Scenes
/// <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_scene = scene;
this.Pos = pos;
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.SetPartAsRoot(newPart);
}
@ -102,16 +127,16 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <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.m_scene = m_scene;
dupe.m_regionHandle = this.m_regionHandle;
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)
{
@ -125,9 +150,9 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <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.SetPartAsRoot(newPart);
}
@ -136,9 +161,9 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <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.SetPartAsNonRoot(newPart);
}
@ -149,7 +174,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public override void Update()
{
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
foreach (SceneObjectPart part in this.m_parts.Values)
{
part.SendScheduledUpdates();
}
@ -160,7 +185,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void ScheduleGroupForFullUpdate()
{
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
foreach (SceneObjectPart part in this.m_parts.Values)
{
part.ScheduleFullUpdate();
}
@ -171,7 +196,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void ScheduleGroupForTerseUpdate()
{
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
foreach (SceneObjectPart part in this.m_parts.Values)
{
part.ScheduleTerseUpdate();
}
@ -182,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void SendGroupFullUpdate()
{
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
foreach (SceneObjectPart part in this.m_parts.Values)
{
part.SendFullUpdateToAllClients();
}
@ -193,7 +218,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void SendGroupTerseUpdate()
{
foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
foreach (SceneObjectPart part in this.m_parts.Values)
{
part.SendTerseUpdateToAllClients();
}
@ -203,7 +228,7 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <param name="objectGroup"></param>
public void LinkToGroup(AllNewSceneObjectGroup2 objectGroup)
public void LinkToGroup(SceneObjectGroup objectGroup)
{
}
@ -213,9 +238,9 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
/// <param name="primID"></param>
/// <returns></returns>
private AllNewSceneObjectPart2 GetChildPrim(LLUUID primID)
private SceneObjectPart GetChildPrim(LLUUID primID)
{
AllNewSceneObjectPart2 childPart = null;
SceneObjectPart childPart = null;
if (this.m_parts.ContainsKey(primID))
{
childPart = this.m_parts[primID];
@ -228,9 +253,9 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
/// <param name="localID"></param>
/// <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)
{
@ -248,7 +273,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns>
public bool HasChildPrim(LLUUID primID)
{
AllNewSceneObjectPart2 childPart = null;
SceneObjectPart childPart = null;
if (this.m_parts.ContainsKey(primID))
{
childPart = this.m_parts[primID];
@ -265,7 +290,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns>
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)
{
@ -315,7 +340,7 @@ namespace OpenSim.Region.Environment.Scenes
proper.ObjectData[0].GroupID = LLUUID.Zero;
proper.ObjectData[0].InventorySerial = 0;
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].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0");
proper.ObjectData[0].TextureID = new byte[0];
@ -331,14 +356,36 @@ namespace OpenSim.Region.Environment.Scenes
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>
/// <param name="remoteClient"></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)
{
part.GetInventory(remoteClient, localID);
@ -354,7 +401,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="data"></param>
public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
{
AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
SceneObjectPart part = this.GetChildPrim(localID);
if (part != null)
{
part.UpdateExtraParam(type, inUse, data);
@ -368,7 +415,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="textureEntry"></param>
public void UpdateTextureEntry(uint localID, byte[] textureEntry)
{
AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
SceneObjectPart part = this.GetChildPrim(localID);
if (part != null)
{
part.UpdateTextureEntry(textureEntry);
@ -382,7 +429,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="shapeBlock"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
{
AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
SceneObjectPart part = this.GetChildPrim(localID);
if (part != null)
{
part.UpdateShape(shapeBlock);
@ -390,6 +437,20 @@ namespace OpenSim.Region.Environment.Scenes
}
#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
/// <summary>
///
@ -407,7 +468,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="localID"></param>
public void UpdateSinglePosition(LLVector3 pos, uint localID)
{
AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
SceneObjectPart part = this.GetChildPrim(localID);
if (part != null)
{
if (part.UUID == this.m_rootPart.UUID)
@ -437,7 +498,7 @@ namespace OpenSim.Region.Environment.Scenes
diff.Y = axDiff.y;
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)
{
@ -479,7 +540,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="localID"></param>
public void UpdateSingleRotation(LLQuaternion rot, uint localID)
{
AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
SceneObjectPart part = this.GetChildPrim(localID);
if (part != null)
{
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 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)
{
@ -524,7 +585,7 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <param name="part"></param>
private void SetPartAsRoot(AllNewSceneObjectPart2 part)
private void SetPartAsRoot(SceneObjectPart part)
{
this.m_rootPart = part;
//this.m_uuid= part.UUID;
@ -535,7 +596,7 @@ namespace OpenSim.Region.Environment.Scenes
///
/// </summary>
/// <param name="part"></param>
private void SetPartAsNonRoot(AllNewSceneObjectPart2 part)
private void SetPartAsNonRoot(SceneObjectPart part)
{
part.ParentID = this.m_rootPart.LocalID;
}
@ -554,7 +615,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="part"></param>
internal void SendPartFullUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part)
internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part)
{
if( m_rootPart == part )
{
@ -571,7 +632,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="part"></param>
internal void SendPartTerseUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part)
internal void SendPartTerseUpdate(IClientAPI remoteClient, SceneObjectPart part)
{
if (m_rootPart == part)
{

View File

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

View File

@ -26,7 +26,7 @@ namespace OpenSim.Region.Scripting.Examples
void ProcessConsoleMsg(string[] args)
{
if (args[0].ToLower() == "lslexport")
/*if (args[0].ToLower() == "lslexport")
{
string sequence = "";
@ -48,12 +48,12 @@ namespace OpenSim.Region.Scripting.Examples
}
System.Console.WriteLine(sequence);
}
}*/
}
string processPrimitiveToString(OpenSim.Region.Environment.Scenes.Primitive prim)
{
string desc = prim.Description;
/*string desc = prim.Description;
string name = prim.Name;
LLVector3 pos = prim.Pos;
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";
return setPrimParams;
*/
return "";
}
}
}

View File

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

View File

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

View File

@ -11,16 +11,16 @@ using Primitive=OpenSim.Region.Environment.Scenes.Primitive;
namespace SimpleApp
{
public class FileSystemObject : SceneObject
public class FileSystemObject : SceneObjectGroup
{
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;
rootPrimitive.ResizeGoup(new LLVector3(size, size, size));
rootPrimitive.Text = fileInfo.Name;
// rootPrimitive.ResizeGoup(new LLVector3(size, size, size));
// rootPrimitive.Text = fileInfo.Name;
}
public override void Update()

View File

@ -69,7 +69,7 @@ namespace SimpleApp
shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
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);
MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager );

View File

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

View File

@ -18,7 +18,7 @@ namespace OpenSim.DataStore.NullStorage
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)