mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Handle ObjectSpin* packets to spin physical prims on Ctrl+Shift+Drag
Addresses Mantis #3381 The current implementation works as expected if the object has no rotation or only rotation around the Z axis; you can spin the object left or right (around the world Z axis). It works a little unexpectedly if the object has a non-Z-axis rotation; in this case the body is spun about its local Z axis, not the world Z-axis. (But SL also behaves oddly with a spin on an arbitrarily rotated object.)
This commit is contained in:
@@ -1341,6 +1341,47 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start spinning the given object
|
||||
/// </summary>
|
||||
/// <param name="objectID"></param>
|
||||
/// <param name="rotation"></param>
|
||||
/// <param name="remoteClient"></param>
|
||||
protected internal void SpinStart(UUID objectID, IClientAPI remoteClient)
|
||||
{
|
||||
SceneObjectGroup group = GetGroupByPrim(objectID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
|
||||
{
|
||||
group.SpinStart(remoteClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spin the given object
|
||||
/// </summary>
|
||||
/// <param name="objectID"></param>
|
||||
/// <param name="rotation"></param>
|
||||
/// <param name="remoteClient"></param>
|
||||
protected internal void SpinObject(UUID objectID, Quaternion rotation, IClientAPI remoteClient)
|
||||
{
|
||||
SceneObjectGroup group = GetGroupByPrim(objectID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
|
||||
{
|
||||
group.SpinMovement(rotation, remoteClient);
|
||||
}
|
||||
// This is outside the above permissions condition
|
||||
// so that if the object is locked the client moving the object
|
||||
// get's it's position on the simulator even if it was the same as before
|
||||
// This keeps the moving user's client in sync with the rest of the world.
|
||||
group.SendGroupTerseUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user