diff options
Started change to having SceneObject and then that having child Primitives which in turn have a Shape object (currently PrimitiveBaseShape). The plan is only for the SceneObject to interface with the physics engines. As a physics Entity should be able to have mulitple shapes connected to it.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObject.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObject.cs | 80 |
1 files changed, 63 insertions, 17 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs index 88fb160..a228638 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObject.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs | |||
@@ -37,22 +37,46 @@ using OpenSim.Framework.Inventory; | |||
37 | 37 | ||
38 | namespace OpenSim.Region.Environment.Scenes | 38 | namespace OpenSim.Region.Environment.Scenes |
39 | { | 39 | { |
40 | public class SceneObject : Entity | 40 | public class SceneObject : EntityBase |
41 | { | 41 | { |
42 | private LLUUID rootUUID; | 42 | |
43 | //private Dictionary<LLUUID, Primitive> ChildPrimitives = new Dictionary<LLUUID, Primitive>(); | 43 | private Dictionary<LLUUID, Primitive> ChildPrimitives = new Dictionary<LLUUID, Primitive>(); //list of all primitive id's that are part of this group |
44 | protected Primitive rootPrimitive; | 44 | protected Primitive rootPrimitive; |
45 | private Scene m_world; | 45 | private Scene m_world; |
46 | protected ulong regionHandle; | 46 | protected ulong m_regionHandle; |
47 | 47 | ||
48 | private bool physicsEnabled = false; | ||
49 | private PhysicsScene m_PhysScene; | ||
50 | private PhysicsActor m_PhysActor; | ||
51 | |||
52 | public LLUUID rootUUID | ||
53 | { | ||
54 | get | ||
55 | { | ||
56 | this.uuid = this.rootPrimitive.uuid; | ||
57 | return this.uuid; | ||
58 | } | ||
59 | } | ||
60 | |||
61 | public uint rootLocalID | ||
62 | { | ||
63 | get | ||
64 | { | ||
65 | this.m_localId = this.rootPrimitive.LocalId; | ||
66 | return this.LocalId; | ||
67 | } | ||
68 | } | ||
48 | /// <summary> | 69 | /// <summary> |
49 | /// | 70 | /// |
50 | /// </summary> | 71 | /// </summary> |
51 | public SceneObject() | 72 | public SceneObject(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID) |
52 | { | 73 | { |
74 | m_regionHandle = regionHandle; | ||
75 | m_world = world; | ||
76 | this.Pos = addPacket.ObjectData.RayEnd; | ||
77 | this.CreateFromPacket(addPacket, ownerID, localID); | ||
53 | 78 | ||
54 | } | 79 | } |
55 | |||
56 | /// <summary> | 80 | /// <summary> |
57 | /// | 81 | /// |
58 | /// </summary> | 82 | /// </summary> |
@@ -61,7 +85,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
61 | /// <param name="localID"></param> | 85 | /// <param name="localID"></param> |
62 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) | 86 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) |
63 | { | 87 | { |
64 | this.rootPrimitive = new Primitive( this.regionHandle, this.m_world, addPacket, agentID, localID); | 88 | this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, addPacket, agentID, localID, true, this, this); |
89 | this.children.Add(rootPrimitive); | ||
90 | this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive); | ||
65 | } | 91 | } |
66 | 92 | ||
67 | /// <summary> | 93 | /// <summary> |
@@ -76,11 +102,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
76 | /// <summary> | 102 | /// <summary> |
77 | /// | 103 | /// |
78 | /// </summary> | 104 | /// </summary> |
79 | public override void update() | 105 | /// <param name="primID"></param> |
106 | /// <returns></returns> | ||
107 | public Primitive HasChildPrim(LLUUID primID) | ||
80 | { | 108 | { |
109 | if (this.ChildPrimitives.ContainsKey(primID)) | ||
110 | { | ||
111 | return this.ChildPrimitives[primID]; | ||
112 | } | ||
81 | 113 | ||
114 | return null; | ||
82 | } | 115 | } |
83 | 116 | ||
117 | |||
84 | /// <summary> | 118 | /// <summary> |
85 | /// | 119 | /// |
86 | /// </summary> | 120 | /// </summary> |
@@ -92,6 +126,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
92 | /// <summary> | 126 | /// <summary> |
93 | /// | 127 | /// |
94 | /// </summary> | 128 | /// </summary> |
129 | /// <param name="offset"></param> | ||
130 | /// <param name="pos"></param> | ||
131 | /// <param name="remoteClient"></param> | ||
132 | public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) | ||
133 | { | ||
134 | this.Pos = pos; | ||
135 | this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient); | ||
136 | } | ||
137 | |||
138 | /// <summary> | ||
139 | /// | ||
140 | /// </summary> | ||
95 | /// <param name="client"></param> | 141 | /// <param name="client"></param> |
96 | public void GetProperites(IClientAPI client) | 142 | public void GetProperites(IClientAPI client) |
97 | { | 143 | { |
@@ -100,25 +146,25 @@ namespace OpenSim.Region.Environment.Scenes | |||
100 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; | 146 | proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; |
101 | proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); | 147 | proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); |
102 | proper.ObjectData[0].ItemID = LLUUID.Zero; | 148 | proper.ObjectData[0].ItemID = LLUUID.Zero; |
103 | proper.ObjectData[0].CreationDate = (ulong)this.rootPrimitive.primData.CreationDate; | 149 | proper.ObjectData[0].CreationDate = (ulong)this.rootPrimitive.CreationDate; |
104 | proper.ObjectData[0].CreatorID = this.rootPrimitive.primData.OwnerID; | 150 | proper.ObjectData[0].CreatorID = this.rootPrimitive.OwnerID; |
105 | proper.ObjectData[0].FolderID = LLUUID.Zero; | 151 | proper.ObjectData[0].FolderID = LLUUID.Zero; |
106 | proper.ObjectData[0].FromTaskID = LLUUID.Zero; | 152 | proper.ObjectData[0].FromTaskID = LLUUID.Zero; |
107 | proper.ObjectData[0].GroupID = LLUUID.Zero; | 153 | proper.ObjectData[0].GroupID = LLUUID.Zero; |
108 | proper.ObjectData[0].InventorySerial = 0; | 154 | proper.ObjectData[0].InventorySerial = 0; |
109 | proper.ObjectData[0].LastOwnerID = LLUUID.Zero; | 155 | proper.ObjectData[0].LastOwnerID = LLUUID.Zero; |
110 | proper.ObjectData[0].ObjectID = this.uuid; | 156 | proper.ObjectData[0].ObjectID = this.rootUUID; |
111 | proper.ObjectData[0].OwnerID = this.rootPrimitive.primData.OwnerID; | 157 | proper.ObjectData[0].OwnerID = this.rootPrimitive.OwnerID; |
112 | proper.ObjectData[0].TouchName = new byte[0]; | 158 | proper.ObjectData[0].TouchName = new byte[0]; |
113 | proper.ObjectData[0].TextureID = new byte[0]; | 159 | proper.ObjectData[0].TextureID = new byte[0]; |
114 | proper.ObjectData[0].SitName = new byte[0]; | 160 | proper.ObjectData[0].SitName = new byte[0]; |
115 | proper.ObjectData[0].Name = new byte[0]; | 161 | proper.ObjectData[0].Name = new byte[0]; |
116 | proper.ObjectData[0].Description = new byte[0]; | 162 | proper.ObjectData[0].Description = new byte[0]; |
117 | proper.ObjectData[0].OwnerMask = this.rootPrimitive.primData.OwnerMask; | 163 | proper.ObjectData[0].OwnerMask = this.rootPrimitive.OwnerMask; |
118 | proper.ObjectData[0].NextOwnerMask = this.rootPrimitive.primData.NextOwnerMask; | 164 | proper.ObjectData[0].NextOwnerMask = this.rootPrimitive.NextOwnerMask; |
119 | proper.ObjectData[0].GroupMask = this.rootPrimitive.primData.GroupMask; | 165 | proper.ObjectData[0].GroupMask = this.rootPrimitive.GroupMask; |
120 | proper.ObjectData[0].EveryoneMask = this.rootPrimitive.primData.EveryoneMask; | 166 | proper.ObjectData[0].EveryoneMask = this.rootPrimitive.EveryoneMask; |
121 | proper.ObjectData[0].BaseMask = this.rootPrimitive.primData.BaseMask; | 167 | proper.ObjectData[0].BaseMask = this.rootPrimitive.BaseMask; |
122 | 168 | ||
123 | client.OutPacket(proper); | 169 | client.OutPacket(proper); |
124 | 170 | ||