Fixed rezzing coalesced objects from a prim's inventory

Previously only the first object in the Coalesced Object was rezzed. Now all the objects are rezzed.
This commit is contained in:
Oren Hurvitz
2013-09-25 10:56:05 +03:00
committed by Justin Clark-Casey (justincc)
parent acfe603a5f
commit d0c1780839
5 changed files with 198 additions and 144 deletions

View File

@@ -2970,37 +2970,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// need the magnitude later
// float velmag = (float)Util.GetMagnitude(llvel);
SceneObjectGroup new_group = World.RezObject(m_host, item, pos, rot, vel, param);
List<SceneObjectGroup> new_groups = World.RezObject(m_host, item, pos, rot, vel, param);
// If either of these are null, then there was an unknown error.
if (new_group == null)
if (new_groups == null)
return;
// objects rezzed with this method are die_at_edge by default.
new_group.RootPart.SetDieAtEdge(true);
new_group.ResumeScripts();
m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams(
"object_rez", new Object[] {
new LSL_String(
new_group.RootPart.UUID.ToString()) },
new DetectParams[0]));
float groupmass = new_group.GetMass();
PhysicsActor pa = new_group.RootPart.PhysActor;
//Recoil.
if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero)
foreach (SceneObjectGroup group in new_groups)
{
Vector3 recoil = -vel * groupmass * m_recoilScaleFactor;
if (recoil != Vector3.Zero)
// objects rezzed with this method are die_at_edge by default.
group.RootPart.SetDieAtEdge(true);
group.ResumeScripts();
m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams(
"object_rez", new Object[] {
new LSL_String(
group.RootPart.UUID.ToString()) },
new DetectParams[0]));
float groupmass = group.GetMass();
PhysicsActor pa = group.RootPart.PhysActor;
//Recoil.
if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero)
{
llApplyImpulse(recoil, 0);
Vector3 recoil = -vel * groupmass * m_recoilScaleFactor;
if (recoil != Vector3.Zero)
{
llApplyImpulse(recoil, 0);
}
}
// Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
}
// Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
});
//ScriptSleep((int)((groupmass * velmag) / 10));