aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs77
1 files changed, 50 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index f13f7ab..389c2c6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -390,8 +390,6 @@ namespace OpenSim.Region.Framework.Scenes
390 390
391 private SOPVehicle m_vehicleParams = null; 391 private SOPVehicle m_vehicleParams = null;
392 392
393 private KeyframeMotion m_keyframeMotion = null;
394
395 public KeyframeMotion KeyframeMotion 393 public KeyframeMotion KeyframeMotion
396 { 394 {
397 get; set; 395 get; set;
@@ -543,7 +541,11 @@ namespace OpenSim.Region.Framework.Scenes
543 CreatorID = uuid; 541 CreatorID = uuid;
544 } 542 }
545 if (parts.Length >= 2) 543 if (parts.Length >= 2)
544 {
546 CreatorData = parts[1]; 545 CreatorData = parts[1];
546 if (!CreatorData.EndsWith("/"))
547 CreatorData += "/";
548 }
547 if (parts.Length >= 3) 549 if (parts.Length >= 3)
548 name = parts[2]; 550 name = parts[2];
549 551
@@ -4642,6 +4644,11 @@ namespace OpenSim.Region.Framework.Scenes
4642 } 4644 }
4643 } 4645 }
4644*/ 4646*/
4647 if (pa != null)
4648 {
4649 pa.SetMaterial(Material);
4650 DoPhysicsPropertyUpdate(UsePhysics, true);
4651 }
4645 } 4652 }
4646 else // it already has a physical representation 4653 else // it already has a physical representation
4647 { 4654 {
@@ -4696,6 +4703,46 @@ namespace OpenSim.Region.Framework.Scenes
4696// m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags); 4703// m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags);
4697 } 4704 }
4698 4705
4706 // Subscribe for physics collision events if needed for scripts and sounds
4707 public void SubscribeForCollisionEvents()
4708 {
4709 if (PhysActor != null)
4710 {
4711 if (
4712 ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
4713 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
4714 ((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
4715 ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
4716 ((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
4717 ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
4718 ((ParentGroup.RootPart.AggregateScriptEvents & scriptEvents.collision) != 0) ||
4719 ((ParentGroup.RootPart.AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
4720 ((ParentGroup.RootPart.AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
4721 ((ParentGroup.RootPart.AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
4722 ((ParentGroup.RootPart.AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
4723 ((ParentGroup.RootPart.AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
4724 (CollisionSound != UUID.Zero)
4725 )
4726 {
4727 if (!PhysActor.SubscribedEvents())
4728 {
4729 // If not already subscribed for event, set up for a collision event.
4730 PhysActor.OnCollisionUpdate += PhysicsCollision;
4731 PhysActor.SubscribeEvents(1000);
4732 }
4733 }
4734 else
4735 {
4736 // There is no need to be subscribed to collisions so, if subscribed, remove subscription
4737 if (PhysActor.SubscribedEvents())
4738 {
4739 PhysActor.OnCollisionUpdate -= PhysicsCollision;
4740 PhysActor.UnSubscribeEvents();
4741 }
4742 }
4743 }
4744 }
4745
4699 /// <summary> 4746 /// <summary>
4700 /// Adds this part to the physics scene. 4747 /// Adds this part to the physics scene.
4701 /// and sets the PhysActor property 4748 /// and sets the PhysActor property
@@ -5154,31 +5201,7 @@ namespace OpenSim.Region.Framework.Scenes
5154 { 5201 {
5155 objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop; 5202 objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop;
5156 } 5203 }
5157/* 5204
5158 PhysicsActor pa = PhysActor;
5159 if (pa != null)
5160 {
5161 if (
5162// ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
5163// ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
5164// ((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
5165// ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
5166// ((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
5167// ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
5168 ((AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) || ((ParentGroup.RootPart.AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) || (CollisionSound != UUID.Zero)
5169 )
5170 {
5171 // subscribe to physics updates.
5172 pa.OnCollisionUpdate += PhysicsCollision;
5173 pa.SubscribeEvents(1000);
5174 }
5175 else
5176 {
5177 pa.UnSubscribeEvents();
5178 pa.OnCollisionUpdate -= PhysicsCollision;
5179 }
5180 }
5181 */
5182 UpdatePhysicsSubscribedEvents(); 5205 UpdatePhysicsSubscribedEvents();
5183 5206
5184 //if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0) 5207 //if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)