| 134 |
|
|
| 135 |
void SceneGraph_OnObjectRemove(EntityBase obj) |
void SceneGraph_OnObjectRemove(EntityBase obj) |
| 136 |
{ |
{ |
| 137 |
DeleteObject(obj.UUID); |
//this object group was removed from scene, but part is not necessarily removed from all groups |
| 138 |
|
//DeleteObject(obj.UUID); |
| 139 |
} |
} |
| 140 |
|
|
| 141 |
|
|
| 412 |
{ |
{ |
| 413 |
foreach (EntityBase e in s.Entities) |
foreach (EntityBase e in s.Entities) |
| 414 |
{ |
{ |
| 415 |
RexObjectProperties p = LoadObject(e.UUID); |
if (e is SceneObjectGroup) |
| 416 |
p.ParentObjectID = e.UUID; |
{ |
| 417 |
|
SceneObjectGroup oGroup = (SceneObjectGroup)e; |
| 418 |
|
|
| 419 |
|
foreach (SceneObjectPart part in oGroup.GetParts()) |
| 420 |
|
{ |
| 421 |
|
RexObjectProperties p = LoadObject(part.UUID); |
| 422 |
|
p.ParentObjectID = part.UUID; |
| 423 |
p.SetRexEventManager(this); |
p.SetRexEventManager(this); |
| 424 |
RexObjectPropertiesCache.Add(e.UUID,p); |
RexObjectPropertiesCache.Add(part.UUID, p); |
| 425 |
|
|
| 426 |
// Since loaded objects have their properties already set, any initialization that needs to be done should be here. |
// Since loaded objects have their properties already set, any initialization that needs to be done should be here. |
| 427 |
if(p.RexCollisionMeshUUID != UUID.Zero) |
if(p.RexCollisionMeshUUID != UUID.Zero) |
| 428 |
TriggerOnChangeCollisionMesh(e.UUID); |
TriggerOnChangeCollisionMesh(part.UUID); |
| 429 |
|
|
| 430 |
if (p.RexClassName.Length > 0) |
if (p.RexClassName.Length > 0) |
| 431 |
{ |
{ |
| 432 |
SceneObjectPart sop = s.GetSceneObjectPart(p.ParentObjectID); |
part.SetScriptEvents(p.ParentObjectID, (int)scriptEvents.touch_start); |
| 433 |
if (sop != null) |
} |
| 434 |
sop.SetScriptEvents(p.ParentObjectID, (int)scriptEvents.touch_start); |
} |
| 435 |
} |
} |
| 436 |
} |
} |
| 437 |
} |
} |