mirror of
https://github.com/opensim/opensim.git
synced 2026-08-14 09:25:45 +08:00
Thank you kindly krtaylor for a patch to solve:
Linked objects won't scale together properly, only the root object scales. This happens with scaling both up and down or inputting numbers in the edit dialog.
This commit is contained in:
@@ -890,6 +890,17 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
public void UpdatePrimGroupScale(uint localID, LLVector3 scale, IClientAPI remoteClient)
|
||||
{
|
||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||
if (group != null)
|
||||
{
|
||||
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||
{
|
||||
group.GroupResize(scale, localID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This handles the nifty little tool tip that you get when you drag your mouse over an object
|
||||
|
||||
@@ -1513,6 +1513,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
client.OnUpdatePrimGroupMouseRotation += m_innerScene.UpdatePrimRotation;
|
||||
client.OnUpdatePrimSingleRotation += m_innerScene.UpdatePrimSingleRotation;
|
||||
client.OnUpdatePrimScale += m_innerScene.UpdatePrimScale;
|
||||
client.OnUpdatePrimGroupScale += m_innerScene.UpdatePrimGroupScale;
|
||||
client.OnUpdateExtraParams += m_innerScene.UpdateExtraParam;
|
||||
client.OnUpdatePrimShape += m_innerScene.UpdatePrimShape;
|
||||
client.OnRequestMapBlocks += RequestMapBlocks;
|
||||
|
||||
@@ -1520,7 +1520,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
new PhysicsVector(scale.X, scale.Y, scale.Z);
|
||||
m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
|
||||
}
|
||||
if (part.UUID != m_rootPart.UUID)
|
||||
//if (part.UUID != m_rootPart.UUID)
|
||||
ScheduleGroupForFullUpdate();
|
||||
|
||||
//if (part.UUID == m_rootPart.UUID)
|
||||
@@ -1534,6 +1534,48 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
//}
|
||||
}
|
||||
}
|
||||
public void GroupResize(LLVector3 scale, uint localID)
|
||||
{
|
||||
SceneObjectPart part = GetChildPart(localID);
|
||||
if (part != null)
|
||||
{
|
||||
float x = (scale.X / part.Scale.X);
|
||||
float y = (scale.Y / part.Scale.Y);
|
||||
float z = (scale.Z / part.Scale.Z);
|
||||
part.Resize(scale);
|
||||
|
||||
lock (m_parts)
|
||||
{
|
||||
foreach (SceneObjectPart obPart in m_parts.Values)
|
||||
{
|
||||
if (obPart.UUID != m_rootPart.UUID)
|
||||
{
|
||||
|
||||
LLVector3 currentpos = new LLVector3(obPart.OffsetPosition);
|
||||
currentpos.X *= x;
|
||||
currentpos.Y *= y;
|
||||
currentpos.Z *= z;
|
||||
LLVector3 newSize = new LLVector3(obPart.Scale);
|
||||
newSize.X *= x;
|
||||
newSize.Y *= y;
|
||||
newSize.Z *= z;
|
||||
obPart.Resize(newSize);
|
||||
obPart.UpdateOffSet(currentpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (part.PhysActor != null)
|
||||
{
|
||||
part.PhysActor.Size =
|
||||
new PhysicsVector(scale.X, scale.Y, scale.Z);
|
||||
m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
|
||||
}
|
||||
|
||||
|
||||
ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user