From 76e1462dff5594252af8e26cc6fc9b9560af090d Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 7 Dec 2008 04:03:09 +0000 Subject: * Tweaks physics so that linked prim are a single body. This will make linked prim more stable and probably the last obstacle to vehicles physics wise. * Fixed a bug that caused physics proxies to be scattered when you link an object. * Single physical prim work exactly the same as before, just linked physical prim will have changed. --- OpenSim/Region/Environment/Scenes/SceneGraph.cs | 4 ++++ OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs index 078916a..aed01df 100644 --- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs @@ -1405,6 +1405,10 @@ namespace OpenSim.Region.Environment.Scenes foreach (SceneObjectGroup sceneObj in children) { parenPrim.LinkToGroup(sceneObj); + + // this is here so physics gets updated! + // Don't remove! Bad juju! Stay away! or fix physics! + sceneObj.AbsolutePosition = sceneObj.AbsolutePosition; } // We need to explicitly resend the newly link prim's object properties since no other actions diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index b15aff8..2fc379c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1247,6 +1247,12 @@ if (m_shape != null) { if (userExposed) dupe.UUID = UUID.Random(); + //memberwiseclone means it also clones the physics actor reference + // This will make physical prim 'bounce' if not set to null. + if (!userExposed) + dupe.PhysActor = null; + + dupe._ownerID = AgentID; dupe._groupID = GroupID; dupe.GroupPosition = GroupPosition; -- cgit v1.1