From 8f3d2f5f5eb172923328f554821c34560dac4f3b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 28 Apr 2011 00:59:21 +0100 Subject: Fix a bug where physical objects rezzed with an initial velocity by script do not receive this velocity. This is a minimal fix for the 0.7.1 release, pending a non copy/paste solution. This hopefully addresses http://opensimulator.org/mantis/view.php?id=5457 The bug was introduced in commit 3ba5eeb --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 0f85925..0b2b01a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2039,6 +2039,12 @@ namespace OpenSim.Region.Framework.Scenes if (rot != null) group.UpdateGroupRotationR((Quaternion)rot); + // TODO: This needs to be refactored with the similar code in + // SceneGraph.AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel) + // possibly by allowing this method to take a null rotation. + if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) + group.RootPart.ApplyImpulse((vel * group.GetMass()), false); + // We can only call this after adding the scene object, since the scene object references the scene // to find out if scripts should be activated at all. group.CreateScriptInstances(param, true, DefaultScriptEngine, 3); -- cgit v1.1