Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
commit
d38b8caf2b
|
@ -1705,9 +1705,23 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
uint x = 0, y = 0;
|
uint x = 0, y = 0;
|
||||||
Utils.LongToUInts(newRegionHandle, out x, out y);
|
Utils.LongToUInts(newRegionHandle, out x, out y);
|
||||||
GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
|
GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
|
||||||
if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent))
|
|
||||||
|
if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent))
|
||||||
{
|
{
|
||||||
|
m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
|
||||||
|
|
||||||
|
// We are going to move the object back to the old position so long as the old position
|
||||||
|
// is in the region
|
||||||
|
oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1);
|
||||||
|
oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1);
|
||||||
|
oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f);
|
||||||
|
|
||||||
grp.RootPart.GroupPosition = oldGroupPosition;
|
grp.RootPart.GroupPosition = oldGroupPosition;
|
||||||
|
|
||||||
|
// Need to turn off the physics flags, otherwise the object will continue to attempt to
|
||||||
|
// move out of the region creating an infinite loop of failed attempts to cross
|
||||||
|
grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
|
||||||
|
|
||||||
grp.ScheduleGroupForFullUpdate();
|
grp.ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// Controls whether physics can be applied to prims. Even if false, prims still have entries in a
|
/// Controls whether physics can be applied to prims. Even if false, prims still have entries in a
|
||||||
/// PhysicsScene in order to perform collision detection
|
/// PhysicsScene in order to perform collision detection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool m_physicalPrim;
|
public bool PhysicalPrims { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Controls whether prims can be collided with.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// If this is set to false then prims cannot be subject to physics either.
|
||||||
|
/// </summary>
|
||||||
|
public bool CollidablePrims { get; private set; }
|
||||||
|
|
||||||
public float m_maxNonphys = 256;
|
public float m_maxNonphys = 256;
|
||||||
public float m_maxPhys = 10;
|
public float m_maxPhys = 10;
|
||||||
|
@ -650,7 +658,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//Animation states
|
//Animation states
|
||||||
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
|
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
|
||||||
|
|
||||||
m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
|
PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
|
||||||
|
CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
|
||||||
|
|
||||||
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
|
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
|
||||||
if (RegionInfo.NonphysPrimMax > 0)
|
if (RegionInfo.NonphysPrimMax > 0)
|
||||||
|
|
|
@ -333,7 +333,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (rot != null)
|
if (rot != null)
|
||||||
sceneObject.UpdateGroupRotationR((Quaternion)rot);
|
sceneObject.UpdateGroupRotationR((Quaternion)rot);
|
||||||
|
|
||||||
//group.ApplyPhysics(m_physicalPrim);
|
|
||||||
if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
|
if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
|
||||||
{
|
{
|
||||||
sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
|
sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
|
||||||
|
|
|
@ -210,7 +210,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool UsesPhysics
|
public bool UsesPhysics
|
||||||
{
|
{
|
||||||
get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
|
get { return (RootPart.Flags & PrimFlags.Physics) != 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -669,7 +669,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
|
//m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplyPhysics(m_scene.m_physicalPrim);
|
ApplyPhysics();
|
||||||
|
|
||||||
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
|
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
|
||||||
// for the same object with very different properties. The caller must schedule the update.
|
// for the same object with very different properties. The caller must schedule the update.
|
||||||
|
@ -1239,8 +1239,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Apply physics to this group
|
/// Apply physics to this group
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="m_physicalPrim"></param>
|
public void ApplyPhysics()
|
||||||
public void ApplyPhysics(bool m_physicalPrim)
|
|
||||||
{
|
{
|
||||||
// Apply physics to the root prim
|
// Apply physics to the root prim
|
||||||
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
|
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
|
||||||
|
|
|
@ -1473,6 +1473,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="VolumeDetectActive"></param>
|
/// <param name="VolumeDetectActive"></param>
|
||||||
public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive)
|
public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive)
|
||||||
{
|
{
|
||||||
|
if (!ParentGroup.Scene.CollidablePrims)
|
||||||
|
return;
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}",
|
// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}",
|
||||||
// Name, LocalId, UUID, m_physicalPrim);
|
// Name, LocalId, UUID, m_physicalPrim);
|
||||||
|
@ -1739,7 +1742,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="isNew"></param>
|
/// <param name="isNew"></param>
|
||||||
public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
|
public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
|
||||||
{
|
{
|
||||||
if (!ParentGroup.Scene.m_physicalPrim && UsePhysics)
|
if (!ParentGroup.Scene.PhysicalPrims && UsePhysics)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IsJoint())
|
if (IsJoint())
|
||||||
|
@ -4318,7 +4321,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (ParentGroup.Scene == null)
|
if (ParentGroup.Scene == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PhysActor == null)
|
if (ParentGroup.Scene.CollidablePrims && PhysActor == null)
|
||||||
{
|
{
|
||||||
// It's not phantom anymore. So make sure the physics engine get's knowledge of it
|
// It's not phantom anymore. So make sure the physics engine get's knowledge of it
|
||||||
PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape(
|
PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape(
|
||||||
|
|
|
@ -110,7 +110,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
private const uint m_regionWidth = Constants.RegionSize;
|
private const uint m_regionWidth = Constants.RegionSize;
|
||||||
private const uint m_regionHeight = Constants.RegionSize;
|
private const uint m_regionHeight = Constants.RegionSize;
|
||||||
|
|
||||||
private float ODE_STEPSIZE = 0.020f;
|
private float ODE_STEPSIZE = 0.0178f;
|
||||||
private float metersInSpace = 29.9f;
|
private float metersInSpace = 29.9f;
|
||||||
private float m_timeDilation = 1.0f;
|
private float m_timeDilation = 1.0f;
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f);
|
mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f);
|
||||||
mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f);
|
mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f);
|
||||||
|
|
||||||
ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", 0.020f);
|
ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE);
|
||||||
m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10);
|
m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10);
|
||||||
|
|
||||||
avDensity = physicsconfig.GetFloat("av_density", 80f);
|
avDensity = physicsconfig.GetFloat("av_density", 80f);
|
||||||
|
|
|
@ -341,26 +341,54 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
|
|
||||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||||
{
|
{
|
||||||
// Hypergrid/linked regions are not supported
|
List<GridRegion> foundRegions = new List<GridRegion>();
|
||||||
return new List<GridRegion>();
|
|
||||||
|
NameValueCollection requestArgs = new NameValueCollection
|
||||||
|
{
|
||||||
|
{ "RequestMethod", "GetScenes" },
|
||||||
|
{ "HyperGrid", "true" },
|
||||||
|
{ "Enabled", "1" }
|
||||||
|
};
|
||||||
|
|
||||||
|
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
|
||||||
|
if (response["Success"].AsBoolean())
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name);
|
||||||
|
|
||||||
|
OSDArray array = response["Scenes"] as OSDArray;
|
||||||
|
if (array != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < array.Count; i++)
|
||||||
|
{
|
||||||
|
GridRegion region = ResponseToGridRegion(array[i] as OSDMap);
|
||||||
|
if (region != null)
|
||||||
|
foundRegions.Add(region);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return foundRegions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||||
{
|
{
|
||||||
const int REGION_ONLINE = 4;
|
|
||||||
|
|
||||||
NameValueCollection requestArgs = new NameValueCollection
|
NameValueCollection requestArgs = new NameValueCollection
|
||||||
{
|
{
|
||||||
{ "RequestMethod", "GetScene" },
|
{ "RequestMethod", "GetScene" },
|
||||||
{ "SceneID", regionID.ToString() }
|
{ "SceneID", regionID.ToString() }
|
||||||
};
|
};
|
||||||
|
|
||||||
// m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString());
|
m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString());
|
||||||
|
|
||||||
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
|
OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs);
|
||||||
if (response["Success"].AsBoolean())
|
if (response["Success"].AsBoolean())
|
||||||
{
|
{
|
||||||
return response["Enabled"].AsBoolean() ? REGION_ONLINE : 0;
|
OSDMap extraData = response["ExtraData"] as OSDMap;
|
||||||
|
int enabled = response["Enabled"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.RegionOnline : 0;
|
||||||
|
int hypergrid = extraData["HyperGrid"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.Hyperlink : 0;
|
||||||
|
int flags = enabled | hypergrid;
|
||||||
|
m_log.DebugFormat("[SGGC] enabled - {0} hg - {1} flags - {2}", enabled, hypergrid, flags);
|
||||||
|
return flags;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -411,24 +439,27 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
Vector3d minPosition = response["MinPosition"].AsVector3d();
|
Vector3d minPosition = response["MinPosition"].AsVector3d();
|
||||||
region.RegionLocX = (int)minPosition.X;
|
region.RegionLocX = (int)minPosition.X;
|
||||||
region.RegionLocY = (int)minPosition.Y;
|
region.RegionLocY = (int)minPosition.Y;
|
||||||
|
|
||||||
|
if ( ! extraData["HyperGrid"] ) {
|
||||||
|
Uri httpAddress = response["Address"].AsUri();
|
||||||
|
region.ExternalHostName = httpAddress.Host;
|
||||||
|
region.HttpPort = (uint)httpAddress.Port;
|
||||||
|
|
||||||
Uri httpAddress = response["Address"].AsUri();
|
IPAddress internalAddress;
|
||||||
region.ExternalHostName = httpAddress.Host;
|
IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress);
|
||||||
region.HttpPort = (uint)httpAddress.Port;
|
if (internalAddress == null)
|
||||||
|
internalAddress = IPAddress.Any;
|
||||||
|
|
||||||
region.ServerURI = extraData["ServerURI"].AsString();
|
region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger());
|
||||||
|
region.TerrainImage = extraData["MapTexture"].AsUUID();
|
||||||
IPAddress internalAddress;
|
region.Access = (byte)extraData["Access"].AsInteger();
|
||||||
IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress);
|
region.RegionSecret = extraData["RegionSecret"].AsString();
|
||||||
if (internalAddress == null)
|
region.EstateOwner = extraData["EstateOwner"].AsUUID();
|
||||||
internalAddress = IPAddress.Any;
|
region.Token = extraData["Token"].AsString();
|
||||||
|
region.ServerURI = extraData["ServerURI"].AsString();
|
||||||
region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger());
|
} else {
|
||||||
region.TerrainImage = extraData["MapTexture"].AsUUID();
|
region.ServerURI = response["Address"];
|
||||||
region.Access = (byte)extraData["Access"].AsInteger();
|
}
|
||||||
region.RegionSecret = extraData["RegionSecret"].AsString();
|
|
||||||
region.EstateOwner = extraData["EstateOwner"].AsUUID();
|
|
||||||
region.Token = extraData["Token"].AsString();
|
|
||||||
|
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,6 +181,11 @@
|
||||||
; ## PHYSICS
|
; ## PHYSICS
|
||||||
; ##
|
; ##
|
||||||
|
|
||||||
|
; If true then prims can be collided with by avatars, other prims, etc.
|
||||||
|
; If false then all prims are phantom, no matter whether their phantom flag is checked or unchecked.
|
||||||
|
; Also, no prims are subject to physics.
|
||||||
|
collidable_prim = true
|
||||||
|
|
||||||
; If true then prims can be made subject to physics (gravity, pushing, etc.).
|
; If true then prims can be made subject to physics (gravity, pushing, etc.).
|
||||||
; If false then physics flag can be set but it is not honoured. However, prims are still solid for the purposes of collision direction
|
; If false then physics flag can be set but it is not honoured. However, prims are still solid for the purposes of collision direction
|
||||||
physical_prim = true
|
physical_prim = true
|
||||||
|
|
Loading…
Reference in New Issue