Merge branch '0.6.9-post-fixes' into careminster

avinationmerge
Melanie 2010-03-06 12:24:09 +00:00
commit 1f7a0cf892
81 changed files with 2899 additions and 6279 deletions

View File

@ -128,6 +128,7 @@ what it is today.
* YZh
* Zackary Geers aka Kunnis Basiat
* Zha Ewry
* ziah
= LSL Devs =

View File

@ -692,6 +692,8 @@ namespace OpenSim.Client.MXP.ClientStack
public event UUIDNameRequest OnTeleportHomeRequest;
public event ScriptAnswer OnScriptAnswer;
public event AgentSit OnUndo;
public event AgentSit OnRedo;
public event LandUndo OnLandUndo;
public event ForceReleaseControls OnForceReleaseControls;
public event GodLandStatRequest OnLandStatRequest;
public event DetailedEstateDataRequest OnDetailedEstateDataRequest;

View File

@ -338,6 +338,8 @@ namespace OpenSim.Client.Sirikata.ClientStack
public event UUIDNameRequest OnTeleportHomeRequest;
public event ScriptAnswer OnScriptAnswer;
public event AgentSit OnUndo;
public event AgentSit OnRedo;
public event LandUndo OnLandUndo;
public event ForceReleaseControls OnForceReleaseControls;
public event GodLandStatRequest OnLandStatRequest;
public event DetailedEstateDataRequest OnDetailedEstateDataRequest;

View File

@ -343,6 +343,8 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public event UUIDNameRequest OnTeleportHomeRequest = delegate { };
public event ScriptAnswer OnScriptAnswer = delegate { };
public event AgentSit OnUndo = delegate { };
public event AgentSit OnRedo = delegate { };
public event LandUndo OnLandUndo = delegate { };
public event ForceReleaseControls OnForceReleaseControls = delegate { };
public event GodLandStatRequest OnLandStatRequest = delegate { };
public event DetailedEstateDataRequest OnDetailedEstateDataRequest = delegate { };

View File

@ -39,10 +39,6 @@ namespace OpenSim.Data.MySQL
{
public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new()
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<string, FieldInfo> m_Fields =
new Dictionary<string, FieldInfo>();

View File

@ -41,9 +41,6 @@ namespace OpenSim.Data.MySQL
/// </summary>
public class MySQLXInventoryData : IXInventoryData
{
private static readonly ILog m_log = LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
private MySQLGenericTableHandler<XInventoryFolder> m_Folders;
private MySqlItemHandler m_Items;

View File

@ -524,7 +524,7 @@ namespace OpenSim.Data.Tests
}
}
[Test]
//[Test]
public void T016_RandomSogWithSceneParts()
{
PropertyScrambler<SceneObjectPart> scrambler =

View File

@ -69,7 +69,7 @@ namespace OpenSim.Framework
private static UUID HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66");
private static UUID HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66");
public readonly static int VISUALPARAM_COUNT = 218;
public readonly static int VISUALPARAM_COUNT = 218;
protected UUID m_owner;
@ -361,7 +361,7 @@ namespace OpenSim.Framework
// This sets Visual Params with *less* weirder values then default. Instead of a ugly alien, it looks like a fat scientist
SetDefaultParams(m_visualparams);
SetDefaultWearables();
m_texture = GetDefaultTexture();
m_texture = GetDefaultTexture();
}
public AvatarAppearance(UUID avatarID, AvatarWearable[] wearables, byte[] visualParams)
@ -390,11 +390,12 @@ namespace OpenSim.Framework
+ 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height
+ 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height
+ 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f; // Neck length
m_hipOffset = (0.615385f // Half of avatar
m_hipOffset = (((1.23077f // Half of avatar
+ 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f // Body height
+ 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f // Leg length
+ 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height
+ 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height
+ 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f // Leg length
- m_avatarHeight / 2) * 0.3f - 0.04f;
) / 2) - m_avatarHeight / 2) * 0.31f - 0.0425f;

View File

@ -38,7 +38,7 @@ namespace OpenSim.Framework.Console
{
/// <summary>
/// A console that uses cursor control and color
/// </summary>
/// </summary>
public class LocalConsole : CommandConsole
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -100,8 +100,8 @@ namespace OpenSim.Framework.Console
private int SetCursorTop(int top)
{
// From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
// to set a cursor row position with a currently invalid column, mono will throw an exception.
// Therefore, we need to make sure that the column position is valid first.
// to set a cursor row position with a currently invalid column, mono will throw an exception.
// Therefore, we need to make sure that the column position is valid first.
int left = System.Console.CursorLeft;
if (left < 0)
@ -129,12 +129,12 @@ namespace OpenSim.Framework.Console
/// </param>
/// <returns>
/// The new cursor column.
/// </returns>
/// </returns>
private int SetCursorLeft(int left)
{
// From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
// to set a cursor column position with a currently invalid row, mono will throw an exception.
// Therefore, we need to make sure that the row position is valid first.
// to set a cursor column position with a currently invalid row, mono will throw an exception.
// Therefore, we need to make sure that the row position is valid first.
int top = System.Console.CursorTop;
if (top < 0)
@ -183,7 +183,7 @@ namespace OpenSim.Framework.Console
System.Console.Write("{0}", prompt);
SetCursorTop(new_y);
SetCursorLeft(new_x);
SetCursorLeft(new_x);
}
}

View File

@ -302,9 +302,9 @@ namespace OpenSim.Framework.Console
if (!UUID.TryParse(post["ID"].ToString(), out id))
return reply;
lock(m_Connections)
lock (m_Connections)
{
if(!m_Connections.ContainsKey(id))
if (!m_Connections.ContainsKey(id))
return reply;
}

View File

@ -152,6 +152,8 @@ namespace OpenSim.Framework
public delegate void AgentSit(IClientAPI remoteClient, UUID agentID);
public delegate void LandUndo(IClientAPI remoteClient);
public delegate void AvatarPickerRequest(IClientAPI remoteClient, UUID agentdata, UUID queryID, string UserQuery);
public delegate void GrabObject(
@ -419,9 +421,9 @@ namespace OpenSim.Framework
public delegate void AcceptCallingCard(IClientAPI remoteClient, UUID transactionID, UUID folderID);
public delegate void DeclineCallingCard(IClientAPI remoteClient, UUID transactionID);
public delegate void SoundTrigger(
UUID soundId, UUID ownerid, UUID objid, UUID parentid, double Gain, Vector3 Position, UInt64 Handle);
UUID soundId, UUID ownerid, UUID objid, UUID parentid, double Gain, Vector3 Position, UInt64 Handle, float radius);
public delegate void StartLure(byte lureType, string message, UUID targetID, IClientAPI client);
public delegate void TeleportLureRequest(UUID lureID, uint teleportFlags, IClientAPI client);
@ -988,6 +990,8 @@ namespace OpenSim.Framework
event ScriptAnswer OnScriptAnswer;
event AgentSit OnUndo;
event AgentSit OnRedo;
event LandUndo OnLandUndo;
event ForceReleaseControls OnForceReleaseControls;
event GodLandStatRequest OnLandStatRequest;

View File

@ -358,6 +358,32 @@ namespace OpenSim.Framework
}
}
private int[] _mediaSize = new int[2];
public int[] MediaSize
{
get
{
return _mediaSize;
}
set
{
_mediaSize = value;
}
}
private string _mediaType = "";
public string MediaType
{
get
{
return _mediaType;
}
set
{
_mediaType = value;
}
}
/// <summary>
/// URL to the shoutcast music stream to play on the parcel
/// </summary>

View File

@ -186,6 +186,40 @@ namespace OpenSim.Framework
PCode = (byte)PCodeEnum.Primitive;
ExtraParams = new byte[1];
m_textureEntry = DEFAULT_TEXTURE;
}
public PrimitiveBaseShape(Primitive prim)
{
PCode = (byte)prim.PrimData.PCode;
ExtraParams = new byte[1];
State = prim.PrimData.State;
PathBegin = Primitive.PackBeginCut(prim.PrimData.PathBegin);
PathEnd = Primitive.PackEndCut(prim.PrimData.PathEnd);
PathScaleX = Primitive.PackPathScale(prim.PrimData.PathScaleX);
PathScaleY = Primitive.PackPathScale(prim.PrimData.PathScaleY);
PathShearX = (byte)Primitive.PackPathShear(prim.PrimData.PathShearX);
PathShearY = (byte)Primitive.PackPathShear(prim.PrimData.PathShearY);
PathSkew = Primitive.PackPathTwist(prim.PrimData.PathSkew);
ProfileBegin = Primitive.PackBeginCut(prim.PrimData.ProfileBegin);
ProfileEnd = Primitive.PackEndCut(prim.PrimData.ProfileEnd);
Scale = prim.Scale;
PathCurve = (byte)prim.PrimData.PathCurve;
ProfileCurve = (byte)prim.PrimData.ProfileCurve;
ProfileHollow = Primitive.PackProfileHollow(prim.PrimData.ProfileHollow);
PathRadiusOffset = Primitive.PackPathTwist(prim.PrimData.PathRadiusOffset);
PathRevolutions = Primitive.PackPathRevolutions(prim.PrimData.PathRevolutions);
PathTaperX = Primitive.PackPathTaper(prim.PrimData.PathTaperX);
PathTaperY = Primitive.PackPathTaper(prim.PrimData.PathTaperY);
PathTwist = Primitive.PackPathTwist(prim.PrimData.PathTwist);
PathTwistBegin = Primitive.PackPathTwist(prim.PrimData.PathTwistBegin);
m_textureEntry = prim.Textures.GetBytes();
SculptEntry = (prim.Sculpt.Type != OpenMetaverse.SculptType.None);
SculptData = prim.Sculpt.GetBytes();
SculptTexture = prim.Sculpt.SculptTexture;
SculptType = (byte)prim.Sculpt.Type;
}
[XmlIgnore]

View File

@ -790,7 +790,6 @@ namespace OpenSim.Framework
else
m_externalHostName = externalName;
// Master avatar cruft
//
string masterAvatarUUID;

View File

@ -589,11 +589,17 @@ namespace OpenSim.Framework
public static IPAddress GetLocalHost()
{
string dnsAddress = "localhost";
IPAddress[] iplist = GetLocalHosts();
IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList;
if (iplist.Length == 0) // No accessible external interfaces
{
IPAddress[] loopback = Dns.GetHostAddresses("localhost");
IPAddress localhost = loopback[0];
foreach (IPAddress host in hosts)
return localhost;
}
foreach (IPAddress host in iplist)
{
if (!IPAddress.IsLoopback(host) && host.AddressFamily == AddressFamily.InterNetwork)
{
@ -601,15 +607,15 @@ namespace OpenSim.Framework
}
}
if (hosts.Length > 0)
if (iplist.Length > 0)
{
foreach (IPAddress host in hosts)
foreach (IPAddress host in iplist)
{
if (host.AddressFamily == AddressFamily.InterNetwork)
return host;
}
// Well all else failed...
return hosts[0];
return iplist[0];
}
return null;

View File

@ -190,6 +190,8 @@ namespace OpenSim
PrintFileToConsole("startuplogo.txt");
m_log.InfoFormat("[NETWORK]: Using {0} as SYSTEMIP", Util.GetLocalHost().ToString());
// For now, start at the 'root' level by default
if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
ChangeSelectedRegion("region",
@ -367,7 +369,6 @@ namespace OpenSim
m_console.Commands.AddCommand("hypergrid", false, "unlink-region",
"unlink-region <local name> or <HostName>:<HttpPort> <cr>",
"Unlink a hypergrid region", RunCommand);
}
public override void ShutdownSpecific()
@ -433,7 +434,7 @@ namespace OpenSim
// kick client...
if (alert != null)
presence.ControllingClient.Kick(alert);
else
else
presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n");
// ...and close on our side
@ -640,7 +641,6 @@ namespace OpenSim
}
}
/// <summary>
/// Load, Unload, and list Region modules in use
/// </summary>
@ -972,7 +972,6 @@ namespace OpenSim
scene.RegionInfo.RegionLocX,
scene.RegionInfo.RegionLocY,
scene.RegionInfo.InternalEndPoint.Port));
});
break;
@ -1097,7 +1096,7 @@ namespace OpenSim
}
else
{
MainConsole.Instance.Output(string.Format("A user with the name {0} {1} already exists!", firstName, lastName));
MainConsole.Instance.Output(string.Format("A user with the name {0} {1} already exists!", firstName, lastName));
}
}

File diff suppressed because it is too large Load Diff

View File

@ -330,7 +330,7 @@ namespace OpenSim.Region.CoreModules.Asset
//m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
if (name != Name)
return;
return;
long maxSize = DefaultMaxSize;
int maxCount = DefaultMaxCount;

View File

@ -69,7 +69,7 @@ namespace Flotsam.RegionModules.AssetCache
private readonly List<char> m_InvalidChars = new List<char>();
private int m_LogLevel = 1;
private int m_LogLevel = 0;
private ulong m_HitRateDisplay = 1; // How often to display hit statistics, given in requests
private static ulong m_Requests;
@ -156,7 +156,7 @@ namespace Flotsam.RegionModules.AssetCache
m_WaitOnInprogressTimeout = assetConfig.GetInt("WaitOnInprogressTimeout", 3000);
#endif
m_LogLevel = assetConfig.GetInt("LogLevel", 1);
m_LogLevel = assetConfig.GetInt("LogLevel", 0);
m_HitRateDisplay = (ulong)assetConfig.GetInt("HitRateDisplay", 1000);
m_FileExpiration = TimeSpan.FromHours(assetConfig.GetDouble("FileCacheTimeout", m_DefaultFileExpiration));

View File

@ -148,13 +148,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
{
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
try
{
avatar.Invulnerable = false;
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
{
avatar.Invulnerable = false;
}
else
{
avatar.Invulnerable = true;
}
}
else
catch (Exception)
{
avatar.Invulnerable = true;
}
}
}

View File

@ -131,7 +131,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
if (CheckPresence(userInfo.UserProfile.ID))
{
new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute();
try
{
new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute();
}
catch (EntryPointNotFoundException e)
{
m_log.ErrorFormat(
"[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream."
+ "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
m_log.Error(e);
return false;
}
return true;
}
else
@ -156,7 +169,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
if (CheckPresence(userInfo.UserProfile.ID))
{
new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute();
try
{
new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute();
}
catch (EntryPointNotFoundException e)
{
m_log.ErrorFormat(
"[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream."
+ "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
m_log.Error(e);
return false;
}
return true;
}
else
@ -181,8 +207,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
if (CheckPresence(userInfo.UserProfile.ID))
{
InventoryArchiveReadRequest request =
new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream);
InventoryArchiveReadRequest request;
try
{
request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream);
}
catch (EntryPointNotFoundException e)
{
m_log.ErrorFormat(
"[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream."
+ "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
m_log.Error(e);
return false;
}
UpdateClientWithLoadedNodes(userInfo, request.Execute());
return true;
@ -209,8 +249,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
if (CheckPresence(userInfo.UserProfile.ID))
{
InventoryArchiveReadRequest request =
new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath);
InventoryArchiveReadRequest request;
try
{
request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath);
}
catch (EntryPointNotFoundException e)
{
m_log.ErrorFormat(
"[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream."
+ "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
m_log.Error(e);
return false;
}
UpdateClientWithLoadedNodes(userInfo, request.Execute());
return true;

View File

@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
m_Cache.Cache(a);
// if (null == a)
// m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id);
// m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id);
Util.FireAndForget(delegate { handler(assetID, s, a); });
});

View File

@ -317,7 +317,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
item = m_InventoryService.GetItem(item);
if (null == item)
m_log.ErrorFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}");
m_log.ErrorFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}", item.ID);
return item;
}

View File

@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.World
{
foreach (Scene s in m_SceneList)
{
if(!ProcessCommand(s, cmd))
if (!ProcessCommand(s, cmd))
break;
}
}

View File

@ -73,7 +73,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
public ArchiveReadRequest(Scene scene, string loadPath, bool merge, Guid requestId)
{
m_scene = scene;
m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress);
try
{
m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress);
}
catch (EntryPointNotFoundException e)
{
m_log.ErrorFormat(
"[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream."
+ "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
m_log.Error(e);
}
m_errorMessage = String.Empty;
m_merge = merge;
m_requestId = requestId;
@ -422,6 +434,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4;
currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun;
currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight;
currentRegionSettings.Save();
IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();

View File

@ -65,7 +65,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
public ArchiveWriteRequestPreparation(Scene scene, string savePath, Guid requestId)
{
m_scene = scene;
m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress);
try
{
m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress);
}
catch (EntryPointNotFoundException e)
{
m_log.ErrorFormat(
"[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream."
+ "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
m_log.Error(e);
}
m_requestId = requestId;
}

View File

@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
Vector3 offsetPosition = new Vector3(5, 10, 15);
return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
}
protected SceneObjectPart CreateSceneObjectPart2()
@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
Vector3 offsetPosition = new Vector3(20, 25, 30);
return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
}
}
/// <summary>
/// Test saving a V0.2 OpenSim Region Archive.
@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
foreach (string name in names)
{
if (name.EndsWith(".Resources.test-sound.wav"))
soundDataResourceName = name;
soundDataResourceName = name;
}
Assert.That(soundDataResourceName, Is.Not.Null);
@ -259,7 +259,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
= new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName };
part1.Inventory.AddInventoryItem(item1, true);
}
}
}
m_scene.AddNewSceneObject(object1, false);
@ -306,15 +306,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
/// Test loading the region settings of a V0.2 OpenSim Region Archive.
/// </summary>
[Test]
public void TestLoadOarV0_2RegionSettings()
public void TestLoadOarV0_2RegionSettings()
{
TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure();
//log4net.Config.XmlConfigurator.Configure();
MemoryStream archiveWriteStream = new MemoryStream();
TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
tar.WriteDir(ArchiveConstants.TERRAINS_PATH);
tar.WriteDir(ArchiveConstants.TERRAINS_PATH);
tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile());
RegionSettings rs = new RegionSettings();
@ -329,11 +329,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
rs.DisablePhysics = true;
rs.DisableScripts = true;
rs.Elevation1NW = 15.9;
rs.Elevation1NE = 45.3;
rs.Elevation1NE = 45.3;
rs.Elevation1SE = 49;
rs.Elevation1SW = 1.9;
rs.Elevation2NW = 4.5;
rs.Elevation2NE = 19.2;
rs.Elevation2NE = 19.2;
rs.Elevation2SE = 9.2;
rs.Elevation2SW = 2.1;
rs.FixedSun = true;
@ -411,7 +411,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
// Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90);
// Vector3 part2OffsetPosition = new Vector3(20, 25, 30);
SceneObjectPart part2 = CreateSceneObjectPart2();
SceneObjectPart part2 = CreateSceneObjectPart2();
// Create an oar file that we can use for the merge
{
@ -420,9 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
TerrainModule terrainModule = new TerrainModule();
Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
// Write out this scene
scene.EventManager.OnOarFileSaved += SaveCompleted;

View File

@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
}
public virtual void PlayAttachedSound(
UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags)
UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius)
{
foreach (ScenePresence p in m_scene.GetAvatars())
{
@ -69,14 +69,17 @@ namespace OpenSim.Region.CoreModules.World.Sound
continue;
// Scale by distance
gain = (float)((double)gain*((100.0 - dis) / 100.0));
if (radius == 0)
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
else
gain = (float)((double)gain * ((radius - dis) / radius));
p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
}
}
public virtual void TriggerSound(
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle)
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
{
foreach (ScenePresence p in m_scene.GetAvatars())
{
@ -85,7 +88,10 @@ namespace OpenSim.Region.CoreModules.World.Sound
continue;
// Scale by distance
gain = (float)((double)gain*((100.0 - dis) / 100.0));
if (radius == 0)
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
else
gain = (float)((double)gain * ((radius - dis) / radius));
p.ControllingClient.SendTriggeredSound(
soundId, ownerID, objectID, parentID, handle, position, (float)gain);

View File

@ -84,6 +84,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
private ITerrainChannel m_revert;
private Scene m_scene;
private volatile bool m_tainted;
private readonly UndoStack<LandUndoState> m_undo = new UndoStack<LandUndoState>(5);
#region ICommandableModule Members
@ -174,6 +175,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain
#region ITerrainModule Members
public void UndoTerrain(ITerrainChannel channel)
{
m_channel = channel;
}
/// <summary>
/// Loads a terrain file from disk and installs it in the scene.
/// </summary>
@ -574,6 +580,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
{
client.OnModifyTerrain += client_OnModifyTerrain;
client.OnBakeTerrain += client_OnBakeTerrain;
client.OnLandUndo += client_OnLandUndo;
}
/// <summary>
@ -664,6 +671,19 @@ namespace OpenSim.Region.CoreModules.World.Terrain
return changesLimited;
}
private void client_OnLandUndo(IClientAPI client)
{
lock (m_undo)
{
if (m_undo.Count > 0)
{
LandUndoState goback = m_undo.Pop();
if (goback != null)
goback.PlaybackState();
}
}
}
/// <summary>
/// Sends a copy of the current terrain to the scenes clients
/// </summary>
@ -718,6 +738,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
}
if (allowed)
{
StoreUndoState();
m_painteffects[(StandardTerrainEffects) action].PaintEffect(
m_channel, allowMask, west, south, height, size, seconds);
@ -758,6 +779,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
if (allowed)
{
StoreUndoState();
m_floodeffects[(StandardTerrainEffects) action].FloodEffect(
m_channel, fillArea, size);
@ -782,6 +804,25 @@ namespace OpenSim.Region.CoreModules.World.Terrain
}
}
private void StoreUndoState()
{
lock (m_undo)
{
if (m_undo.Count > 0)
{
LandUndoState last = m_undo.Peek();
if (last != null)
{
if (last.Compare(m_channel))
return;
}
}
LandUndoState nUndo = new LandUndoState(this, m_channel);
m_undo.Push(nUndo);
}
}
#region Console Commands
private void InterfaceLoadFile(Object[] args)

View File

@ -194,6 +194,8 @@ namespace OpenSim.Region.Examples.SimpleModule
public event ObjectBuy OnObjectBuy;
public event BuyObjectInventory OnBuyObjectInventory;
public event AgentSit OnUndo;
public event AgentSit OnRedo;
public event LandUndo OnLandUndo;
public event ForceReleaseControls OnForceReleaseControls;

View File

@ -65,7 +65,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need
/// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture
/// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID
/// </returns>
/// </returns>
UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams,
int updateTimer, bool SetBlending, byte AlphaValue);

View File

@ -150,7 +150,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// <returns>
/// A list of inventory items with that name.
/// If no inventory item has that name then an empty list is returned.
/// </returns>
/// </returns>
IList<TaskInventoryItem> GetInventoryItems(string name);
/// <summary>

View File

@ -32,9 +32,9 @@ namespace OpenSim.Region.Framework.Interfaces
{
public interface ISoundModule
{
void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags);
void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius);
void TriggerSound(
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle);
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius);
}
}

View File

@ -62,5 +62,7 @@ namespace OpenSim.Region.Framework.Interfaces
void SaveToStream(string filename, Stream stream);
void InstallPlugin(string name, ITerrainEffect plug);
void UndoTerrain(ITerrainChannel channel);
}
}

View File

@ -62,7 +62,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="name">name to filter on</param>
/// <param name="id">key to filter on (user given, could be totally faked)</param>
/// <param name="msg">msg to filter on</param>
/// <returns>number of the scripts handle</returns>
/// <returns>number of the scripts handle</returns>
int Listen(uint LocalID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg);
/// <summary>
@ -77,19 +77,19 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="channel">channel to sent on</param>
/// <param name="name">name of sender (object or avatar)</param>
/// <param name="id">key of sender (object or avatar)</param>
/// <param name="msg">msg to sent</param>
/// <param name="msg">msg to sent</param>
void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg);
/// <summary>
/// Are there any listen events ready to be dispatched?
/// </summary>
/// <returns>boolean indication</returns>
/// <returns>boolean indication</returns>
bool HasMessages();
/// <summary>
/// Pop the first availlable listen event from the queue
/// </summary>
/// <returns>ListenerInfo with filter filled in</returns>
/// <returns>ListenerInfo with filter filled in</returns>
IWorldCommListenerInfo GetNextMessage();
void ListenControl(UUID itemID, int handle, int active);

View File

@ -419,15 +419,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation
{
if (m_scenePresence.IsChildAgent)
return;
UUID[] animIDs;
int[] sequenceNums;
UUID[] objectIDs;
m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs);
m_scenePresence.ControllingClient.SendAnimations(
animIDs, sequenceNums, m_scenePresence.ControllingClient.AgentId, objectIDs);
m_scenePresence.Scene.ForEachScenePresence(
delegate(ScenePresence SP)
{
SP.Animator.SendAnimPack();
});
}
/// <summary>

View File

@ -213,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Triggered when an object or attachment enters a scene
/// </summary>
public event OnIncomingSceneObjectDelegate OnIncomingSceneObject;
public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so);
public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so);
public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel);
@ -417,7 +417,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
}
}
public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
{
@ -437,7 +437,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnScriptChangedEvent(uint localID, uint change)
@ -458,7 +458,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnClientMovement(ScenePresence avatar)
@ -479,7 +479,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerPermissionError(UUID user, string reason)
@ -500,7 +500,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnPluginConsole(string[] args)
@ -521,7 +521,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnFrame()
@ -542,11 +542,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnNewClient(IClientAPI client)
{
{
OnNewClientDelegate handlerNewClient = OnNewClient;
if (handlerNewClient != null)
{
@ -563,10 +563,10 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
if (client is IClientCore)
{
{
OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect;
if (handlerClientConnect != null)
{
@ -583,7 +583,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
}
@ -605,11 +605,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnRemovePresence(UUID agentId)
{
{
OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence;
if (handlerRemovePresence != null)
{
@ -626,11 +626,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnBackup(IRegionDataStore dstore)
{
{
OnBackupDelegate handlerOnAttach = OnBackup;
if (handlerOnAttach != null)
{
@ -647,7 +647,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerParcelPrimCountUpdate()
@ -668,7 +668,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args)
@ -689,7 +689,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerTerrainTick()
@ -710,7 +710,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
@ -731,7 +731,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
@ -752,11 +752,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerShutdown()
{
{
OnShutdownDelegate handlerShutdown = OnShutdown;
if (handlerShutdown != null)
{
@ -773,11 +773,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
{
ObjectGrabDelegate handlerObjectGrab = OnObjectGrab;
if (handlerObjectGrab != null)
{
@ -794,11 +794,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
{
ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing;
if (handlerObjectGrabbing != null)
{
@ -815,11 +815,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
{
ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab;
if (handlerObjectDeGrab != null)
{
@ -836,11 +836,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerScriptReset(uint localID, UUID itemID)
{
{
ScriptResetDelegate handlerScriptReset = OnScriptReset;
if (handlerScriptReset != null)
{
@ -857,11 +857,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
{
{
NewRezScript handlerRezScript = OnRezScript;
if (handlerRezScript != null)
{
@ -878,7 +878,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerStartScript(uint localID, UUID itemID)
@ -899,7 +899,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerStopScript(uint localID, UUID itemID)
@ -920,11 +920,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerRemoveScript(uint localID, UUID itemID)
{
{
RemoveScript handlerRemoveScript = OnRemoveScript;
if (handlerRemoveScript != null)
{
@ -941,7 +941,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public bool TriggerGroupMove(UUID groupID, Vector3 delta)
@ -1040,7 +1040,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerLandObjectAdded(ILandObject newParcel)
@ -1061,7 +1061,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerLandObjectRemoved(UUID globalID)
@ -1082,7 +1082,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel)
@ -1108,7 +1108,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerIncomingInstantMessage(GridInstantMessage message)
@ -1129,7 +1129,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerUnhandledInstantMessage(GridInstantMessage message)
@ -1150,7 +1150,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerClientClosed(UUID ClientID, Scene scene)
@ -1171,7 +1171,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnMakeChildAgent(ScenePresence presence)
@ -1192,7 +1192,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnSendNewWindlightProfileTargeted(RegionMeta7WindlightData wl, UUID user)
@ -1231,7 +1231,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnIncomingSceneObject(SceneObjectGroup so)
@ -1251,12 +1251,12 @@ namespace OpenSim.Region.Framework.Scenes
"[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnRegisterCaps(UUID agentID, Caps caps)
{
{
RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps;
if (handlerRegisterCaps != null)
{
@ -1273,7 +1273,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnDeregisterCaps(UUID agentID, Caps caps)
@ -1294,7 +1294,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel)
@ -1315,7 +1315,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerLandBuy(Object sender, LandBuyArgs args)
@ -1336,7 +1336,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerValidateLandBuy(Object sender, LandBuyArgs args)
@ -1357,11 +1357,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos)
{
{
ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
if (handlerScriptAtTargetEvent != null)
{
@ -1378,7 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerNotAtTargetEvent(uint localID)
@ -1399,11 +1399,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot)
{
{
ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent;
if (handlerScriptAtRotTargetEvent != null)
{
@ -1420,7 +1420,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerNotAtRotTargetEvent(uint localID)
@ -1441,7 +1441,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerRequestChangeWaterHeight(float height)
@ -1462,7 +1462,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar)
@ -1483,7 +1483,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerSignificantClientMovement(IClientAPI client)
@ -1504,7 +1504,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
@ -1525,7 +1525,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
@ -1546,7 +1546,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
@ -1567,7 +1567,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed)
@ -1588,7 +1588,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerNoticeNoLandDataFromStorage()
@ -1609,7 +1609,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerIncomingLandDataFromStorage(List<LandData> landData)
@ -1630,7 +1630,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerSetAllowForcefulBan(bool allow)
@ -1651,7 +1651,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerRequestParcelPrimCountUpdate()
@ -1672,7 +1672,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerParcelPrimCountTainted()
@ -1693,7 +1693,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
// this lets us keep track of nasty script events like timer, etc.
@ -1732,7 +1732,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public float GetCurrentTimeAsSunLindenHour()
@ -1759,7 +1759,7 @@ namespace OpenSim.Region.Framework.Scenes
}
public void TriggerOarFileLoaded(Guid requestId, string message)
{
{
OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded;
if (handlerOarFileLoaded != null)
{
@ -1776,7 +1776,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOarFileSaved(Guid requestId, string message)
@ -1797,7 +1797,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
@ -1818,7 +1818,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders)
@ -1839,7 +1839,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerScriptColliding(uint localId, ColliderArgs colliders)
@ -1860,7 +1860,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders)
@ -1881,7 +1881,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders)
@ -1902,7 +1902,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders)
@ -1923,7 +1923,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders)
@ -1944,11 +1944,11 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
{
{
OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene;
if (handlerSetRootAgentScene != null)
{
@ -1965,7 +1965,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
public void TriggerOnRegionUp(GridRegion otherRegion)
@ -1986,7 +1986,7 @@ namespace OpenSim.Region.Framework.Scenes
e.Message, e.StackTrace);
}
}
}
}
}
}
}

View File

@ -2003,6 +2003,23 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
if (grp.RootPart.RETURN_AT_EDGE)
{
// We remove the object here
try
{
List<SceneObjectGroup> objects = new List<SceneObjectGroup>();
objects.Add(grp);
SceneObjectGroup[] objectsArray = objects.ToArray();
returnObjects(objectsArray, UUID.Zero);
}
catch (Exception)
{
m_log.Warn("[DATABASE]: exception when trying to return the prim that crossed the border.");
}
return;
}
int thisx = (int)RegionInfo.RegionLocX;
int thisy = (int)RegionInfo.RegionLocY;
Vector3 EastCross = new Vector3(0.1f,0,0);
@ -2071,19 +2088,25 @@ namespace OpenSim.Region.Framework.Scenes
Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
//(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
if (crossedBordery.BorderLine.Z > 0)
try
{
pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
}
else
pos.Y = ((pos.Y + Constants.RegionSize));
if (crossedBordery.BorderLine.Z > 0)
{
pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
}
else
pos.Y = ((pos.Y + Constants.RegionSize));
newRegionHandle
= Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
(uint)((thisy + changeY) * Constants.RegionSize));
// x - 1
// y + 1
newRegionHandle
= Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
(uint)((thisy + changeY) * Constants.RegionSize));
// x - 1
// y + 1
}
catch (Exception ex)
{
}
}
else
{
@ -2545,7 +2568,7 @@ namespace OpenSim.Region.Framework.Scenes
AttachObject(
sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
grp.SendGroupFullUpdate();
grp.SendGroupFullUpdate();
}
else
{
@ -2711,6 +2734,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnGrabUpdate += ProcessObjectGrabUpdate;
client.OnDeGrabObject += ProcessObjectDeGrab;
client.OnUndo += m_sceneGraph.HandleUndo;
client.OnRedo += m_sceneGraph.HandleRedo;
client.OnObjectDescription += m_sceneGraph.PrimDescription;
client.OnObjectDrop += m_sceneGraph.DropObject;
client.OnObjectSaleInfo += ObjectSaleInfo;
@ -2865,6 +2889,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnGrabObject -= ProcessObjectGrab;
client.OnDeGrabObject -= ProcessObjectDeGrab;
client.OnUndo -= m_sceneGraph.HandleUndo;
client.OnRedo -= m_sceneGraph.HandleRedo;
client.OnObjectDescription -= m_sceneGraph.PrimDescription;
client.OnObjectDrop -= m_sceneGraph.DropObject;
client.OnObjectSaleInfo -= ObjectSaleInfo;

View File

@ -262,7 +262,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Returns a new unallocated local ID
/// </summary>
/// <returns>A brand new local ID</returns>
protected internal uint AllocateLocalId()
public uint AllocateLocalId()
{
uint myID;

View File

@ -476,6 +476,15 @@ namespace OpenSim.Region.Framework.Scenes
part.Undo();
}
}
protected internal void HandleRedo(IClientAPI remoteClient, UUID primId)
{
if (primId != UUID.Zero)
{
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId);
if (part != null)
part.Redo();
}
}
protected internal void HandleObjectGroupUpdate(
IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
@ -669,7 +678,7 @@ namespace OpenSim.Region.Framework.Scenes
// it get cleaned up
//
group.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
group.HasGroupChanged = false;
group.HasGroupChanged = false;
}
else
{

View File

@ -369,14 +369,23 @@ namespace OpenSim.Region.Framework.Scenes
}
lockPartsForRead(true);
if (RootPart.GetStatusSandbox())
{
foreach (SceneObjectPart part in m_parts.Values)
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
{
part.GroupPosition = val;
RootPart.ScriptSetPhysicsStatus(false);
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
return;
}
}
foreach (SceneObjectPart part in m_parts.Values)
{
part.GroupPosition = val;
}
lockPartsForRead(false);
//if (m_rootPart.PhysActor != null)
@ -470,6 +479,34 @@ namespace OpenSim.Region.Framework.Scenes
}
}
private SceneObjectPart m_PlaySoundMasterPrim = null;
public SceneObjectPart PlaySoundMasterPrim
{
get { return m_PlaySoundMasterPrim; }
set { m_PlaySoundMasterPrim = value; }
}
private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>();
public List<SceneObjectPart> PlaySoundSlavePrims
{
get { return m_LoopSoundSlavePrims; }
set { m_LoopSoundSlavePrims = value; }
}
private SceneObjectPart m_LoopSoundMasterPrim = null;
public SceneObjectPart LoopSoundMasterPrim
{
get { return m_LoopSoundMasterPrim; }
set { m_LoopSoundMasterPrim = value; }
}
private List<SceneObjectPart> m_LoopSoundSlavePrims = new List<SceneObjectPart>();
public List<SceneObjectPart> LoopSoundSlavePrims
{
get { return m_LoopSoundSlavePrims; }
set { m_LoopSoundSlavePrims = value; }
}
// The UUID for the Region this Object is in.
public UUID RegionUUID
{
@ -584,7 +621,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
m_rootPart.ParentID = 0;
if (m_rootPart.LocalId==0)
if (m_rootPart.LocalId == 0)
m_rootPart.LocalId = m_scene.AllocateLocalId();
// No need to lock here since the object isn't yet in a scene
@ -1586,6 +1623,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="part"></param>
internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags)
{
// m_log.DebugFormat(
// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
if (m_rootPart.UUID == part.UUID)
{
if (IsAttachment)
@ -2084,7 +2124,9 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectPart part in m_parts.Values)
{
if (!IsSelected)
part.UpdateLookAt();
part.SendScheduledUpdates();
}
@ -2434,7 +2476,6 @@ namespace OpenSim.Region.Framework.Scenes
AttachToBackup();
// Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the
// position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and
// unmoved prims!
@ -2449,9 +2490,10 @@ namespace OpenSim.Region.Framework.Scenes
/// an independent SceneObjectGroup.
/// </summary>
/// <param name="partID"></param>
public void DelinkFromGroup(uint partID)
/// <returns>The object group of the newly delinked prim. Null if part could not be found</returns>
public SceneObjectGroup DelinkFromGroup(uint partID)
{
DelinkFromGroup(partID, true);
return DelinkFromGroup(partID, true);
}
/// <summary>
@ -2460,28 +2502,39 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
/// <param name="partID"></param>
/// <param name="sendEvents"></param>
public void DelinkFromGroup(uint partID, bool sendEvents)
/// <returns>The object group of the newly delinked prim. Null if part could not be found</returns>
public SceneObjectGroup DelinkFromGroup(uint partID, bool sendEvents)
{
SceneObjectPart linkPart = GetChildPart(partID);
if (linkPart != null)
{
DelinkFromGroup(linkPart, sendEvents);
return DelinkFromGroup(linkPart, sendEvents);
}
else
{
m_log.InfoFormat("[SCENE OBJECT GROUP]: " +
m_log.WarnFormat("[SCENE OBJECT GROUP]: " +
"DelinkFromGroup(): Child prim {0} not found in object {1}, {2}",
partID, LocalId, UUID);
return null;
}
}
public void DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents)
/// <summary>
/// Delink the given prim from this group. The delinked prim is established as
/// an independent SceneObjectGroup.
/// </summary>
/// <param name="partID"></param>
/// <param name="sendEvents"></param>
/// <returns>The object group of the newly delinked prim.</returns>
public SceneObjectGroup DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents)
{
linkPart.ClearUndoState();
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
linkPart.ClearUndoState();
Quaternion worldRot = linkPart.GetWorldRotation();
@ -2536,6 +2589,8 @@ namespace OpenSim.Region.Framework.Scenes
//HasGroupChanged = true;
//ScheduleGroupForFullUpdate();
return objectGroup;
}
/// <summary>
@ -2574,7 +2629,6 @@ namespace OpenSim.Region.Framework.Scenes
part.LinkNum = linkNum;
part.OffsetPosition = part.GroupPosition - AbsolutePosition;
Quaternion rootRotation = m_rootPart.RotationOffset;
@ -2604,11 +2658,14 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_rootPart.PhysActor.IsPhysical)
{
Vector3 llmoveforce = pos - AbsolutePosition;
Vector3 grabforce = llmoveforce;
grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass;
m_rootPart.PhysActor.AddForce(grabforce,true);
m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
if (!m_rootPart.BlockGrab)
{
Vector3 llmoveforce = pos - AbsolutePosition;
Vector3 grabforce = llmoveforce;
grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass;
m_rootPart.PhysActor.AddForce(grabforce, true);
m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
}
}
else
{
@ -2966,6 +3023,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
part.IgnoreUndoUpdate = true;
if (scale.X > m_scene.m_maxNonphys)
scale.X = m_scene.m_maxNonphys;
if (scale.Y > m_scene.m_maxNonphys)
@ -2992,6 +3050,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (obPart.UUID != m_rootPart.UUID)
{
obPart.IgnoreUndoUpdate = true;
Vector3 oldSize = new Vector3(obPart.Scale);
float f = 1.0f;
@ -3050,6 +3109,8 @@ namespace OpenSim.Region.Framework.Scenes
y *= a;
z *= a;
}
obPart.IgnoreUndoUpdate = false;
obPart.StoreUndoState();
}
}
}
@ -3066,6 +3127,7 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (SceneObjectPart obPart in m_parts.Values)
{
obPart.IgnoreUndoUpdate = true;
if (obPart.UUID != m_rootPart.UUID)
{
Vector3 currentpos = new Vector3(obPart.OffsetPosition);
@ -3079,6 +3141,8 @@ namespace OpenSim.Region.Framework.Scenes
obPart.Resize(newSize);
obPart.UpdateOffSet(currentpos);
}
obPart.IgnoreUndoUpdate = false;
obPart.StoreUndoState();
}
}
lockPartsForRead(false);
@ -3089,6 +3153,8 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
}
part.IgnoreUndoUpdate = false;
part.StoreUndoState();
HasGroupChanged = true;
ScheduleGroupForTerseUpdate();
}
@ -3104,13 +3170,26 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="pos"></param>
public void UpdateGroupPosition(Vector3 pos)
{
foreach (SceneObjectPart part in Children.Values)
{
part.StoreUndoState();
}
if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
{
if (IsAttachment)
{
m_rootPart.AttachedPos = pos;
}
if (RootPart.GetStatusSandbox())
{
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, pos) > 10)
{
RootPart.ScriptSetPhysicsStatus(false);
pos = AbsolutePosition;
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
}
}
AbsolutePosition = pos;
HasGroupChanged = true;
@ -3129,7 +3208,10 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdateSinglePosition(Vector3 pos, uint localID)
{
SceneObjectPart part = GetChildPart(localID);
foreach (SceneObjectPart parts in Children.Values)
{
parts.StoreUndoState();
}
if (part != null)
{
if (part.UUID == m_rootPart.UUID)
@ -3151,6 +3233,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="pos"></param>
private void UpdateRootPosition(Vector3 pos)
{
foreach (SceneObjectPart part in Children.Values)
{
part.StoreUndoState();
}
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
Vector3 oldPos =
new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X,
@ -3195,6 +3281,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="rot"></param>
public void UpdateGroupRotationR(Quaternion rot)
{
foreach (SceneObjectPart parts in Children.Values)
{
parts.StoreUndoState();
}
m_rootPart.UpdateRotation(rot);
PhysicsActor actor = m_rootPart.PhysActor;
@ -3215,6 +3305,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="rot"></param>
public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot)
{
foreach (SceneObjectPart parts in Children.Values)
{
parts.StoreUndoState();
}
m_rootPart.UpdateRotation(rot);
PhysicsActor actor = m_rootPart.PhysActor;
@ -3238,6 +3332,10 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdateSingleRotation(Quaternion rot, uint localID)
{
SceneObjectPart part = GetChildPart(localID);
foreach (SceneObjectPart parts in Children.Values)
{
parts.StoreUndoState();
}
if (part != null)
{
if (part.UUID == m_rootPart.UUID)
@ -3268,8 +3366,11 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
part.IgnoreUndoUpdate = true;
part.UpdateRotation(rot);
part.OffsetPosition = pos;
part.IgnoreUndoUpdate = false;
part.StoreUndoState();
}
}
}
@ -3283,6 +3384,7 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion axRot = rot;
Quaternion oldParentRot = m_rootPart.RotationOffset;
m_rootPart.StoreUndoState();
m_rootPart.UpdateRotation(rot);
if (m_rootPart.PhysActor != null)
{
@ -3291,23 +3393,33 @@ namespace OpenSim.Region.Framework.Scenes
}
lockPartsForRead(true);
foreach (SceneObjectPart prim in m_parts.Values)
{
foreach (SceneObjectPart prim in m_parts.Values)
if (prim.UUID != m_rootPart.UUID)
{
if (prim.UUID != m_rootPart.UUID)
{
Vector3 axPos = prim.OffsetPosition;
axPos *= oldParentRot;
axPos *= Quaternion.Inverse(axRot);
prim.OffsetPosition = axPos;
Quaternion primsRot = prim.RotationOffset;
Quaternion newRot = primsRot * oldParentRot;
newRot *= Quaternion.Inverse(axRot);
prim.RotationOffset = newRot;
prim.ScheduleTerseUpdate();
}
prim.IgnoreUndoUpdate = true;
Vector3 axPos = prim.OffsetPosition;
axPos *= oldParentRot;
axPos *= Quaternion.Inverse(axRot);
prim.OffsetPosition = axPos;
Quaternion primsRot = prim.RotationOffset;
Quaternion newRot = primsRot * oldParentRot;
newRot *= Quaternion.Inverse(axRot);
prim.RotationOffset = newRot;
prim.ScheduleTerseUpdate();
}
}
foreach (SceneObjectPart childpart in Children.Values)
{
if (childpart != m_rootPart)
{
childpart.IgnoreUndoUpdate = false;
childpart.StoreUndoState();
}
}
lockPartsForRead(false);
m_rootPart.ScheduleTerseUpdate();

View File

@ -133,6 +133,18 @@ namespace OpenSim.Region.Framework.Scenes
[XmlIgnore]
public bool DIE_AT_EDGE;
[XmlIgnore]
public bool RETURN_AT_EDGE;
[XmlIgnore]
public bool BlockGrab;
[XmlIgnore]
public bool StatusSandbox;
[XmlIgnore]
public Vector3 StatusSandboxPos;
// TODO: This needs to be persisted in next XML version update!
[XmlIgnore]
public int[] PayPrice = {-2,-2,-2,-2,-2};
@ -219,6 +231,15 @@ namespace OpenSim.Region.Framework.Scenes
[XmlIgnore]
public Quaternion SpinOldOrientation = Quaternion.Identity;
[XmlIgnore]
public Quaternion m_APIDTarget = Quaternion.Identity;
[XmlIgnore]
public float m_APIDDamp = 0;
[XmlIgnore]
public float m_APIDStrength = 0;
/// <summary>
/// This part's inventory
/// </summary>
@ -232,6 +253,9 @@ namespace OpenSim.Region.Framework.Scenes
[XmlIgnore]
public bool Undoing;
[XmlIgnore]
public bool IgnoreUndoUpdate = false;
[XmlIgnore]
private PrimFlags LocalFlags;
[XmlIgnore]
@ -254,6 +278,7 @@ namespace OpenSim.Region.Framework.Scenes
private string m_text = String.Empty;
private string m_touchName = String.Empty;
private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5);
private readonly UndoStack<UndoState> m_redo = new UndoStack<UndoState>(5);
private UUID _creatorID;
private bool m_passTouches;
@ -506,6 +531,27 @@ namespace OpenSim.Region.Framework.Scenes
}
}
[XmlIgnore]
public Quaternion APIDTarget
{
get { return m_APIDTarget; }
set { m_APIDTarget = value; }
}
[XmlIgnore]
public float APIDDamp
{
get { return m_APIDDamp; }
set { m_APIDDamp = value; }
}
[XmlIgnore]
public float APIDStrength
{
get { return m_APIDStrength; }
set { m_APIDStrength = value; }
}
public ulong RegionHandle
{
get { return m_regionHandle; }
@ -517,6 +563,33 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_scriptAccessPin; }
set { m_scriptAccessPin = (int)value; }
}
private SceneObjectPart m_PlaySoundMasterPrim = null;
public SceneObjectPart PlaySoundMasterPrim
{
get { return m_PlaySoundMasterPrim; }
set { m_PlaySoundMasterPrim = value; }
}
private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>();
public List<SceneObjectPart> PlaySoundSlavePrims
{
get { return m_LoopSoundSlavePrims; }
set { m_LoopSoundSlavePrims = value; }
}
private SceneObjectPart m_LoopSoundMasterPrim = null;
public SceneObjectPart LoopSoundMasterPrim
{
get { return m_LoopSoundMasterPrim; }
set { m_LoopSoundMasterPrim = value; }
}
private List<SceneObjectPart> m_LoopSoundSlavePrims = new List<SceneObjectPart>();
public List<SceneObjectPart> LoopSoundSlavePrims
{
get { return m_LoopSoundSlavePrims; }
set { m_LoopSoundSlavePrims = value; }
}
public Byte[] TextureAnimation
{
@ -576,8 +649,6 @@ namespace OpenSim.Region.Framework.Scenes
}
set
{
StoreUndoState();
m_groupPosition = value;
PhysicsActor actor = PhysActor;
if (actor != null)
@ -1403,6 +1474,10 @@ namespace OpenSim.Region.Framework.Scenes
{
m_undo.Clear();
}
lock (m_redo)
{
m_redo.Clear();
}
StoreUndoState();
}
@ -1713,6 +1788,66 @@ namespace OpenSim.Region.Framework.Scenes
return m_parentGroup.RootPart.DIE_AT_EDGE;
}
public bool GetReturnAtEdge()
{
if (m_parentGroup == null)
return false;
if (m_parentGroup.IsDeleted)
return false;
return m_parentGroup.RootPart.RETURN_AT_EDGE;
}
public void SetReturnAtEdge(bool p)
{
if (m_parentGroup == null)
return;
if (m_parentGroup.IsDeleted)
return;
m_parentGroup.RootPart.RETURN_AT_EDGE = p;
}
public bool GetBlockGrab()
{
if (m_parentGroup == null)
return false;
if (m_parentGroup.IsDeleted)
return false;
return m_parentGroup.RootPart.BlockGrab;
}
public void SetBlockGrab(bool p)
{
if (m_parentGroup == null)
return;
if (m_parentGroup.IsDeleted)
return;
m_parentGroup.RootPart.BlockGrab = p;
}
public void SetStatusSandbox(bool p)
{
if (m_parentGroup == null)
return;
if (m_parentGroup.IsDeleted)
return;
StatusSandboxPos = m_parentGroup.RootPart.AbsolutePosition;
m_parentGroup.RootPart.StatusSandbox = p;
}
public bool GetStatusSandbox()
{
if (m_parentGroup == null)
return false;
if (m_parentGroup.IsDeleted)
return false;
return m_parentGroup.RootPart.StatusSandbox;
}
public int GetAxisRotation(int axis)
{
//Cannot use ScriptBaseClass constants as no referance to it currently.
@ -1924,7 +2059,7 @@ namespace OpenSim.Region.Framework.Scenes
// play the sound.
if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f)
{
SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0);
SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0, 0, false, false);
}
if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0)
@ -2499,9 +2634,8 @@ namespace OpenSim.Region.Framework.Scenes
List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
foreach (ScenePresence p in avatarts)
{
// TODO: some filtering by distance of avatar
p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
if (!(Util.GetDistanceTo(p.AbsolutePosition, AbsolutePosition) >= 100))
p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
}
}
@ -2562,7 +2696,38 @@ namespace OpenSim.Region.Framework.Scenes
public void RotLookAt(Quaternion target, float strength, float damping)
{
m_parentGroup.rotLookAt(target, strength, damping);
rotLookAt(target, strength, damping);
}
public void rotLookAt(Quaternion target, float strength, float damping)
{
if (IsAttachment)
{
/*
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
if (avatar != null)
{
Rotate the Av?
} */
}
else
{
APIDDamp = damping;
APIDStrength = strength;
APIDTarget = target;
}
}
public void startLookAt(Quaternion rot, float damp, float strength)
{
APIDDamp = damp;
APIDStrength = strength;
APIDTarget = rot;
}
public void stopLookAt()
{
APIDTarget = Quaternion.Identity;
}
/// <summary>
@ -2824,7 +2989,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="volume"></param>
/// <param name="triggered"></param>
/// <param name="flags"></param>
public void SendSound(string sound, double volume, bool triggered, byte flags)
public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster)
{
if (volume > 1)
volume = 1;
@ -2859,10 +3024,51 @@ namespace OpenSim.Region.Framework.Scenes
ISoundModule soundModule = m_parentGroup.Scene.RequestModuleInterface<ISoundModule>();
if (soundModule != null)
{
if (triggered)
soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle);
if (useMaster)
{
if (isMaster)
{
if (triggered)
soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
else
soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
ParentGroup.PlaySoundMasterPrim = this;
ownerID = this._ownerID;
objectID = this.UUID;
parentID = this.GetRootPartUUID();
position = this.AbsolutePosition; // region local
regionHandle = this.ParentGroup.Scene.RegionInfo.RegionHandle;
if (triggered)
soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
else
soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims)
{
ownerID = prim._ownerID;
objectID = prim.UUID;
parentID = prim.GetRootPartUUID();
position = prim.AbsolutePosition; // region local
regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle;
if (triggered)
soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
else
soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
}
ParentGroup.PlaySoundSlavePrims.Clear();
ParentGroup.PlaySoundMasterPrim = null;
}
else
{
ParentGroup.PlaySoundSlavePrims.Add(this);
}
}
else
soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags);
{
if (triggered)
soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
else
soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
}
}
}
@ -3181,6 +3387,14 @@ namespace OpenSim.Region.Framework.Scenes
hasProfileCut = hasDimple; // is it the same thing?
}
public void SetVehicleFlags(int param, bool remove)
{
if (PhysActor != null)
{
PhysActor.VehicleFlags(param, remove);
}
}
public void SetGroup(UUID groupID, IClientAPI client)
{
_groupID = groupID;
@ -3285,27 +3499,30 @@ namespace OpenSim.Region.Framework.Scenes
{
if (!Undoing)
{
if (m_parentGroup != null)
if (!IgnoreUndoUpdate)
{
lock (m_undo)
if (m_parentGroup != null)
{
if (m_undo.Count > 0)
lock (m_undo)
{
UndoState last = m_undo.Peek();
if (last != null)
if (m_undo.Count > 0)
{
if (last.Compare(this))
return;
UndoState last = m_undo.Peek();
if (last != null)
{
if (last.Compare(this))
return;
}
}
if (m_parentGroup.GetSceneMaxUndo() > 0)
{
UndoState nUndo = new UndoState(this);
m_undo.Push(nUndo);
}
}
if (m_parentGroup.GetSceneMaxUndo() > 0)
{
UndoState nUndo = new UndoState(this);
m_undo.Push(nUndo);
}
}
}
}
@ -3776,14 +3993,39 @@ namespace OpenSim.Region.Framework.Scenes
lock (m_undo)
{
if (m_undo.Count > 0)
{
UndoState nUndo = null;
if (m_parentGroup.GetSceneMaxUndo() > 0)
{
UndoState goback = m_undo.Pop();
if (goback != null)
goback.PlaybackState(this);
nUndo = new UndoState(this);
}
UndoState goback = m_undo.Pop();
if (goback != null)
{
goback.PlaybackState(this);
if (nUndo != null)
m_redo.Push(nUndo);
}
}
}
}
public void Redo()
{
lock (m_redo)
{
if (m_parentGroup.GetSceneMaxUndo() > 0)
{
UndoState nUndo = new UndoState(this);
m_undo.Push(nUndo);
}
UndoState gofwd = m_redo.Pop();
if (gofwd != null)
gofwd.PlayfwdState(this);
}
}
public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
{
m_shape.ReadInUpdateExtraParam(type, inUse, data);
@ -3827,6 +4069,18 @@ namespace OpenSim.Region.Framework.Scenes
(pos.Z != OffsetPosition.Z))
{
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
if (ParentGroup.RootPart.GetStatusSandbox())
{
if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, newPos) > 10)
{
ParentGroup.RootPart.ScriptSetPhysicsStatus(false);
newPos = OffsetPosition;
ParentGroup.Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, ParentGroup.RootPart.AbsolutePosition, Name, UUID, false);
}
}
OffsetPosition = newPos;
ScheduleTerseUpdate();
}
@ -4119,7 +4373,6 @@ namespace OpenSim.Region.Framework.Scenes
(rot.Z != RotationOffset.Z) ||
(rot.W != RotationOffset.W))
{
//StoreUndoState();
RotationOffset = rot;
ParentGroup.HasGroupChanged = true;
ScheduleTerseUpdate();
@ -4303,7 +4556,7 @@ namespace OpenSim.Region.Framework.Scenes
else
{
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId);
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId);
ScheduleFullUpdate();
}
}
@ -4421,5 +4674,41 @@ namespace OpenSim.Region.Framework.Scenes
Inventory.ApplyNextOwnerPermissions();
}
public void UpdateLookAt()
{
try
{
if (APIDTarget != Quaternion.Identity)
{
if (Single.IsNaN(APIDTarget.W) == true)
{
APIDTarget = Quaternion.Identity;
return;
}
Quaternion rot = RotationOffset;
Quaternion dir = (rot - APIDTarget);
float speed = ((APIDStrength / APIDDamp) * (float)(Math.PI / 180.0f));
if (dir.Z > speed)
{
rot.Z -= speed;
}
if (dir.Z < -speed)
{
rot.Z += speed;
}
rot.Normalize();
UpdateRotation(rot);
}
}
catch (Exception ex)
{
m_log.Error("[Physics] " + ex);
}
}
public Color4 GetTextColor()
{
return new Color4((byte)Color.R, (byte)Color.G, (byte)Color.B, (byte)(0xFF - Color.A));
}
}
}

View File

@ -318,8 +318,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
static System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
private void RestoreSavedScriptState(UUID oldID, UUID newID)
{
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
@ -585,7 +583,7 @@ namespace OpenSim.Region.Framework.Scenes
m_items.TryGetValue(itemId, out item);
m_items.LockItemsForRead(false);
return item;
}
}
/// <summary>
/// Get inventory items by name.
@ -594,7 +592,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>
/// A list of inventory items with that name.
/// If no inventory item has that name then an empty list is returned.
/// </returns>
/// </returns>
public IList<TaskInventoryItem> GetInventoryItems(string name)
{
IList<TaskInventoryItem> items = new List<TaskInventoryItem>();

View File

@ -167,6 +167,8 @@ namespace OpenSim.Region.Framework.Scenes
private Quaternion m_bodyRot= Quaternion.Identity;
private Quaternion m_bodyRotPrevious = Quaternion.Identity;
private const int LAND_VELOCITYMAG_MAX = 12;
public bool IsRestrictedToRegion;
@ -233,7 +235,7 @@ namespace OpenSim.Region.Framework.Scenes
// Agent's Draw distance.
protected float m_DrawDistance;
protected AvatarAppearance m_appearance;
protected AvatarAppearance m_appearance;
// neighbouring regions we have enabled a child agent in
// holds the seed cap for the child agent in that region
@ -518,6 +520,12 @@ namespace OpenSim.Region.Framework.Scenes
set { m_bodyRot = value; }
}
public Quaternion PreviousRotation
{
get { return m_bodyRotPrevious; }
set { m_bodyRotPrevious = value; }
}
/// <summary>
/// If this is true, agent doesn't have a representation in this scene.
/// this is an agent 'looking into' this scene from a nearby scene(region)
@ -650,7 +658,7 @@ namespace OpenSim.Region.Framework.Scenes
#region Constructor(s)
public ScenePresence()
{
{
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
CreateSceneViewer();
m_animator = new ScenePresenceAnimator(this);
@ -868,6 +876,31 @@ namespace OpenSim.Region.Framework.Scenes
if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
{
Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
if (pos.X < 0)
{
emergencyPos.X = (int)Constants.RegionSize + pos.X;
if (!(pos.Y < 0))
emergencyPos.Y = pos.Y;
if (!(pos.Z < 0))
emergencyPos.X = pos.X;
}
if (pos.Y < 0)
{
emergencyPos.Y = (int)Constants.RegionSize + pos.Y;
if (!(pos.X < 0))
emergencyPos.X = pos.X;
if (!(pos.Z < 0))
emergencyPos.Z = pos.Z;
}
if (pos.Z < 0)
{
if (!(pos.X < 0))
emergencyPos.X = pos.X;
if (!(pos.Y < 0))
emergencyPos.Y = pos.Y;
//Leave as 128
}
m_log.WarnFormat(
"[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
@ -2900,36 +2933,75 @@ namespace OpenSim.Region.Framework.Scenes
{
// Checks if where it's headed exists a region
bool needsTransit = false;
if (m_scene.TestBorderCross(pos2, Cardinals.W))
{
if (m_scene.TestBorderCross(pos2, Cardinals.S))
{
needsTransit = true;
neighbor = HaveNeighbor(Cardinals.SW, ref fix);
}
else if (m_scene.TestBorderCross(pos2, Cardinals.N))
{
needsTransit = true;
neighbor = HaveNeighbor(Cardinals.NW, ref fix);
}
else
{
needsTransit = true;
neighbor = HaveNeighbor(Cardinals.W, ref fix);
}
}
else if (m_scene.TestBorderCross(pos2, Cardinals.E))
{
if (m_scene.TestBorderCross(pos2, Cardinals.S))
{
needsTransit = true;
neighbor = HaveNeighbor(Cardinals.SE, ref fix);
}
else if (m_scene.TestBorderCross(pos2, Cardinals.N))
{
needsTransit = true;
neighbor = HaveNeighbor(Cardinals.NE, ref fix);
}
else
{
needsTransit = true;
neighbor = HaveNeighbor(Cardinals.E, ref fix);
}
}
else if (m_scene.TestBorderCross(pos2, Cardinals.S))
{
needsTransit = true;
neighbor = HaveNeighbor(Cardinals.S, ref fix);
}
else if (m_scene.TestBorderCross(pos2, Cardinals.N))
{
needsTransit = true;
neighbor = HaveNeighbor(Cardinals.N, ref fix);
}
// Makes sure avatar does not end up outside region
if (neighbor < 0)
AbsolutePosition = new Vector3(
AbsolutePosition.X + 3*fix[0],
AbsolutePosition.Y + 3*fix[1],
AbsolutePosition.Z);
if (neighbor <= 0)
{
if (!needsTransit)
{
if (m_requestedSitTargetUUID == UUID.Zero)
{
Vector3 pos = AbsolutePosition;
if (AbsolutePosition.X < 0)
pos.X += Velocity.X;
else if (AbsolutePosition.X > Constants.RegionSize)
pos.X -= Velocity.X;
if (AbsolutePosition.Y < 0)
pos.Y += Velocity.Y;
else if (AbsolutePosition.Y > Constants.RegionSize)
pos.Y -= Velocity.Y;
AbsolutePosition = pos;
}
}
}
else if (neighbor > 0)
CrossToNewRegion();
}
@ -3400,7 +3472,7 @@ namespace OpenSim.Region.Framework.Scenes
m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
m_physicsActor.SubscribeEvents(500);
m_physicsActor.LocalID = LocalId;
m_physicsActor.LocalID = LocalId;
}
private void OutOfBoundsCall(Vector3 pos)
@ -3503,7 +3575,7 @@ namespace OpenSim.Region.Framework.Scenes
}
if (m_health <= 0)
m_scene.EventManager.TriggerAvatarKill(killerObj, this);
}
}
}
public void setHealthWithUpdate(float health)

View File

@ -26,6 +26,7 @@
*/
using OpenMetaverse;
using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Region.Framework.Scenes
{
@ -35,29 +36,21 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 Scale = Vector3.Zero;
public Quaternion Rotation = Quaternion.Identity;
public UndoState(Vector3 pos, Quaternion rot, Vector3 scale)
{
Position = pos;
Rotation = rot;
Scale = scale;
}
public UndoState(SceneObjectPart part)
{
if (part != null)
{
if (part.ParentID == 0)
{
Position = part.AbsolutePosition;
Position = part.ParentGroup.AbsolutePosition;
Rotation = part.RotationOffset;
Scale = part.Shape.Scale;
}
else
{
Position = part.OffsetPosition;
Rotation = part.RotationOffset;
Scale = part.Shape.Scale;
}
}
}
@ -68,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (part.ParentID == 0)
{
if (Position == part.AbsolutePosition && Rotation == part.RotationOffset)
if (Position == part.ParentGroup.AbsolutePosition && Rotation == part.ParentGroup.Rotation)
return true;
else
return false;
@ -93,24 +86,78 @@ namespace OpenSim.Region.Framework.Scenes
if (part.ParentID == 0)
{
part.ParentGroup.AbsolutePosition = Position;
part.UpdateRotation(Rotation);
if (Position != Vector3.Zero)
part.ParentGroup.AbsolutePosition = Position;
part.RotationOffset = Rotation;
if (Scale != Vector3.Zero)
part.Resize(Scale);
part.ParentGroup.ScheduleGroupForTerseUpdate();
}
else
{
part.OffsetPosition = Position;
if (Position != Vector3.Zero)
part.OffsetPosition = Position;
part.UpdateRotation(Rotation);
part.Resize(Scale);
if (Scale != Vector3.Zero)
part.Resize(Scale); part.ScheduleTerseUpdate();
}
part.Undoing = false;
}
}
public void PlayfwdState(SceneObjectPart part)
{
if (part != null)
{
part.Undoing = true;
if (part.ParentID == 0)
{
if (Position != Vector3.Zero)
part.ParentGroup.AbsolutePosition = Position;
if (Rotation != Quaternion.Identity)
part.UpdateRotation(Rotation);
if (Scale != Vector3.Zero)
part.Resize(Scale);
part.ParentGroup.ScheduleGroupForTerseUpdate();
}
else
{
if (Position != Vector3.Zero)
part.OffsetPosition = Position;
if (Rotation != Quaternion.Identity)
part.UpdateRotation(Rotation);
if (Scale != Vector3.Zero)
part.Resize(Scale);
part.ScheduleTerseUpdate();
}
part.Undoing = false;
}
}
}
public class LandUndoState
{
public ITerrainModule m_terrainModule;
public ITerrainChannel m_terrainChannel;
public UndoState()
public LandUndoState(ITerrainModule terrainModule, ITerrainChannel terrainChannel)
{
m_terrainModule = terrainModule;
m_terrainChannel = terrainChannel;
}
public bool Compare(ITerrainChannel terrainChannel)
{
if (m_terrainChannel != terrainChannel)
return false;
else
return false;
}
public void PlaybackState()
{
m_terrainModule.UndoTerrain(m_terrainChannel);
}
}
}

View File

@ -774,6 +774,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public event UUIDNameRequest OnTeleportHomeRequest;
public event ScriptAnswer OnScriptAnswer;
public event AgentSit OnUndo;
public event AgentSit OnRedo;
public event LandUndo OnLandUndo;
public event ForceReleaseControls OnForceReleaseControls;
public event GodLandStatRequest OnLandStatRequest;
public event DetailedEstateDataRequest OnDetailedEstateDataRequest;

View File

@ -50,7 +50,6 @@ using OpenSim.Region.Framework.Scenes;
using Caps = OpenSim.Framework.Capabilities.Caps;
using System.Text.RegularExpressions;
namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
{
public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule
@ -76,7 +75,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
// SLVoice client will do a GET on this prefix
private static string m_freeSwitchAPIPrefix;
// We need to return some information to SLVoice
// We need to return some information to SLVoice
// figured those out via curl
// http://vd1.vivox.com/api2/viv_get_prelogin.php
//
@ -102,9 +101,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
private readonly Dictionary<string, string> m_UUIDName = new Dictionary<string, string>();
private Dictionary<string, string> m_ParcelAddress = new Dictionary<string, string>();
private Scene m_scene;
private IConfig m_config;
@ -136,9 +135,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
m_freeSwitchServerUser = m_config.GetString("freeswitch_server_user", String.Empty);
m_freeSwitchServerPass = m_config.GetString("freeswitch_server_pass", String.Empty);
m_freeSwitchAPIPrefix = m_config.GetString("freeswitch_api_prefix", String.Empty);
// XXX: get IP address of HTTP server. (This can be this OpenSim server or another, or could be a dedicated grid service or may live on the freeswitch server)
string serviceIP = m_config.GetString("freeswitch_service_server", String.Empty);
int servicePort = m_config.GetInt("freeswitch_service_port", 80);
IPAddress serviceIPAddress = IPAddress.Parse(serviceIP);
@ -156,7 +155,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
// m_freeSwitchSubscribeRetry = m_config.GetInt("freeswitch_subscribe_retry", 120);
m_freeSwitchUrlResetPassword = m_config.GetString("freeswitch_password_reset_url", String.Empty);
m_freeSwitchContext = m_config.GetString("freeswitch_context", "default");
if (String.IsNullOrEmpty(m_freeSwitchServerUser) ||
String.IsNullOrEmpty(m_freeSwitchServerPass) ||
String.IsNullOrEmpty(m_freeSwitchRealm) ||
@ -182,9 +181,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
{
MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix),
FreeSwitchSLVoiceGetPreloginHTTPHandler);
// RestStreamHandler h = new
// RestStreamHandler("GET",
// RestStreamHandler("GET",
// String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler);
// MainServer.Instance.AddStreamHandler(h);
@ -202,13 +201,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix),
FreeSwitchSLVoiceBuddyHTTPHandler);
}
m_log.InfoFormat("[FreeSwitchVoice] using FreeSwitch server {0}", m_freeSwitchRealm);
m_FreeSwitchDirectory = new FreeSwitchDirectory();
m_FreeSwitchDialplan = new FreeSwitchDialplan();
@ -225,7 +220,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
}
}
if (m_pluginEnabled)
if (m_pluginEnabled)
{
// we need to capture scene in an anonymous method
// here as we need it later in the callbacks
@ -233,8 +228,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
{
OnRegisterCaps(scene, agentID, caps);
};
try
{
@ -254,16 +247,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions.");
}
}
}
}
public void PostInitialise()
{
if (m_pluginEnabled)
{
m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene");
// register the voice interface for this module, so the script engine can call us
m_scene.RegisterModuleInterface<IVoiceModule>(this);
}
@ -282,15 +274,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
{
get { return true; }
}
// <summary>
// implementation of IVoiceModule, called by osSetParcelSIPAddress script function
// </summary>
public void setLandSIPAddress(string SIPAddress,UUID GlobalID)
{
m_log.DebugFormat("[FreeSwitchVoice]: setLandSIPAddress parcel id {0}: setting sip address {1}",
m_log.DebugFormat("[FreeSwitchVoice]: setLandSIPAddress parcel id {0}: setting sip address {1}",
GlobalID, SIPAddress);
lock (m_ParcelAddress)
{
if (m_ParcelAddress.ContainsKey(GlobalID.ToString()))
@ -303,18 +295,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
}
}
}
// <summary>
// OnRegisterCaps is invoked via the scene.EventManager
// everytime OpenSim hands out capabilities to a client
// (login, region crossing). We contribute two capabilities to
// the set of capabilities handed back to the client:
// ProvisionVoiceAccountRequest and ParcelVoiceInfoRequest.
//
//
// ProvisionVoiceAccountRequest allows the client to obtain
// the voice account credentials for the avatar it is
// controlling (e.g., user name, password, etc).
//
//
// ParcelVoiceInfoRequest is invoked whenever the client
// changes from one region or parcel to another.
//
@ -371,7 +363,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
{
System.Threading.Thread.Sleep(2000);
avatar = scene.GetScenePresence(agentID);
if (avatar == null)
return "<llsd>undef</llsd>";
}
@ -407,8 +399,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
// new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm, "http://etsvc02.hursley.ibm.com/api");
LLSDVoiceAccountResponse voiceAccountResponse =
new LLSDVoiceAccountResponse(agentname, password, m_freeSwitchRealm,
String.Format("http://{0}:{1}{2}/", m_openSimWellKnownHTTPAddress,
m_freeSwitchServicePort, m_freeSwitchAPIPrefix));
String.Format("http://{0}:{1}{2}/", m_openSimWellKnownHTTPAddress,
m_freeSwitchServicePort, m_freeSwitchAPIPrefix));
string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse);
@ -442,7 +434,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
string avatarName = avatar.Name;
// - check whether we have a region channel in our cache
// - if not:
// - if not:
// create it and cache it
// - send it to the client
// - send channel_uri: as "sip:regionID@m_sipDomain"
@ -451,12 +443,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
LLSDParcelVoiceInfoResponse parcelVoiceInfo;
string channelUri;
if (null == scene.LandChannel)
if (null == scene.LandChannel)
throw new Exception(String.Format("region \"{0}\": avatar \"{1}\": land data not yet available",
scene.RegionInfo.RegionName, avatarName));
// get channel_uri: check first whether estate
// settings allow voice, then whether parcel allows
// voice, if all do retrieve or obtain the parcel
@ -493,22 +483,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds);
string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo);
m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}",
m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}",
scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r);
return r;
}
catch (Exception e)
{
m_log.ErrorFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2}, retry later",
m_log.ErrorFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2}, retry later",
scene.RegionInfo.RegionName, avatarName, e.Message);
m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2} failed",
m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2} failed",
scene.RegionInfo.RegionName, avatarName, e.ToString());
return "<llsd>undef</llsd>";
}
}
/// <summary>
/// Callback for a client request for ChatSessionRequest
/// </summary>
@ -550,7 +539,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
string fwdresponsestr = "";
int fwdresponsecode = 200;
string fwdresponsecontenttype = "text/xml";
HttpWebRequest forwardreq = (HttpWebRequest)WebRequest.Create(forwardaddress);
forwardreq.Method = method;
@ -577,7 +565,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
response["content_type"] = fwdresponsecontenttype;
response["str_response_string"] = fwdresponsestr;
response["int_response_code"] = fwdresponsecode;
return response;
}
@ -585,11 +573,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request)
{
m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler called");
Hashtable response = new Hashtable();
response["content_type"] = "text/xml";
response["keepalive"] = false;
response["str_response_string"] = String.Format(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
"<VCConfiguration>\r\n"+
@ -607,9 +595,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
"</VCConfiguration>",
m_freeSwitchRealm, m_freeSwitchSIPProxy, m_freeSwitchAttemptUseSTUN,
m_freeSwitchEchoServer, m_freeSwitchEchoPort,
m_freeSwitchDefaultWellKnownIP, m_freeSwitchDefaultTimeout,
m_freeSwitchDefaultWellKnownIP, m_freeSwitchDefaultTimeout,
m_freeSwitchUrlResetPassword, "");
response["int_response_code"] = 200;
m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler return {0}",response["str_response_string"]);
@ -624,7 +612,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
response["content-type"] = "text/xml";
Hashtable requestBody = parseRequestBody((string)request["body"]);
if (!requestBody.ContainsKey("auth_token"))
return response;
@ -632,7 +620,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
//string[] auth_tokenvals = auth_token.Split(':');
//string username = auth_tokenvals[0];
int strcount = 0;
string[] ids = new string[strcount];
int iter = -1;
@ -648,7 +636,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
}
StringBuilder resp = new StringBuilder();
resp.Append("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?><response xmlns=\"http://www.vivox.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"/xsd/buddy_list.xsd\">");
resp.Append(string.Format(@"<level0>
<status>OK</status>
<cookie_name>lib_session</cookie_name>
@ -678,7 +666,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
<b2g_group_id></b2g_group_id>
</level3>", ids[i],i,m_freeSwitchRealm,dt));
}
resp.Append("</buddies><groups></groups></body></level0></response>");
response["str_response_string"] = resp.ToString();
@ -694,7 +682,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
string requestbody = (string)request["body"];
string uri = (string)request["uri"];
string contenttype = (string)request["content-type"];
Hashtable requestBody = parseRequestBody((string)request["body"]);
//string pwd = (string) requestBody["pwd"];
@ -712,7 +700,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
pos++;
if (s == userid)
break;
}
}
}
@ -735,7 +722,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
</body>
</level0>
</response>", userid, pos, avatarName);
response["int_response_code"] = 200;
return response;
/*
@ -752,13 +739,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request)
{
m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler called with {0}", (string)request["body"]);
Hashtable response = new Hashtable();
response["str_response_string"] = string.Empty;
// all the params come as NVPs in the request body
Hashtable requestBody = parseRequestBody((string) request["body"]);
// is this a dialplan or directory request
// is this a dialplan or directory request
string section = (string) requestBody["section"];
if (section == "directory")
@ -767,40 +754,39 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
response = m_FreeSwitchDialplan.HandleDialplanRequest(m_freeSwitchContext, m_freeSwitchRealm, requestBody);
else
m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section);
// XXX: re-generate dialplan:
// XXX: re-generate dialplan:
// - conf == region UUID
// - conf number = region port
// -> TODO Initialise(): keep track of regions via events
// re-generate accounts for all avatars
// re-generate accounts for all avatars
// -> TODO Initialise(): keep track of avatars via events
Regex normalizeEndLines = new Regex(@"\r\n", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline);
m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler return {0}",normalizeEndLines.Replace(((string)response["str_response_string"]), ""));
return response;
}
public Hashtable parseRequestBody(string body)
{
Hashtable bodyParams = new Hashtable();
// split string
string [] nvps = body.Split(new Char [] {'&'});
foreach (string s in nvps) {
foreach (string s in nvps)
{
if (s.Trim() != "")
{
string [] nvp = s.Split(new Char [] {'='});
bodyParams.Add(HttpUtility.UrlDecode(nvp[0]), HttpUtility.UrlDecode(nvp[1]));
}
}
return bodyParams;
}
private string ChannelUri(Scene scene, LandData land)
{
string channelUri = null;
string landUUID;
@ -808,12 +794,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
// Create parcel voice channel. If no parcel exists, then the voice channel ID is the same
// as the directory ID. Otherwise, it reflects the parcel's ID.
lock (m_ParcelAddress)
{
if (m_ParcelAddress.ContainsKey(land.GlobalID.ToString()))
{
m_log.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}",
m_log.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}",
land.GlobalID, m_ParcelAddress[land.GlobalID.ToString()]);
return m_ParcelAddress[land.GlobalID.ToString()];
}
@ -823,22 +809,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
{
landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name);
landUUID = land.GlobalID.ToString();
m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
landName, land.LocalID, landUUID);
}
else
{
landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionName);
landUUID = scene.RegionInfo.RegionID.ToString();
m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
landName, land.LocalID, landUUID);
}
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
// slvoice handles the sip address differently if it begins with confctl, hiding it from the user in the friends list. however it also disables
// the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator.
channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(encoding.GetBytes(landUUID)), m_freeSwitchRealm);
lock (m_ParcelAddress)
{
if (!m_ParcelAddress.ContainsKey(land.GlobalID.ToString()))
@ -849,14 +835,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
return channelUri;
}
private static bool CustomCertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
{
return true;
}
}
public class MonoCert : ICertificatePolicy
{
#region ICertificatePolicy Members

View File

@ -34,6 +34,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
public interface IAvatar : IEntity
{
bool IsChildAgent { get; }
//// <value>
/// Array of worn attachments, empty but not null, if no attachments are worn
/// </value>

View File

@ -767,7 +767,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
if (!CanEdit())
return;
GetSOP().SendSound(asset.ToString(), volume, true, 0);
GetSOP().SendSound(asset.ToString(), volume, true, 0, 0, false, false);
}
#endregion

View File

@ -70,6 +70,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
set { GetSP().TeleportWithMomentum(value); }
}
public bool IsChildAgent
{
get { return GetSP().IsChildAgent; }
}
#region IAvatar implementation
public IAvatarAttachment[] Attachments
{

View File

@ -231,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
if (soundModule != null)
{
soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, volume, position,
m_internalScene.RegionInfo.RegionHandle);
m_internalScene.RegionInfo.RegionHandle, 0);
}
}
@ -241,7 +241,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
if (soundModule != null)
{
soundModule.TriggerSound(audio, UUID.Zero, UUID.Zero, UUID.Zero, 1.0, position,
m_internalScene.RegionInfo.RegionHandle);
m_internalScene.RegionInfo.RegionHandle, 0);
}
}

View File

@ -121,19 +121,19 @@ namespace OpenSim.Region.Modules.SvnSerialiser
{
serialiser.LoadPrimsFromXml2(
scene,
m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
+ Slash.DirectorySeparatorChar + "objects.xml");
scene.RequestModuleInterface<ITerrainModule>().LoadFromFile(
m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
m_svndir + Slash.DirectorySeparatorChar + scene.RegionInfo.RegionID
+ Slash.DirectorySeparatorChar + "heightmap.r32");
m_log.Info("[SVNBACKUP]: Region load successful (" + scene.RegionInfo.RegionName + ").");
}
else
{
m_log.ErrorFormat(
"[SVNBACKUP]: Region load of {0} failed - no serialisation module available",
"[SVNBACKUP]: Region load of {0} failed - no serialisation module available",
scene.RegionInfo.RegionName);
}
}

View File

@ -298,6 +298,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public event ObjectBuy OnObjectBuy;
public event BuyObjectInventory OnBuyObjectInventory;
public event AgentSit OnUndo;
public event AgentSit OnRedo;
public event LandUndo OnLandUndo;
public event ForceReleaseControls OnForceReleaseControls;
public event GodLandStatRequest OnLandStatRequest;

View File

@ -195,6 +195,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
}
public override void VehicleFlags(int param, bool remove)
{
}
public override void SetVolumeDetect(int param)
{

View File

@ -372,6 +372,11 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
}
public override void VehicleFlags(int param, bool remove)
{
}
public override void SetVolumeDetect(int param)
{

View File

@ -407,6 +407,11 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
}
public override void VehicleFlags(int param, bool remove)
{
}
public override void SetVolumeDetect(int param)
{
//TODO: GhostObject

View File

@ -500,6 +500,18 @@ namespace OpenSim.Region.Physics.BulletXPlugin
public BulletXScene(String sceneIdentifier)
{
//identifier = sceneIdentifier;
cDispatcher = new CollisionDispatcherLocal(this);
Vector3 worldMinDim = new Vector3((float)minXY, (float)minXY, (float)minZ);
Vector3 worldMaxDim = new Vector3((float)maxXY, (float)maxXY, (float)maxZ);
opCache = new AxisSweep3(worldMinDim, worldMaxDim, maxHandles);
sicSolver = new SequentialImpulseConstraintSolver();
lock (BulletXLock)
{
ddWorld = new DiscreteDynamicsWorld(cDispatcher, opCache, sicSolver);
ddWorld.Gravity = new Vector3(0, 0, -gravity);
}
//this._heightmap = new float[65536];
}
public static float Gravity
@ -582,12 +594,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin
pos.Y = position.Y;
pos.Z = position.Z + 20;
BulletXCharacter newAv = null;
newAv.Flying = isFlying;
lock (BulletXLock)
{
newAv = new BulletXCharacter(avName, this, pos);
_characters.Add(newAv.RigidBody, newAv);
}
newAv.Flying = isFlying;
return newAv;
}
@ -992,9 +1004,13 @@ namespace OpenSim.Region.Physics.BulletXPlugin
public override void VehicleFlagsRemove(int flags)
{
}
public override void VehicleFlags(int param, bool remove)
{
}
public override void SetVolumeDetect(int param)
{

View File

@ -734,6 +734,10 @@ namespace OpenSim.Region.Physics.OdePlugin
}
public override void VehicleFlags(int flags, bool remove)
{
}
public override void VehicleFlagsSet(int flags)
{

View File

@ -2416,6 +2416,14 @@ Console.WriteLine(" JointCreateFixed");
m_vehicle.ProcessRotationVehicleParam((Vehicle) param, rotation);
}
public override void VehicleFlags(int flags, bool remove)
{
if (!remove)
VehicleFlagsSet(flags);
else
VehicleFlagsRemove(flags);
}
public override void VehicleFlagsSet(int flags)
{
m_vehicle.ProcessFlagsVehicleSet(flags);

View File

@ -210,6 +210,7 @@ namespace OpenSim.Region.Physics.Manager
public abstract void VehicleRotationParam(int param, Quaternion rotation);
public abstract void VehicleFlagsSet(int flags);
public abstract void VehicleFlagsRemove(int flags);
public abstract void VehicleFlags(int param, bool remove);
public abstract void SetVolumeDetect(int param); // Allows the detection of collisions with inherently non-physical prims. see llVolumeDetect for more
@ -364,6 +365,11 @@ namespace OpenSim.Region.Physics.Manager
}
public override void VehicleFlags(int param, bool remove)
{
}
public override void SetVolumeDetect(int param)
{

View File

@ -91,7 +91,9 @@ namespace OpenSim.Region.Physics.Manager
BANKING_EFFICIENCY = 38,
BANKING_MIX = 39,
BANKING_TIMESCALE = 40,
REFERENCE_FRAME = 44
REFERENCE_FRAME = 44,
BLOCK_EXIT = 45,
ROLL_FRAME = 46
}
@ -107,7 +109,13 @@ namespace OpenSim.Region.Physics.Manager
LIMIT_MOTOR_UP = 64,
MOUSELOOK_STEER = 128,
MOUSELOOK_BANK = 256,
CAMERA_DECOUPLED = 512
CAMERA_DECOUPLED = 512,
NO_X = 1024,
NO_Y = 2048,
NO_Z = 4096,
LOCK_HOVER_HEIGHT = 8192,
NO_DEFLECTION = 16392,
LOCK_ROTATION = 32784
}
}

View File

@ -744,6 +744,11 @@ namespace OpenSim.Region.Physics.OdePlugin
}
public override void VehicleFlags(int param, bool remove)
{
}
public override void SetVolumeDetect(int param)
{

View File

@ -72,37 +72,40 @@ namespace OpenSim.Region.Physics.OdePlugin
// Vehicle properties
private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind
// private Quaternion m_referenceFrame = Quaternion.Identity; // Axis modifier
private VehicleFlag m_flags = (VehicleFlag) 0; // Boolean settings:
// HOVER_TERRAIN_ONLY
// HOVER_GLOBAL_HEIGHT
// NO_DEFLECTION_UP
// HOVER_WATER_ONLY
// HOVER_UP_ONLY
// LIMIT_MOTOR_UP
// LIMIT_ROLL_ONLY
private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind
// private Quaternion m_referenceFrame = Quaternion.Identity; // Axis modifier
private VehicleFlag m_flags = (VehicleFlag) 0; // Boolean settings:
// HOVER_TERRAIN_ONLY
// HOVER_GLOBAL_HEIGHT
// NO_DEFLECTION_UP
// HOVER_WATER_ONLY
// HOVER_UP_ONLY
// LIMIT_MOTOR_UP
// LIMIT_ROLL_ONLY
private VehicleFlag m_Hoverflags = (VehicleFlag)0;
private Vector3 m_BlockingEndPoint = Vector3.Zero;
private Quaternion m_RollreferenceFrame = Quaternion.Identity;
// Linear properties
private Vector3 m_linearMotorDirection = Vector3.Zero; // velocity requested by LSL, decayed by time
private Vector3 m_linearMotorDirectionLASTSET = Vector3.Zero; // velocity requested by LSL
private Vector3 m_dir = Vector3.Zero; // velocity applied to body
private Vector3 m_linearMotorDirection = Vector3.Zero; // velocity requested by LSL, decayed by time
private Vector3 m_linearMotorDirectionLASTSET = Vector3.Zero; // velocity requested by LSL
private Vector3 m_dir = Vector3.Zero; // velocity applied to body
private Vector3 m_linearFrictionTimescale = Vector3.Zero;
private float m_linearMotorDecayTimescale = 0;
private float m_linearMotorTimescale = 0;
private Vector3 m_lastLinearVelocityVector = Vector3.Zero;
private d.Vector3 m_lastPositionVector = new d.Vector3();
// private bool m_LinearMotorSetLastFrame = false;
// private Vector3 m_linearMotorOffset = Vector3.Zero;
//Angular properties
private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor
private int m_angularMotorApply = 0; // application frame counter
private Vector3 m_angularMotorVelocity = Vector3.Zero; // current angular motor velocity
private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate
private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate
private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate
private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body
// private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body
private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor
private int m_angularMotorApply = 0; // application frame counter
private Vector3 m_angularMotorVelocity = Vector3.Zero; // current angular motor velocity
private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate
private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate
private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate
private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body
// private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body
//Deflection properties
// private float m_angularDeflectionEfficiency = 0;
@ -120,14 +123,14 @@ namespace OpenSim.Region.Physics.OdePlugin
// private float m_VhoverEfficiency = 0f;
private float m_VhoverTimescale = 0f;
private float m_VhoverTargetHeight = -1.0f; // if <0 then no hover, else its the current target height
private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle.
private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle.
// Modifies gravity. Slider between -1 (double-gravity) and 1 (full anti-gravity)
// KF: So far I have found no good method to combine a script-requested .Z velocity and gravity.
// Therefore only m_VehicleBuoyancy=1 (0g) will use the script-requested .Z velocity.
//Attractor properties
private float m_verticalAttractionEfficiency = 1.0f; // damped
private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor.
//Attractor properties
private float m_verticalAttractionEfficiency = 1.0f; // damped
private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor.
internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue)
{
@ -255,6 +258,9 @@ namespace OpenSim.Region.Physics.OdePlugin
case Vehicle.LINEAR_MOTOR_OFFSET:
// m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z);
break;
case Vehicle.BLOCK_EXIT:
m_BlockingEndPoint = new Vector3(pValue.X, pValue.Y, pValue.Z);
break;
}
}//end ProcessVectorVehicleParam
@ -265,15 +271,189 @@ namespace OpenSim.Region.Physics.OdePlugin
case Vehicle.REFERENCE_FRAME:
// m_referenceFrame = pValue;
break;
case Vehicle.ROLL_FRAME:
m_RollreferenceFrame = pValue;
break;
}
}//end ProcessRotationVehicleParam
internal void ProcessVehicleFlags(int pParam, bool remove)
{
if (remove)
{
if (pParam == -1)
{
m_flags = (VehicleFlag)0;
m_Hoverflags = (VehicleFlag)0;
return;
}
if ((pParam & (int)VehicleFlag.HOVER_GLOBAL_HEIGHT) == (int)VehicleFlag.HOVER_GLOBAL_HEIGHT)
{
if ((m_Hoverflags & VehicleFlag.HOVER_GLOBAL_HEIGHT) != (VehicleFlag)0)
m_Hoverflags &= ~(VehicleFlag.HOVER_GLOBAL_HEIGHT);
}
if ((pParam & (int)VehicleFlag.HOVER_TERRAIN_ONLY) == (int)VehicleFlag.HOVER_TERRAIN_ONLY)
{
if ((m_Hoverflags & VehicleFlag.HOVER_TERRAIN_ONLY) != (VehicleFlag)0)
m_Hoverflags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY);
}
if ((pParam & (int)VehicleFlag.HOVER_UP_ONLY) == (int)VehicleFlag.HOVER_UP_ONLY)
{
if ((m_Hoverflags & VehicleFlag.HOVER_UP_ONLY) != (VehicleFlag)0)
m_Hoverflags &= ~(VehicleFlag.HOVER_UP_ONLY);
}
if ((pParam & (int)VehicleFlag.HOVER_WATER_ONLY) == (int)VehicleFlag.HOVER_WATER_ONLY)
{
if ((m_Hoverflags & VehicleFlag.HOVER_WATER_ONLY) != (VehicleFlag)0)
m_Hoverflags &= ~(VehicleFlag.HOVER_WATER_ONLY);
}
if ((pParam & (int)VehicleFlag.LIMIT_MOTOR_UP) == (int)VehicleFlag.LIMIT_MOTOR_UP)
{
if ((m_flags & VehicleFlag.LIMIT_MOTOR_UP) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.LIMIT_MOTOR_UP);
}
if ((pParam & (int)VehicleFlag.LIMIT_ROLL_ONLY) == (int)VehicleFlag.LIMIT_ROLL_ONLY)
{
if ((m_flags & VehicleFlag.LIMIT_ROLL_ONLY) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.LIMIT_ROLL_ONLY);
}
if ((pParam & (int)VehicleFlag.MOUSELOOK_BANK) == (int)VehicleFlag.MOUSELOOK_BANK)
{
if ((m_flags & VehicleFlag.MOUSELOOK_BANK) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.MOUSELOOK_BANK);
}
if ((pParam & (int)VehicleFlag.MOUSELOOK_STEER) == (int)VehicleFlag.MOUSELOOK_STEER)
{
if ((m_flags & VehicleFlag.MOUSELOOK_STEER) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.MOUSELOOK_STEER);
}
if ((pParam & (int)VehicleFlag.NO_DEFLECTION_UP) == (int)VehicleFlag.NO_DEFLECTION_UP)
{
if ((m_flags & VehicleFlag.NO_DEFLECTION_UP) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP);
}
if ((pParam & (int)VehicleFlag.CAMERA_DECOUPLED) == (int)VehicleFlag.CAMERA_DECOUPLED)
{
if ((m_flags & VehicleFlag.CAMERA_DECOUPLED) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.CAMERA_DECOUPLED);
}
if ((pParam & (int)VehicleFlag.NO_X) == (int)VehicleFlag.NO_X)
{
if ((m_flags & VehicleFlag.NO_X) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.NO_X);
}
if ((pParam & (int)VehicleFlag.NO_Y) == (int)VehicleFlag.NO_Y)
{
if ((m_flags & VehicleFlag.NO_Y) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.NO_Y);
}
if ((pParam & (int)VehicleFlag.NO_Z) == (int)VehicleFlag.NO_Z)
{
if ((m_flags & VehicleFlag.NO_Z) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.NO_Z);
}
if ((pParam & (int)VehicleFlag.LOCK_HOVER_HEIGHT) == (int)VehicleFlag.LOCK_HOVER_HEIGHT)
{
if ((m_Hoverflags & VehicleFlag.LOCK_HOVER_HEIGHT) != (VehicleFlag)0)
m_Hoverflags &= ~(VehicleFlag.LOCK_HOVER_HEIGHT);
}
if ((pParam & (int)VehicleFlag.NO_DEFLECTION) == (int)VehicleFlag.NO_DEFLECTION)
{
if ((m_flags & VehicleFlag.NO_DEFLECTION) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.NO_DEFLECTION);
}
if ((pParam & (int)VehicleFlag.LOCK_ROTATION) == (int)VehicleFlag.LOCK_ROTATION)
{
if ((m_flags & VehicleFlag.LOCK_ROTATION) != (VehicleFlag)0)
m_flags &= ~(VehicleFlag.LOCK_ROTATION);
}
}
else
{
if ((pParam & (int)VehicleFlag.HOVER_GLOBAL_HEIGHT) == (int)VehicleFlag.HOVER_GLOBAL_HEIGHT)
{
m_Hoverflags |= (VehicleFlag.HOVER_GLOBAL_HEIGHT | m_flags);
}
if ((pParam & (int)VehicleFlag.HOVER_TERRAIN_ONLY) == (int)VehicleFlag.HOVER_TERRAIN_ONLY)
{
m_Hoverflags |= (VehicleFlag.HOVER_TERRAIN_ONLY | m_flags);
}
if ((pParam & (int)VehicleFlag.HOVER_UP_ONLY) == (int)VehicleFlag.HOVER_UP_ONLY)
{
m_Hoverflags |= (VehicleFlag.HOVER_UP_ONLY | m_flags);
}
if ((pParam & (int)VehicleFlag.HOVER_WATER_ONLY) == (int)VehicleFlag.HOVER_WATER_ONLY)
{
m_Hoverflags |= (VehicleFlag.HOVER_WATER_ONLY | m_flags);
}
if ((pParam & (int)VehicleFlag.LIMIT_MOTOR_UP) == (int)VehicleFlag.LIMIT_MOTOR_UP)
{
m_flags |= (VehicleFlag.LIMIT_MOTOR_UP | m_flags);
}
if ((pParam & (int)VehicleFlag.MOUSELOOK_BANK) == (int)VehicleFlag.MOUSELOOK_BANK)
{
m_flags |= (VehicleFlag.MOUSELOOK_BANK | m_flags);
}
if ((pParam & (int)VehicleFlag.MOUSELOOK_STEER) == (int)VehicleFlag.MOUSELOOK_STEER)
{
m_flags |= (VehicleFlag.MOUSELOOK_STEER | m_flags);
}
if ((pParam & (int)VehicleFlag.NO_DEFLECTION_UP) == (int)VehicleFlag.NO_DEFLECTION_UP)
{
m_flags |= (VehicleFlag.NO_DEFLECTION_UP | m_flags);
}
if ((pParam & (int)VehicleFlag.CAMERA_DECOUPLED) == (int)VehicleFlag.CAMERA_DECOUPLED)
{
m_flags |= (VehicleFlag.CAMERA_DECOUPLED | m_flags);
}
if ((pParam & (int)VehicleFlag.NO_X) == (int)VehicleFlag.NO_X)
{
m_flags |= (VehicleFlag.NO_X);
}
if ((pParam & (int)VehicleFlag.NO_Y) == (int)VehicleFlag.NO_Y)
{
m_flags |= (VehicleFlag.NO_Y);
}
if ((pParam & (int)VehicleFlag.NO_Z) == (int)VehicleFlag.NO_Z)
{
m_flags |= (VehicleFlag.NO_Z);
}
if ((pParam & (int)VehicleFlag.LOCK_HOVER_HEIGHT) == (int)VehicleFlag.LOCK_HOVER_HEIGHT)
{
m_Hoverflags |= (VehicleFlag.LOCK_HOVER_HEIGHT);
}
if ((pParam & (int)VehicleFlag.NO_DEFLECTION) == (int)VehicleFlag.NO_DEFLECTION)
{
m_flags |= (VehicleFlag.NO_DEFLECTION);
}
if ((pParam & (int)VehicleFlag.LOCK_ROTATION) == (int)VehicleFlag.LOCK_ROTATION)
{
m_flags |= (VehicleFlag.LOCK_ROTATION);
}
}
}//end ProcessVehicleFlags
internal void ProcessTypeChange(Vehicle pType)
{
// Set Defaults For Type
m_type = pType;
switch (pType)
{
case Vehicle.TYPE_NONE:
m_linearFrictionTimescale = new Vector3(0, 0, 0);
m_angularFrictionTimescale = new Vector3(0, 0, 0);
m_linearMotorDirection = Vector3.Zero;
m_linearMotorTimescale = 0;
m_linearMotorDecayTimescale = 0;
m_angularMotorDirection = Vector3.Zero;
m_angularMotorTimescale = 0;
m_angularMotorDecayTimescale = 0;
m_VhoverHeight = 0;
m_VhoverTimescale = 0;
m_VehicleBuoyancy = 0;
m_flags = (VehicleFlag)0;
break;
case Vehicle.TYPE_SLED:
m_linearFrictionTimescale = new Vector3(30, 1, 1000);
m_angularFrictionTimescale = new Vector3(1000, 1000, 1000);
@ -295,9 +475,9 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_bankingMix = 1;
// m_bankingTimescale = 10;
// m_referenceFrame = Quaternion.Identity;
m_flags &=
~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
m_Hoverflags &=
~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.LIMIT_MOTOR_UP);
break;
case Vehicle.TYPE_CAR:
@ -323,9 +503,10 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_bankingMix = 1;
// m_bankingTimescale = 1;
// m_referenceFrame = Quaternion.Identity;
m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT);
m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.HOVER_UP_ONLY |
m_Hoverflags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT);
m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY |
VehicleFlag.LIMIT_MOTOR_UP);
m_Hoverflags |= (VehicleFlag.HOVER_UP_ONLY);
break;
case Vehicle.TYPE_BOAT:
m_linearFrictionTimescale = new Vector3(10, 3, 2);
@ -350,10 +531,12 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_bankingMix = 0.8f;
// m_bankingTimescale = 1;
// m_referenceFrame = Quaternion.Identity;
m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.LIMIT_ROLL_ONLY |
m_Hoverflags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY |
VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY |
m_flags &= ~(VehicleFlag.LIMIT_ROLL_ONLY);
m_flags |= (VehicleFlag.NO_DEFLECTION_UP |
VehicleFlag.LIMIT_MOTOR_UP);
m_Hoverflags |= (VehicleFlag.HOVER_WATER_ONLY);
break;
case Vehicle.TYPE_AIRPLANE:
m_linearFrictionTimescale = new Vector3(200, 10, 5);
@ -378,8 +561,9 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_bankingMix = 0.7f;
// m_bankingTimescale = 2;
// m_referenceFrame = Quaternion.Identity;
m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY | VehicleFlag.LIMIT_MOTOR_UP);
m_Hoverflags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_MOTOR_UP);
m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY);
break;
case Vehicle.TYPE_BALLOON:
@ -405,9 +589,11 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_bankingMix = 0.7f;
// m_bankingTimescale = 5;
// m_referenceFrame = Quaternion.Identity;
m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
VehicleFlag.HOVER_UP_ONLY | VehicleFlag.LIMIT_MOTOR_UP);
m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT);
m_Hoverflags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
VehicleFlag.HOVER_UP_ONLY);
m_flags &= ~(VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_MOTOR_UP);
m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY);
m_Hoverflags |= (VehicleFlag.HOVER_GLOBAL_HEIGHT);
break;
}
@ -431,6 +617,7 @@ namespace OpenSim.Region.Physics.OdePlugin
MoveLinear(pTimestep, pParentScene);
MoveAngular(pTimestep);
LimitRotation(pTimestep);
}// end Step
private void MoveLinear(float pTimestep, OdeScene _pParentScene)
@ -477,61 +664,152 @@ namespace OpenSim.Region.Physics.OdePlugin
// .Z velocity and gravity. Therefore only 0g will used script-requested
// .Z velocity. >0g (m_VehicleBuoyancy < 1) will used modified gravity only.
Vector3 grav = Vector3.Zero;
if (m_VehicleBuoyancy < 1.0f)
// There is some gravity, make a gravity force vector
// that is applied after object velocity.
d.Mass objMass;
d.BodyGetMass(Body, out objMass);
// m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g;
grav.Z = _pParentScene.gravityz * objMass.mass * (1f - m_VehicleBuoyancy);
// Preserve the current Z velocity
d.Vector3 vel_now = d.BodyGetLinearVel(Body);
m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity
d.Vector3 pos = d.BodyGetPosition(Body);
Vector3 accel = new Vector3(-(m_dir.X - m_lastLinearVelocityVector.X / 0.1f), -(m_dir.Y - m_lastLinearVelocityVector.Y / 0.1f), m_dir.Z - m_lastLinearVelocityVector.Z / 0.1f);
Vector3 posChange = new Vector3();
posChange.X = pos.X - m_lastPositionVector.X;
posChange.Y = pos.Y - m_lastPositionVector.Y;
posChange.Z = pos.Z - m_lastPositionVector.Z;
double Zchange = Math.Abs(posChange.Z);
if (m_BlockingEndPoint != Vector3.Zero)
{
// There is some gravity, make a gravity force vector
// that is applied after object velocity.
d.Mass objMass;
d.BodyGetMass(Body, out objMass);
// m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g;
grav.Z = _pParentScene.gravityz * objMass.mass * (1f - m_VehicleBuoyancy);
// Preserve the current Z velocity
d.Vector3 vel_now = d.BodyGetLinearVel(Body);
m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity
} // else its 1.0, no gravity.
if (pos.X >= (m_BlockingEndPoint.X - (float)1))
{
pos.X -= posChange.X + 1;
d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
}
if (pos.Y >= (m_BlockingEndPoint.Y - (float)1))
{
pos.Y -= posChange.Y + 1;
d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
}
if (pos.Z >= (m_BlockingEndPoint.Z - (float)1))
{
pos.Z -= posChange.Z + 1;
d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
}
if (pos.X <= 0)
{
pos.X += posChange.X + 1;
d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
}
if (pos.Y <= 0)
{
pos.Y += posChange.Y + 1;
d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
}
}
if (pos.Z < _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y))
{
pos.Z = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + 2;
d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
}
// Check if hovering
if ((m_flags & (VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT)) != 0)
if ((m_Hoverflags & (VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT)) != 0)
{
// We should hover, get the target height
d.Vector3 pos = d.BodyGetPosition(Body);
if ((m_flags & VehicleFlag.HOVER_WATER_ONLY) == VehicleFlag.HOVER_WATER_ONLY)
if ((m_Hoverflags & VehicleFlag.HOVER_WATER_ONLY) != 0)
{
m_VhoverTargetHeight = _pParentScene.GetWaterLevel() + m_VhoverHeight;
}
else if ((m_flags & VehicleFlag.HOVER_TERRAIN_ONLY) == VehicleFlag.HOVER_TERRAIN_ONLY)
if ((m_Hoverflags & VehicleFlag.HOVER_TERRAIN_ONLY) != 0)
{
m_VhoverTargetHeight = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + m_VhoverHeight;
}
else if ((m_flags & VehicleFlag.HOVER_GLOBAL_HEIGHT) == VehicleFlag.HOVER_GLOBAL_HEIGHT)
if ((m_Hoverflags & VehicleFlag.HOVER_GLOBAL_HEIGHT) != 0)
{
m_VhoverTargetHeight = m_VhoverHeight;
}
if ((m_flags & VehicleFlag.HOVER_UP_ONLY) == VehicleFlag.HOVER_UP_ONLY)
if ((m_Hoverflags & VehicleFlag.HOVER_UP_ONLY) != 0)
{
// If body is aready heigher, use its height as target height
if (pos.Z > m_VhoverTargetHeight) m_VhoverTargetHeight = pos.Z;
}
if ((m_Hoverflags & VehicleFlag.LOCK_HOVER_HEIGHT) != 0)
{
if ((pos.Z - m_VhoverTargetHeight) > .2 || (pos.Z - m_VhoverTargetHeight) < -.2)
{
d.BodySetPosition(Body, pos.X, pos.Y, m_VhoverTargetHeight);
}
}
else
{
float herr0 = pos.Z - m_VhoverTargetHeight;
// Replace Vertical speed with correction figure if significant
if (Math.Abs(herr0) > 0.01f)
{
m_dir.Z = -((herr0 * pTimestep * 50.0f) / m_VhoverTimescale);
//KF: m_VhoverEfficiency is not yet implemented
}
else
{
m_dir.Z = 0f;
}
}
// m_VhoverEfficiency = 0f; // 0=boucy, 1=Crit.damped
// m_VhoverTimescale = 0f; // time to acheive height
// pTimestep is time since last frame,in secs
float herr0 = pos.Z - m_VhoverTargetHeight;
// Replace Vertical speed with correction figure if significant
if (Math.Abs(herr0) > 0.01f)
{
d.Mass objMass;
d.BodyGetMass(Body, out objMass);
m_dir.Z = - ((herr0 * pTimestep * 50.0f) / m_VhoverTimescale);
//KF: m_VhoverEfficiency is not yet implemented
}
else
{
m_dir.Z = 0f;
}
}
if ((m_flags & (VehicleFlag.LIMIT_MOTOR_UP)) != 0)
{
//Start Experimental Values
if (Zchange > .3)
{
grav.Z = (float)(grav.Z * 3);
}
if (Zchange > .15)
{
grav.Z = (float)(grav.Z * 2);
}
if (Zchange > .75)
{
grav.Z = (float)(grav.Z * 1.5);
}
if (Zchange > .05)
{
grav.Z = (float)(grav.Z * 1.25);
}
if (Zchange > .025)
{
grav.Z = (float)(grav.Z * 1.125);
}
float terraintemp = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y);
float postemp = (pos.Z - terraintemp);
if (postemp > 2.5f)
{
grav.Z = (float)(grav.Z * 1.037125);
}
//End Experimental Values
}
if ((m_flags & (VehicleFlag.NO_X)) != 0)
{
m_dir.X = 0;
}
if ((m_flags & (VehicleFlag.NO_Y)) != 0)
{
m_dir.Y = 0;
}
if ((m_flags & (VehicleFlag.NO_Z)) != 0)
{
m_dir.Z = 0;
}
m_lastPositionVector = d.BodyGetPosition(Body);
// Apply velocity
d.BodySetLinearVel(Body, m_dir.X, m_dir.Y, m_dir.Z);
// apply gravity force
@ -629,6 +907,12 @@ namespace OpenSim.Region.Physics.OdePlugin
// Sum velocities
m_lastAngularVelocity = m_angularMotorVelocity + vertattr; // + bank + deflection
if ((m_flags & (VehicleFlag.NO_DEFLECTION_UP)) != 0)
{
m_lastAngularVelocity.X = 0;
m_lastAngularVelocity.Y = 0;
}
if (!m_lastAngularVelocity.ApproxEquals(Vector3.Zero, 0.01f))
{
@ -647,5 +931,44 @@ namespace OpenSim.Region.Physics.OdePlugin
d.BodySetAngularVel (Body, m_lastAngularVelocity.X, m_lastAngularVelocity.Y, m_lastAngularVelocity.Z);
} //end MoveAngular
internal void LimitRotation(float timestep)
{
d.Quaternion rot = d.BodyGetQuaternion(Body);
Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object
d.Quaternion m_rot = new d.Quaternion();
bool changed = false;
m_rot.X = rotq.X;
m_rot.Y = rotq.Y;
m_rot.Z = rotq.Z;
m_rot.W = rotq.W;
if (m_RollreferenceFrame != Quaternion.Identity)
{
if (rotq.X >= m_RollreferenceFrame.X)
{
m_rot.X = rotq.X - (m_RollreferenceFrame.X / 2);
}
if (rotq.Y >= m_RollreferenceFrame.Y)
{
m_rot.Y = rotq.Y - (m_RollreferenceFrame.Y / 2);
}
if (rotq.X <= -m_RollreferenceFrame.X)
{
m_rot.X = rotq.X + (m_RollreferenceFrame.X / 2);
}
if (rotq.Y <= -m_RollreferenceFrame.Y)
{
m_rot.Y = rotq.Y + (m_RollreferenceFrame.Y / 2);
}
changed = true;
}
if ((m_flags & VehicleFlag.LOCK_ROTATION) != 0)
{
m_rot.X = 0;
m_rot.Y = 0;
changed = true;
}
if (changed)
d.BodySetQuaternion(Body, ref m_rot);
}
}
}

View File

@ -2357,12 +2357,17 @@ Console.WriteLine(" JointCreateFixed");
public override void VehicleFlagsSet(int flags)
{
VehicleFlags(flags, false);
}
public override void VehicleFlagsRemove(int flags)
{
VehicleFlags(flags, true);
}
public override void VehicleFlags(int param, bool remove)
{
m_vehicle.ProcessVehicleFlags(param, remove);
}
public override void SetVolumeDetect(int param)

View File

@ -192,6 +192,8 @@ namespace OpenSim.Region.Physics.POSPlugin
}
public override void VehicleFlags(int param, bool remove) { }
public override void SetVolumeDetect(int param)
{

View File

@ -149,6 +149,8 @@ namespace OpenSim.Region.Physics.POSPlugin
}
public override void VehicleFlags(int param, bool remove) { }
public override void SetVolumeDetect(int param)
{

View File

@ -0,0 +1,361 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Physics.Manager;
using PhysXWrapper;
using Quaternion=OpenMetaverse.Quaternion;
using System.Reflection;
using log4net;
using OpenMetaverse;
namespace OpenSim.Region.Physics.PhysXPlugin
{
public class PhysXCharacter : PhysicsActor
{
private Vector3 _position;
private Vector3 _velocity;
private Vector3 m_rotationalVelocity = Vector3.Zero;
private Vector3 _acceleration;
private NxCharacter _character;
private bool flying;
private bool iscolliding = false;
private float gravityAccel;
public PhysXCharacter(NxCharacter character)
{
_character = character;
}
public override int PhysicsActorType
{
get { return (int) ActorTypes.Agent; }
set { return; }
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public override uint LocalID
{
set { return; }
}
public override bool Grabbed
{
set { return; }
}
public override bool Selected
{
set { return; }
}
public override float Buoyancy
{
get { return 0f; }
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool IsPhysical
{
get { return false; }
set { return; }
}
public override bool ThrottleUpdates
{
get { return false; }
set { return; }
}
public override bool Flying
{
get { return flying; }
set { flying = value; }
}
public override bool IsColliding
{
get { return iscolliding; }
set { iscolliding = value; }
}
public override bool CollidingGround
{
get { return false; }
set { return; }
}
public override bool CollidingObj
{
get { return false; }
set { return; }
}
public override Vector3 RotationalVelocity
{
get { return m_rotationalVelocity; }
set { m_rotationalVelocity = value; }
}
public override bool Stopped
{
get { return false; }
}
public override Vector3 Position
{
get { return _position; }
set
{
_position = value;
Vec3 ps = new Vec3();
ps.X = value.X;
ps.Y = value.Y;
ps.Z = value.Z;
_character.Position = ps;
}
}
public override Vector3 Size
{
get { return Vector3.Zero; }
set { }
}
public override float Mass
{
get { return 0f; }
}
public override Vector3 Force
{
get { return Vector3.Zero; }
set { return; }
}
public override int VehicleType
{
get { return 0; }
set { return; }
}
public override void VehicleFloatParam(int param, float value)
{
}
public override void VehicleVectorParam(int param, Vector3 value)
{
}
public override void VehicleRotationParam(int param, Quaternion rotation)
{
}
public override void VehicleFlagsSet(int param)
{
}
public override void VehicleFlagsRemove(int param)
{
}
public override void VehicleFlags(int param, bool remove)
{
}
public override void SetVolumeDetect(int param)
{
}
public override Vector3 CenterOfMass
{
get { return Vector3.Zero; }
}
public override Vector3 GeometricCenter
{
get { return Vector3.Zero; }
}
public override Vector3 Velocity
{
get { return _velocity; }
set { _velocity = value; }
}
public override float CollisionScore
{
get { return 0f; }
set { }
}
public override bool Kinematic
{
get { return false; }
set { }
}
public override Quaternion Orientation
{
get { return Quaternion.Identity; }
set { }
}
public override Vector3 Acceleration
{
get { return _acceleration; }
}
public void SetAcceleration(Vector3 accel)
{
_acceleration = accel;
}
public override void AddForce(Vector3 force, bool pushforce)
{
}
public override Vector3 Torque
{
get { return Vector3.Zero; }
set { return; }
}
public override void AddAngularForce(Vector3 force, bool pushforce)
{
}
public override void link(PhysicsActor obj)
{
}
public override void delink()
{
}
public override void LockAngularMotion(Vector3 axis)
{
}
public override void SetMomentum(Vector3 momentum)
{
}
public void Move(float timeStep)
{
Vec3 vec = new Vec3();
vec.X = _velocity.X*timeStep;
vec.Y = _velocity.Y*timeStep;
if (flying)
{
vec.Z = (_velocity.Z)*timeStep;
}
else
{
gravityAccel += -9.8f;
vec.Z = (gravityAccel + _velocity.Z)*timeStep;
}
int res = _character.Move(vec);
if (res == 1)
{
gravityAccel = 0;
}
}
public override PrimitiveBaseShape Shape
{
set { return; }
}
public void UpdatePosition()
{
Vec3 vec = _character.Position;
_position.X = vec.X;
_position.Y = vec.Y;
_position.Z = vec.Z;
}
public override void CrossingFailure()
{
}
public override Vector3 PIDTarget { set { return; } }
public override bool PIDActive { set { return; } }
public override float PIDTau { set { return; } }
public override float PIDHoverHeight { set { return; } }
public override bool PIDHoverActive { set { return; } }
public override PIDHoverType PIDHoverType { set { return; } }
public override float PIDHoverTau { set { return; } }
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{
}
public override void UnSubscribeEvents()
{
}
public override bool SubscribedEvents()
{
return false;
}
}
}

View File

@ -1,861 +0,0 @@
/*/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Physics.Manager;
using PhysXWrapper;
using Quaternion=OpenMetaverse.Quaternion;
using System.Reflection;
using log4net;
using OpenMetaverse;
namespace OpenSim.Region.Physics.PhysXPlugin
{
/// <summary>
/// Will be the PhysX plugin but for now will be a very basic physics engine
/// </summary>
public class PhysXPlugin : IPhysicsPlugin
{
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private PhysXScene _mScene;
public PhysXPlugin()
{
}
public bool Init()
{
return true;
}
public PhysicsScene GetScene(string sceneIdentifier)
{
if (_mScene == null)
{
_mScene = new PhysXScene(sceneIdentifier);
}
return (_mScene);
}
public string GetName()
{
return ("RealPhysX");
}
public void Dispose()
{
}
}
public class PhysXScene : PhysicsScene
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private List<PhysXCharacter> _characters = new List<PhysXCharacter>();
private List<PhysXPrim> _prims = new List<PhysXPrim>();
private float[] _heightMap = null;
private NxPhysicsSDK mySdk;
private NxScene scene;
// protected internal string sceneIdentifier;
public PhysXScene(string _sceneIdentifier)
{
//sceneIdentifier = _sceneIdentifier;
mySdk = NxPhysicsSDK.CreateSDK();
m_log.Info("Sdk created - now creating scene");
scene = mySdk.CreateScene();
}
public override void Initialise(IMesher meshmerizer, IConfigSource config)
{
// Does nothing right now
}
public override void Dispose()
{
}
public override void SetWaterLevel(float baseheight)
{
}
public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
{
Vec3 pos = new Vec3();
pos.X = position.X;
pos.Y = position.Y;
pos.Z = position.Z;
PhysXCharacter act = new PhysXCharacter(scene.AddCharacter(pos));
act.Flying = isFlying;
act.Position = position;
_characters.Add(act);
return act;
}
public override void RemovePrim(PhysicsActor prim)
{
}
public override void RemoveAvatar(PhysicsActor actor)
{
}
private PhysicsActor AddPrim(Vector3 position, Vector3 size, Quaternion rotation)
{
Vec3 pos = new Vec3();
pos.X = position.X;
pos.Y = position.Y;
pos.Z = position.Z;
Vec3 siz = new Vec3();
siz.X = size.X;
siz.Y = size.Y;
siz.Z = size.Z;
PhysXPrim act = new PhysXPrim(scene.AddNewBox(pos, siz));
_prims.Add(act);
return act;
}
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
Vector3 size, Quaternion rotation) //To be removed
{
return AddPrimShape(primName, pbs, position, size, rotation, false);
}
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
Vector3 size, Quaternion rotation, bool isPhysical)
{
return AddPrim(position, size, rotation);
}
public override void AddPhysicsActorTaint(PhysicsActor prim)
{
}
public override float Simulate(float timeStep)
{
float fps = 0f;
try
{
foreach (PhysXCharacter actor in _characters)
{
actor.Move(timeStep);
}
scene.Simulate(timeStep);
scene.FetchResults();
scene.UpdateControllers();
foreach (PhysXCharacter actor in _characters)
{
actor.UpdatePosition();
}
}
catch (Exception e)
{
m_log.Error(e.Message);
}
return fps;
}
public override void GetResults()
{
}
public override bool IsThreaded
{
get { return (false); // for now we won't be multithreaded
}
}
public override void SetTerrain(float[] heightMap)
{
if (_heightMap != null)
{
m_log.Debug("PhysX - deleting old terrain");
scene.DeleteTerrain();
}
_heightMap = heightMap;
scene.AddTerrain(heightMap);
}
public override void DeleteTerrain()
{
scene.DeleteTerrain();
}
public override Dictionary<uint, float> GetTopColliders()
{
Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
return returncolliders;
}
}
public class PhysXCharacter : PhysicsActor
{
private Vector3 _position;
private Vector3 _velocity;
private Vector3 m_rotationalVelocity = Vector3.Zero;
private Vector3 _acceleration;
private NxCharacter _character;
private bool flying;
private bool iscolliding = false;
private float gravityAccel;
public PhysXCharacter(NxCharacter character)
{
_character = character;
}
public override int PhysicsActorType
{
get { return (int) ActorTypes.Agent; }
set { return; }
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public override uint LocalID
{
set { return; }
}
public override bool Grabbed
{
set { return; }
}
public override bool Selected
{
set { return; }
}
public override float Buoyancy
{
get { return 0f; }
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool IsPhysical
{
get { return false; }
set { return; }
}
public override bool ThrottleUpdates
{
get { return false; }
set { return; }
}
public override bool Flying
{
get { return flying; }
set { flying = value; }
}
public override bool IsColliding
{
get { return iscolliding; }
set { iscolliding = value; }
}
public override bool CollidingGround
{
get { return false; }
set { return; }
}
public override bool CollidingObj
{
get { return false; }
set { return; }
}
public override Vector3 RotationalVelocity
{
get { return m_rotationalVelocity; }
set { m_rotationalVelocity = value; }
}
public override bool Stopped
{
get { return false; }
}
public override Vector3 Position
{
get { return _position; }
set
{
_position = value;
Vec3 ps = new Vec3();
ps.X = value.X;
ps.Y = value.Y;
ps.Z = value.Z;
_character.Position = ps;
}
}
public override Vector3 Size
{
get { return Vector3.Zero; }
set { }
}
public override float Mass
{
get { return 0f; }
}
public override Vector3 Force
{
get { return Vector3.Zero; }
set { return; }
}
public override int VehicleType
{
get { return 0; }
set { return; }
}
public override void VehicleFloatParam(int param, float value)
{
}
public override void VehicleVectorParam(int param, Vector3 value)
{
}
public override void VehicleRotationParam(int param, Quaternion rotation)
{
}
public override void VehicleFlagsSet(int flags)
{
}
public override void VehicleFlagsRemove(int flags)
{
}
public override void SetVolumeDetect(int param)
{
}
public override Vector3 CenterOfMass
{
get { return Vector3.Zero; }
}
public override Vector3 GeometricCenter
{
get { return Vector3.Zero; }
}
public override Vector3 Velocity
{
get { return _velocity; }
set { _velocity = value; }
}
public override float CollisionScore
{
get { return 0f; }
set { }
}
public override bool Kinematic
{
get { return false; }
set { }
}
public override Quaternion Orientation
{
get { return Quaternion.Identity; }
set { }
}
public override Vector3 Acceleration
{
get { return _acceleration; }
}
public void SetAcceleration(Vector3 accel)
{
_acceleration = accel;
}
public override void AddForce(Vector3 force, bool pushforce)
{
}
public override Vector3 Torque
{
get { return Vector3.Zero; }
set { return; }
}
public override void AddAngularForce(Vector3 force, bool pushforce)
{
}
public override void link(PhysicsActor obj)
{
}
public override void delink()
{
}
public override void LockAngularMotion(Vector3 axis)
{
}
public override void SetMomentum(Vector3 momentum)
{
}
public void Move(float timeStep)
{
Vec3 vec = new Vec3();
vec.X = _velocity.X*timeStep;
vec.Y = _velocity.Y*timeStep;
if (flying)
{
vec.Z = (_velocity.Z)*timeStep;
}
else
{
gravityAccel += -9.8f;
vec.Z = (gravityAccel + _velocity.Z)*timeStep;
}
int res = _character.Move(vec);
if (res == 1)
{
gravityAccel = 0;
}
}
public override PrimitiveBaseShape Shape
{
set { return; }
}
public void UpdatePosition()
{
Vec3 vec = _character.Position;
_position.X = vec.X;
_position.Y = vec.Y;
_position.Z = vec.Z;
}
public override void CrossingFailure()
{
}
public override Vector3 PIDTarget { set { return; } }
public override bool PIDActive { set { return; } }
public override float PIDTau { set { return; } }
public override float PIDHoverHeight { set { return; } }
public override bool PIDHoverActive { set { return; } }
public override PIDHoverType PIDHoverType { set { return; } }
public override float PIDHoverTau { set { return; } }
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{
}
public override void UnSubscribeEvents()
{
}
public override bool SubscribedEvents()
{
return false;
}
}
public class PhysXPrim : PhysicsActor
{
private Vector3 _velocity;
private Vector3 _acceleration;
private Vector3 m_rotationalVelocity;
private NxActor _prim;
public PhysXPrim(NxActor prim)
{
_velocity = Vector3.Zero;
_acceleration = Vector3.Zero;
_prim = prim;
}
public override int PhysicsActorType
{
get { return (int) ActorTypes.Prim; }
set { return; }
}
public override bool IsPhysical
{
get { return false; }
set { return; }
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public override uint LocalID
{
set { return; }
}
public override bool Grabbed
{
set { return; }
}
public override bool Selected
{
set { return; }
}
public override float Buoyancy
{
get { return 0f; }
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool ThrottleUpdates
{
get { return false; }
set { return; }
}
public override Vector3 RotationalVelocity
{
get { return m_rotationalVelocity; }
set { m_rotationalVelocity = value; }
}
public override bool Flying
{
get { return false; //no flying prims for you
}
set { }
}
public override bool IsColliding
{
get { return false; }
set { }
}
public override bool CollidingGround
{
get { return false; }
set { return; }
}
public override bool CollidingObj
{
get { return false; }
set { return; }
}
public override bool Stopped
{
get { return false; }
}
public override Vector3 Position
{
get
{
Vector3 pos = Vector3.Zero;
Vec3 vec = _prim.Position;
pos.X = vec.X;
pos.Y = vec.Y;
pos.Z = vec.Z;
return pos;
}
set
{
Vector3 vec = value;
Vec3 pos = new Vec3();
pos.X = vec.X;
pos.Y = vec.Y;
pos.Z = vec.Z;
_prim.Position = pos;
}
}
public override PrimitiveBaseShape Shape
{
set { return; }
}
public override Vector3 Velocity
{
get { return _velocity; }
set { _velocity = value; }
}
public override Vector3 Torque
{
get { return Vector3.Zero; }
set { return; }
}
public override float CollisionScore
{
get { return 0f; }
set { }
}
public override bool Kinematic
{
get { return _prim.Kinematic; }
set { _prim.Kinematic = value; }
}
public override Quaternion Orientation
{
get
{
Quaternion res;
PhysXWrapper.Quaternion quat = _prim.GetOrientation();
res.W = quat.W;
res.X = quat.X;
res.Y = quat.Y;
res.Z = quat.Z;
return res;
}
set { }
}
public override Vector3 Acceleration
{
get { return _acceleration; }
}
public void SetAcceleration(Vector3 accel)
{
_acceleration = accel;
}
public override void AddForce(Vector3 force, bool pushforce)
{
}
public override void AddAngularForce(Vector3 force, bool pushforce)
{
}
public override void SetMomentum(Vector3 momentum)
{
}
public override Vector3 Size
{
get { return Vector3.Zero; }
set { }
}
public override void link(PhysicsActor obj)
{
}
public override void delink()
{
}
public override void LockAngularMotion(Vector3 axis)
{
}
public override float Mass
{
get { return 0f; }
}
public override Vector3 Force
{
get { return Vector3.Zero; }
set { return; }
}
public override int VehicleType
{
get { return 0; }
set { return; }
}
public override void VehicleFloatParam(int param, float value)
{
}
public override void VehicleVectorParam(int param, Vector3 value)
{
}
public override void VehicleRotationParam(int param, Quaternion rotation)
{
}
public override void VehicleFlagsSet(int flags)
{
}
public override void VehicleFlagsRemove(int flags)
{
}
public override void SetVolumeDetect(int param)
{
}
public override Vector3 CenterOfMass
{
get { return Vector3.Zero; }
}
public override Vector3 GeometricCenter
{
get { return Vector3.Zero; }
}
public override void CrossingFailure()
{
}
public override Vector3 PIDTarget { set { return; } }
public override bool PIDActive { set { return; } }
public override float PIDTau { set { return; } }
public override float PIDHoverHeight { set { return; } }
public override bool PIDHoverActive { set { return; } }
public override PIDHoverType PIDHoverType { set { return; } }
public override float PIDHoverTau { set { return; } }
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{
}
public override void UnSubscribeEvents()
{
}
public override bool SubscribedEvents()
{
return false;
}
}
}

View File

@ -0,0 +1,349 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Physics.Manager;
using PhysXWrapper;
using Quaternion=OpenMetaverse.Quaternion;
using System.Reflection;
using log4net;
using OpenMetaverse;
namespace OpenSim.Region.Physics.PhysXPlugin
{
public class PhysXPrim : PhysicsActor
{
private Vector3 _velocity;
private Vector3 _acceleration;
private Vector3 m_rotationalVelocity;
private NxActor _prim;
public PhysXPrim(NxActor prim)
{
_velocity = Vector3.Zero;
_acceleration = Vector3.Zero;
_prim = prim;
}
public override int PhysicsActorType
{
get { return (int) ActorTypes.Prim; }
set { return; }
}
public override bool IsPhysical
{
get { return false; }
set { return; }
}
public override bool SetAlwaysRun
{
get { return false; }
set { return; }
}
public override uint LocalID
{
set { return; }
}
public override bool Grabbed
{
set { return; }
}
public override bool Selected
{
set { return; }
}
public override float Buoyancy
{
get { return 0f; }
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool ThrottleUpdates
{
get { return false; }
set { return; }
}
public override Vector3 RotationalVelocity
{
get { return m_rotationalVelocity; }
set { m_rotationalVelocity = value; }
}
public override bool Flying
{
get { return false; //no flying prims for you
}
set { }
}
public override bool IsColliding
{
get { return false; }
set { }
}
public override bool CollidingGround
{
get { return false; }
set { return; }
}
public override bool CollidingObj
{
get { return false; }
set { return; }
}
public override bool Stopped
{
get { return false; }
}
public override Vector3 Position
{
get
{
Vector3 pos = Vector3.Zero;
Vec3 vec = _prim.Position;
pos.X = vec.X;
pos.Y = vec.Y;
pos.Z = vec.Z;
return pos;
}
set
{
Vector3 vec = value;
Vec3 pos = new Vec3();
pos.X = vec.X;
pos.Y = vec.Y;
pos.Z = vec.Z;
_prim.Position = pos;
}
}
public override PrimitiveBaseShape Shape
{
set { return; }
}
public override Vector3 Velocity
{
get { return _velocity; }
set { _velocity = value; }
}
public override Vector3 Torque
{
get { return Vector3.Zero; }
set { return; }
}
public override float CollisionScore
{
get { return 0f; }
set { }
}
public override bool Kinematic
{
get { return _prim.Kinematic; }
set { _prim.Kinematic = value; }
}
public override Quaternion Orientation
{
get
{
Quaternion res;
PhysXWrapper.Quaternion quat = _prim.GetOrientation();
res.W = quat.W;
res.X = quat.X;
res.Y = quat.Y;
res.Z = quat.Z;
return res;
}
set { }
}
public override Vector3 Acceleration
{
get { return _acceleration; }
}
public void SetAcceleration(Vector3 accel)
{
_acceleration = accel;
}
public override void AddForce(Vector3 force, bool pushforce)
{
}
public override void AddAngularForce(Vector3 force, bool pushforce)
{
}
public override void SetMomentum(Vector3 momentum)
{
}
public override Vector3 Size
{
get { return Vector3.Zero; }
set { }
}
public override void link(PhysicsActor obj)
{
}
public override void delink()
{
}
public override void LockAngularMotion(Vector3 axis)
{
}
public override float Mass
{
get { return 0f; }
}
public override Vector3 Force
{
get { return Vector3.Zero; }
set { return; }
}
public override int VehicleType
{
get { return 0; }
set { return; }
}
public override void VehicleFloatParam(int param, float value)
{
}
public override void VehicleVectorParam(int param, Vector3 value)
{
}
public override void VehicleRotationParam(int param, Quaternion rotation)
{
}
public override void VehicleFlags(int param, bool remove) { }
public override void VehicleFlagsSet(int param) { }
public override void VehicleFlagsRemove(int param) { }
public override void SetVolumeDetect(int param)
{
}
public override Vector3 CenterOfMass
{
get { return Vector3.Zero; }
}
public override Vector3 GeometricCenter
{
get { return Vector3.Zero; }
}
public override void CrossingFailure()
{
}
public override Vector3 PIDTarget { set { return; } }
public override bool PIDActive { set { return; } }
public override float PIDTau { set { return; } }
public override float PIDHoverHeight { set { return; } }
public override bool PIDHoverActive { set { return; } }
public override PIDHoverType PIDHoverType { set { return; } }
public override float PIDHoverTau { set { return; } }
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{
}
public override void UnSubscribeEvents()
{
}
public override bool SubscribedEvents()
{
return false;
}
}
}

View File

@ -0,0 +1,183 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Physics.Manager;
using PhysXWrapper;
using Quaternion=OpenMetaverse.Quaternion;
using System.Reflection;
using log4net;
using OpenMetaverse;
namespace OpenSim.Region.Physics.PhysXPlugin
{
public class PhysXScene : PhysicsScene
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private List<PhysXCharacter> _characters = new List<PhysXCharacter>();
private List<PhysXPrim> _prims = new List<PhysXPrim>();
private float[] _heightMap = null;
private NxPhysicsSDK mySdk;
private NxScene scene;
// protected internal string sceneIdentifier;
public PhysXScene(string _sceneIdentifier)
{
//sceneIdentifier = _sceneIdentifier;
mySdk = NxPhysicsSDK.CreateSDK();
m_log.Info("Sdk created - now creating scene");
scene = mySdk.CreateScene();
}
public override void Initialise(IMesher meshmerizer, IConfigSource config)
{
// Does nothing right now
}
public override void Dispose()
{
}
public override void SetWaterLevel(float baseheight)
{
}
public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
{
Vec3 pos = new Vec3();
pos.X = position.X;
pos.Y = position.Y;
pos.Z = position.Z;
PhysXCharacter act = new PhysXCharacter(scene.AddCharacter(pos));
act.Flying = isFlying;
act.Position = position;
_characters.Add(act);
return act;
}
public override void RemovePrim(PhysicsActor prim)
{
}
public override void RemoveAvatar(PhysicsActor actor)
{
}
private PhysicsActor AddPrim(Vector3 position, Vector3 size, Quaternion rotation)
{
Vec3 pos = new Vec3();
pos.X = position.X;
pos.Y = position.Y;
pos.Z = position.Z;
Vec3 siz = new Vec3();
siz.X = size.X;
siz.Y = size.Y;
siz.Z = size.Z;
PhysXPrim act = new PhysXPrim(scene.AddNewBox(pos, siz));
_prims.Add(act);
return act;
}
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
Vector3 size, Quaternion rotation) //To be removed
{
return AddPrimShape(primName, pbs, position, size, rotation, false);
}
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
Vector3 size, Quaternion rotation, bool isPhysical)
{
return AddPrim(position, size, rotation);
}
public override void AddPhysicsActorTaint(PhysicsActor prim)
{
}
public override float Simulate(float timeStep)
{
float fps = 0f;
try
{
foreach (PhysXCharacter actor in _characters)
{
actor.Move(timeStep);
}
scene.Simulate(timeStep);
scene.FetchResults();
scene.UpdateControllers();
foreach (PhysXCharacter actor in _characters)
{
actor.UpdatePosition();
}
}
catch (Exception e)
{
m_log.Error(e.Message);
}
return fps;
}
public override void GetResults()
{
}
public override bool IsThreaded
{
// for now we won't be multithreaded
get { return (false); }
}
public override void SetTerrain(float[] heightMap)
{
if (_heightMap != null)
{
m_log.Debug("PhysX - deleting old terrain");
scene.DeleteTerrain();
}
_heightMap = heightMap;
scene.AddTerrain(heightMap);
}
public override void DeleteTerrain()
{
scene.DeleteTerrain();
}
public override Dictionary<uint, float> GetTopColliders()
{
Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
return returncolliders;
}
}
}

View File

@ -1252,7 +1252,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB)
{
NotImplemented("llSetStatus - STATUS_BLOCK_GRAB");
if (value != 0)
m_host.SetBlockGrab(true);
else
m_host.SetBlockGrab(false);
}
if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE)
@ -1265,12 +1268,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if ((status & ScriptBaseClass.STATUS_RETURN_AT_EDGE) == ScriptBaseClass.STATUS_RETURN_AT_EDGE)
{
NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE");
if (value != 0)
m_host.SetReturnAtEdge(true);
else
m_host.SetReturnAtEdge(false);
}
if ((status & ScriptBaseClass.STATUS_SANDBOX) == ScriptBaseClass.STATUS_SANDBOX)
{
NotImplemented("llSetStatus - STATUS_SANDBOX");
if (value != 0)
m_host.SetStatusSandbox(true);
else
m_host.SetStatusSandbox(false);
}
if (statusrotationaxis != 0)
@ -1307,8 +1316,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 0;
case ScriptBaseClass.STATUS_BLOCK_GRAB:
NotImplemented("llGetStatus - STATUS_BLOCK_GRAB");
return 0;
if (m_host.GetBlockGrab())
return 1;
else
return 0;
case ScriptBaseClass.STATUS_DIE_AT_EDGE:
if (m_host.GetDieAtEdge())
@ -1317,24 +1328,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 0;
case ScriptBaseClass.STATUS_RETURN_AT_EDGE:
NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE");
return 0;
if (m_host.GetReturnAtEdge())
return 1;
else
return 0;
case ScriptBaseClass.STATUS_ROTATE_X:
NotImplemented("llGetStatus - STATUS_ROTATE_X");
return 0;
if (m_host.GetAxisRotation(2) == 2)
return 1;
else
return 0;
case ScriptBaseClass.STATUS_ROTATE_Y:
NotImplemented("llGetStatus - STATUS_ROTATE_Y");
return 0;
if (m_host.GetAxisRotation(4) == 4)
return 1;
else
return 0;
case ScriptBaseClass.STATUS_ROTATE_Z:
NotImplemented("llGetStatus - STATUS_ROTATE_Z");
return 0;
if (m_host.GetAxisRotation(8) == 8)
return 1;
else
return 0;
case ScriptBaseClass.STATUS_SANDBOX:
NotImplemented("llGetStatus - STATUS_SANDBOX");
return 0;
if (m_host.GetStatusSandbox())
return 1;
else
return 0;
}
return 0;
}
@ -2346,7 +2367,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
// send the sound, once, to all clients in range
m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0);
m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, false, false);
}
// Xantor 20080528 we should do this differently.
@ -2376,42 +2397,98 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llLoopSoundMaster(string sound, double volume)
{
m_host.AddScriptLPS(1);
NotImplemented("llLoopSoundMaster");
m_host.ParentGroup.LoopSoundMasterPrim = m_host;
lock (m_host.ParentGroup.LoopSoundSlavePrims)
{
foreach (SceneObjectPart prim in m_host.ParentGroup.LoopSoundSlavePrims)
{
if (prim.Sound != UUID.Zero)
llStopSound();
prim.Sound = KeyOrName(sound);
prim.SoundGain = volume;
prim.SoundFlags = 1; // looping
prim.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable?
prim.ScheduleFullUpdate();
prim.SendFullUpdateToAllClients();
}
}
if (m_host.Sound != UUID.Zero)
llStopSound();
m_host.Sound = KeyOrName(sound);
m_host.SoundGain = volume;
m_host.SoundFlags = 1; // looping
m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable?
m_host.ScheduleFullUpdate();
m_host.SendFullUpdateToAllClients();
}
public void llLoopSoundSlave(string sound, double volume)
{
m_host.AddScriptLPS(1);
NotImplemented("llLoopSoundSlave");
lock (m_host.ParentGroup.LoopSoundSlavePrims)
{
m_host.ParentGroup.LoopSoundSlavePrims.Add(m_host);
}
}
public void llPlaySoundSlave(string sound, double volume)
{
m_host.AddScriptLPS(1);
NotImplemented("llPlaySoundSlave");
// send the sound, once, to all clients in range
m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, true, false);
}
public void llTriggerSound(string sound, double volume)
{
m_host.AddScriptLPS(1);
// send the sound, once, to all clients in range
m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0);
m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0, 0, false, false);
}
// Xantor 20080528: Clear prim data of sound instead
public void llStopSound()
{
m_host.AddScriptLPS(1);
m_host.Sound = UUID.Zero;
m_host.SoundGain = 0;
m_host.SoundFlags = 0;
m_host.SoundRadius = 0;
m_host.ScheduleFullUpdate();
m_host.SendFullUpdateToAllClients();
// m_host.SendSound(UUID.Zero.ToString(), 1.0, false, 2);
if (m_host.ParentGroup.LoopSoundSlavePrims.Contains(m_host))
{
if (m_host.ParentGroup.LoopSoundMasterPrim == m_host)
{
foreach (SceneObjectPart part in m_host.ParentGroup.LoopSoundSlavePrims)
{
part.Sound = UUID.Zero;
part.SoundGain = 0;
part.SoundFlags = 0;
part.SoundRadius = 0;
part.ScheduleFullUpdate();
part.SendFullUpdateToAllClients();
}
m_host.ParentGroup.LoopSoundMasterPrim = null;
m_host.ParentGroup.LoopSoundSlavePrims.Clear();
}
else
{
m_host.Sound = UUID.Zero;
m_host.SoundGain = 0;
m_host.SoundFlags = 0;
m_host.SoundRadius = 0;
m_host.ScheduleFullUpdate();
m_host.SendFullUpdateToAllClients();
}
}
else
{
m_host.Sound = UUID.Zero;
m_host.SoundGain = 0;
m_host.SoundFlags = 0;
m_host.SoundRadius = 0;
m_host.ScheduleFullUpdate();
m_host.SendFullUpdateToAllClients();
}
}
public void llPreloadSound(string sound)
@ -2803,8 +2880,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llLookAt(LSL_Vector target, double strength, double damping)
{
// partial implementation, rotates objects correctly but does not apply strength or damping attributes
m_host.AddScriptLPS(1);
// Determine where we are looking from
LSL_Vector from = llGetPos();
@ -2824,9 +2899,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// the angles of rotation in radians into rotation value
LSL_Types.Quaternion rot = llEuler2Rot(angle);
Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
m_host.startLookAt(rotation, (float)damping, (float)strength);
// Orient the object to the angle calculated
llSetRot(rot);
//llSetRot(rot);
}
public void llRotLookAt(LSL_Rotation target, double strength, double damping)
@ -3329,13 +3405,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llPointAt(LSL_Vector pos)
{
m_host.AddScriptLPS(1);
NotImplemented("llPointAt");
ScenePresence Owner = World.GetScenePresence(m_host.UUID);
LSL_Rotation rot = llEuler2Rot(pos);
Owner.PreviousRotation = Owner.Rotation;
Owner.Rotation = (new Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s));
}
public void llStopPointAt()
{
m_host.AddScriptLPS(1);
NotImplemented("llStopPointAt");
ScenePresence Owner = m_host.ParentGroup.Scene.GetScenePresence(m_host.OwnerID);
Owner.Rotation = Owner.PreviousRotation;
}
public void llTargetOmega(LSL_Vector axis, double spinrate, double gain)
@ -4138,8 +4218,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llCollisionSound(string impact_sound, double impact_volume)
{
m_host.AddScriptLPS(1);
//NotImplemented("llCollisionSound");
// TODO: Parameter check logic required.
UUID soundId = UUID.Zero;
if (!UUID.TryParse(impact_sound, out soundId))
@ -4727,8 +4805,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Vector llGetCenterOfMass()
{
m_host.AddScriptLPS(1);
NotImplemented("llGetCenterOfMass");
return new LSL_Vector();
Vector3 center = m_host.GetGeometricCenter();
return new LSL_Vector(center.X,center.Y,center.Z);
}
public LSL_List llListSort(LSL_List src, int stride, int ascending)
@ -5461,8 +5539,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
flags |= ScriptBaseClass.AGENT_SITTING;
}
//NotImplemented("llGetAgentInfo");
return flags;
}
@ -5522,12 +5598,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
{
m_host.AddScriptLPS(1);
SetTextureAnim(m_host, mode, face, sizex, sizey, start, length, rate);
}
public void llSetLinkTextureAnim(int linknumber, int mode, int face, int sizex, int sizey, double start, double length, double rate)
{
m_host.AddScriptLPS(1);
List<SceneObjectPart> parts = GetLinkParts(linknumber);
foreach (var part in parts)
{
SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate);
}
}
private void SetTextureAnim(SceneObjectPart part, int mode, int face, int sizex, int sizey, double start, double length, double rate)
{
Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation();
pTexAnim.Flags = (Primitive.TextureAnimMode)mode;
//ALL_SIDES
if (face == ScriptBaseClass.ALL_SIDES)
face = 255;
face = 255;
pTexAnim.Face = (uint)face;
pTexAnim.Length = (float)length;
@ -5536,16 +5631,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
pTexAnim.SizeY = (uint)sizey;
pTexAnim.Start = (float)start;
m_host.AddTextureAnimation(pTexAnim);
m_host.SendFullUpdateToAllClients();
m_host.ParentGroup.HasGroupChanged = true;
part.AddTextureAnimation(pTexAnim);
part.SendFullUpdateToAllClients();
part.ParentGroup.HasGroupChanged = true;
}
public void llTriggerSoundLimited(string sound, double volume, LSL_Vector top_north_east,
LSL_Vector bottom_south_west)
{
m_host.AddScriptLPS(1);
NotImplemented("llTriggerSoundLimited");
float radius1 = (float)llVecDist(llGetPos(), top_north_east);
float radius2 = (float)llVecDist(llGetPos(), bottom_south_west);
float radius = Math.Abs(radius1 - radius2);
m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0, radius, false, false);
}
public void llEjectFromLand(string pest)
@ -5932,13 +6030,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return ps;
}
public void llLinkParticleSystem(int linknumber, LSL_List rules)
{
m_host.AddScriptLPS(1);
List<SceneObjectPart> parts = GetLinkParts(linknumber);
foreach (var part in parts)
{
SetParticleSystem(part, rules);
}
}
public void llParticleSystem(LSL_List rules)
{
m_host.AddScriptLPS(1);
SetParticleSystem(m_host, rules);
}
private void SetParticleSystem(SceneObjectPart part, LSL_List rules) {
if (rules.Length == 0)
{
m_host.RemoveParticleSystem();
m_host.ParentGroup.HasGroupChanged = true;
part.RemoveParticleSystem();
part.ParentGroup.HasGroupChanged = true;
}
else
{
@ -6049,7 +6165,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
else
{
prules.Target = m_host.UUID;
prules.Target = part.UUID;
}
break;
@ -6075,16 +6191,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
prules.CRC = 1;
m_host.AddNewParticleSystem(prules);
m_host.ParentGroup.HasGroupChanged = true;
part.AddNewParticleSystem(prules);
part.ParentGroup.HasGroupChanged = true;
}
m_host.SendFullUpdateToAllClients();
part.SendFullUpdateToAllClients();
}
public void llGroundRepel(double height, int water, double tau)
{
m_host.AddScriptLPS(1);
NotImplemented("llGroundRepel");
if (m_host.PhysActor != null)
{
float ground = (float)llGround(new LSL_Types.Vector3(0, 0, 0));
float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0));
PIDHoverType hoverType = PIDHoverType.Ground;
if (water != 0)
{
hoverType = PIDHoverType.GroundAndWater;
if (ground < waterLevel)
height += waterLevel;
else
height += ground;
}
else
{
height += ground;
}
m_host.SetHoverHeight((float)height, hoverType, (float)tau);
}
}
protected UUID GetTaskInventoryItem(string name)
@ -6219,7 +6354,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
if (!m_host.ParentGroup.IsDeleted)
{
m_host.ParentGroup.RootPart.SetVehicleFlags(flags);
m_host.ParentGroup.RootPart.SetVehicleFlags(flags, false);
}
}
}
@ -6231,7 +6366,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
if (!m_host.ParentGroup.IsDeleted)
{
m_host.ParentGroup.RootPart.RemoveVehicleFlags(flags);
m_host.ParentGroup.RootPart.SetVehicleFlags(flags, true);
}
}
}
@ -6868,6 +7003,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
SetPrimParams(part, rules);
}
public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
{
llSetLinkPrimitiveParams(linknumber, rules);
}
protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
{
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
@ -7226,6 +7366,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
face = rules.GetLSLIntegerItem(idx++);
int style = rules.GetLSLIntegerItem(idx++);
SetTexGen(part, face, style);
break;
case (int)ScriptBaseClass.PRIM_TEXT:
if (remain < 3)
return;
string primText = rules.GetLSLStringItem(idx++);
LSL_Vector primTextColor = rules.GetVector3Item(idx++);
LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
break;
}
}
@ -7271,7 +7423,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llRemoteDataSetRegion()
{
m_host.AddScriptLPS(1);
NotImplemented("llRemoteDataSetRegion");
Deprecated("llRemoteDataSetRegion");
}
public LSL_Float llLog10(double val)
@ -7470,6 +7622,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return GetLinkPrimitiveParams(m_host, rules);
}
public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules)
{
m_host.AddScriptLPS(1);
List<SceneObjectPart> parts = GetLinkParts(linknumber);
LSL_List res = new LSL_List();
foreach (var part in parts)
{
LSL_List partRes = GetLinkPrimitiveParams(part, rules);
res += partRes;
}
return res;
}
public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules)
{
LSL_List res = new LSL_List();
@ -7853,6 +8022,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
res.Add(new LSL_Float(primglow));
}
break;
case (int)ScriptBaseClass.PRIM_TEXT:
Color4 textColor = part.GetTextColor();
res.Add(part.Text);
res.Add(new LSL_Vector(textColor.R,
textColor.G,
textColor.B));
res.Add(new LSL_Float(textColor.A));
break;
}
}
return res;
@ -8409,7 +8586,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetInventoryPermMask(string item, int mask, int value)
{
m_host.AddScriptLPS(1);
NotImplemented("llSetInventoryPermMask");
if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false))
{
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
{
lock (m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if (inv.Value.Name == item)
{
switch (mask)
{
case 0:
inv.Value.BasePermissions = (uint)value;
break;
case 1:
inv.Value.CurrentPermissions = (uint)value;
break;
case 2:
inv.Value.GroupPermissions = (uint)value;
break;
case 3:
inv.Value.EveryonePermissions = (uint)value;
break;
case 4:
inv.Value.NextPermissions = (uint)value;
break;
}
}
}
}
}
}
}
public LSL_String llGetInventoryCreator(string item)
@ -8843,6 +9052,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// we send to all
landData.MediaID = new UUID(texture);
landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0;
landData.MediaSize[0] = width;
landData.MediaSize[1] = height;
landData.MediaType = mediaType;
// do that one last, it will cause a ParcelPropertiesUpdate
landObject.SetMediaUrl(url);
@ -8902,11 +9114,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
LSL_List list = new LSL_List();
//TO DO: make the implementation for the missing commands
//PARCEL_MEDIA_COMMAND_TEXTURE key uuid Use this to get or set the parcel's media texture.
//PARCEL_MEDIA_COMMAND_URL string url Used to get or set the parcel's media url.
//PARCEL_MEDIA_COMMAND_TYPE string mime_type Use this to get or set the parcel media MIME type (e.g. "text/html"). (1.19.1 RC0 or later)
//PARCEL_MEDIA_COMMAND_SIZE integer x, integer y Use this to get or set the parcel media pixel resolution. (1.19.1 RC0 or later)
//PARCEL_MEDIA_COMMAND_DESC string desc Use this to get or set the parcel media description. (1.19.1 RC0 or later)
//PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later)
for (int i = 0; i < aList.Data.Length; i++)
{
@ -8924,6 +9131,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case ParcelMediaCommandEnum.Texture:
list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaID.ToString()));
break;
case ParcelMediaCommandEnum.Type:
list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType));
break;
case ParcelMediaCommandEnum.Size:
list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[0]));
list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[1]));
break;
default:
ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url;
NotImplemented("llParcelMediaQuery parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType() , aList.Data[i].ToString()).ToString());

View File

@ -135,6 +135,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Key llGetLinkKey(int linknum);
LSL_String llGetLinkName(int linknum);
LSL_Integer llGetLinkNumber();
LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules);
LSL_Integer llGetListEntryType(LSL_List src, int index);
LSL_Integer llGetListLength(LSL_List src);
LSL_Vector llGetLocalPos();
@ -206,6 +207,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void llInstantMessage(string user, string message);
LSL_String llIntegerToBase64(int number);
LSL_String llKey2Name(string id);
void llLinkParticleSystem(int linknum, LSL_List rules);
LSL_String llList2CSV(LSL_List src);
LSL_Float llList2Float(LSL_List src, int index);
LSL_Integer llList2Integer(LSL_List src, int index);
@ -322,6 +324,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void llSetLinkColor(int linknumber, LSL_Vector color, int face);
void llSetLinkPrimitiveParams(int linknumber, LSL_List rules);
void llSetLinkTexture(int linknumber, string texture, int face);
void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate);
void llSetLocalRot(LSL_Rotation rot);
void llSetObjectDesc(string desc);
void llSetObjectName(string name);
@ -330,6 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void llSetPayPrice(int price, LSL_List quick_pay_buttons);
void llSetPos(LSL_Vector pos);
void llSetPrimitiveParams(LSL_List rules);
void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules);
void llSetPrimURL(string url);
void llSetRemoteScriptAccessPin(int pin);
void llSetRot(LSL_Rotation rot);

View File

@ -160,6 +160,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int VEHICLE_BANKING_MIX = 39;
public const int VEHICLE_BANKING_TIMESCALE = 40;
public const int VEHICLE_REFERENCE_FRAME = 44;
public const int VEHICLE_RANGE_BLOCK = 45;
public const int VEHICLE_ROLL_FRAME = 46;
public const int VEHICLE_FLAG_NO_DEFLECTION_UP = 1;
public const int VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2;
public const int VEHICLE_FLAG_HOVER_WATER_ONLY = 4;
@ -170,6 +172,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int VEHICLE_FLAG_MOUSELOOK_STEER = 128;
public const int VEHICLE_FLAG_MOUSELOOK_BANK = 256;
public const int VEHICLE_FLAG_CAMERA_DECOUPLED = 512;
public const int VEHICLE_FLAG_NO_X = 1024;
public const int VEHICLE_FLAG_NO_Y = 2048;
public const int VEHICLE_FLAG_NO_Z = 4096;
public const int VEHICLE_FLAG_LOCK_HOVER_HEIGHT = 8192;
public const int VEHICLE_FLAG_NO_DEFLECTION = 16392;
public const int VEHICLE_FLAG_LOCK_ROTATION = 32784;
public const int INVENTORY_ALL = -1;
public const int INVENTORY_NONE = -1;
@ -305,6 +313,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake
public const int PRIM_POINT_LIGHT = 23; // Huh?
public const int PRIM_GLOW = 25;
public const int PRIM_TEXT = 26;
public const int PRIM_TEXGEN_DEFAULT = 0;
public const int PRIM_TEXGEN_PLANAR = 1;

View File

@ -674,6 +674,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetPrimitiveParams(rules);
}
public LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules)
{
return m_LSL_Functions.llGetLinkPrimitiveParams(linknum, rules);
}
public LSL_Integer llGetRegionAgentCount()
{
return m_LSL_Functions.llGetRegionAgentCount();
@ -889,6 +894,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llKey2Name(id);
}
public void llLinkParticleSystem(int linknum, LSL_List rules)
{
m_LSL_Functions.llLinkParticleSystem(linknum, rules);
}
public LSL_String llList2CSV(LSL_List src)
{
return m_LSL_Functions.llList2CSV(src);
@ -1468,6 +1478,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_LSL_Functions.llSetLinkTexture(linknumber, texture, face);
}
public void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate)
{
m_LSL_Functions.llSetLinkTextureAnim(linknum, mode, face, sizex, sizey, start, length, rate);
}
public void llSetLocalRot(LSL_Rotation rot)
{
m_LSL_Functions.llSetLocalRot(rot);
@ -1508,6 +1523,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_LSL_Functions.llSetPrimitiveParams(rules);
}
public void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules)
{
m_LSL_Functions.llSetLinkPrimitiveParamsFast(linknum, rules);
}
public void llSetPrimURL(string url)
{
m_LSL_Functions.llSetPrimURL(url);

View File

@ -44,8 +44,6 @@ namespace OpenSim.Server.Handlers.Asset
{
public class XInventoryInConnector : ServiceConnector
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IInventoryService m_InventoryService;
private string m_ConfigName = "InventoryService";
@ -197,7 +195,7 @@ namespace OpenSim.Server.Handlers.Asset
if (!request.ContainsKey("PRINCIPAL"))
return FailureResult();
if(m_InventoryService.CreateUserInventory(new UUID(request["PRINCIPAL"].ToString())))
if (m_InventoryService.CreateUserInventory(new UUID(request["PRINCIPAL"].ToString())))
result["RESULT"] = "True";
else
result["RESULT"] = "False";

View File

@ -81,12 +81,12 @@ namespace OpenSim.Services.AssetService
}
public AssetBase Get(string id)
{
{
UUID assetID;
if (!UUID.TryParse(id, out assetID))
{
m_log.WarnFormat("[ASSET SERVICE]: Could not parse requested sset id {0}", id);
m_log.WarnFormat("[ASSET SERVICE]: Could not parse requested sset id {0}", id);
return null;
}

View File

@ -93,7 +93,7 @@ namespace OpenSim.Services.Connectors
}
public AssetBase Get(string id)
{
{
string uri = m_ServerURI + "/assets/" + id;
AssetBase asset = null;

View File

@ -206,6 +206,8 @@ namespace OpenSim.Tests.Common.Mock
public event ObjectBuy OnObjectBuy;
public event BuyObjectInventory OnBuyObjectInventory;
public event AgentSit OnUndo;
public event AgentSit OnRedo;
public event LandUndo OnLandUndo;
public event ForceReleaseControls OnForceReleaseControls;

View File

@ -31,26 +31,26 @@
; To run a script every few minutes, set the script filename here
; timer_Script = "filename"
; ##
; ## SYSTEM
; ##
; Sets the method that OpenSim will use to fire asynchronous
; events. Valid values are UnsafeQueueUserWorkItem,
; QueueUserWorkItem, BeginInvoke, SmartThreadPool, and Thread.
; SmartThreadPool is reported to work well on Mono/Linux, but
; SmartThreadPool is reported to work well on Mono/Linux, but
; UnsafeQueueUserWorkItem has been benchmarked with better
; performance on .NET/Windows
async_call_method = SmartThreadPool
; There are several operations on large collections (such as
; the current avatar list) that can be run synchronously or
; in parallel. Running in parallel should increase performance
; on a multi-core system, but will make debugging more
; difficult if something deadlocks or times out
use_async_when_possible = false
; Max threads to allocate on the FireAndForget thread pool
; when running with the SmartThreadPool option above
MaxPoolThreads = 15
@ -103,7 +103,7 @@
; How many prims to send to each avatar in the scene on each Update()
; MaxPrimsPerFrame = 200
; Combine all contiguous regions into one large region
; Order your regions from South to North, West to East in your regions.ini and then set this to true
; Warning! Don't use this with regions that have existing content!, This will likely break them
@ -351,7 +351,7 @@
http_listener_ssl_cert = "" ; Currently unused, but will be used for OSHttpServer
; Hostname to use in llRequestURL/llRequestSecureURL
; if not defined - default machine name is being used
; if not defined - default machine name is being used
; (on Windows this mean NETBIOS name - useably only inside local network)
; ExternalHostNameForLSL=127.0.0.1
; Uncomment below to enable llRemoteData/remote channels
@ -388,11 +388,11 @@
[ClientStack.LindenUDP]
; Set this to true to process incoming packets asynchronously. Networking is
; already separated from packet handling with a queue, so this will only
; affect whether networking internals such as packet decoding and
; affect whether networking internals such as packet decoding and
; acknowledgement accounting are done synchronously or asynchronously
;
;async_packet_handling = false
; The client socket receive buffer size determines how many
; incoming requests we can process; the default on .NET is 8192
; which is about 2 4k-sized UDP datagrams. On mono this is
@ -409,7 +409,7 @@
; net.core.rmem_max=X")
;
;client_socket_rcvbuf_size = 8388608
; Maximum outbound bytes per second for a single scene. This can be used to
; throttle total outbound UDP traffic for a simulator. The default value is
; 0, meaning no throttling at the scene level. The example given here is
@ -417,13 +417,13 @@
;
;scene_throttle_max_bps = 2621440
; Maximum bits per second to send to any single client. This will override
; Maximum bits per second to send to any single client. This will override
; the user's viewer preference settings. The default value is 0, meaning no
; aggregate throttling on clients (only per-category throttling). The
; example given here is 1.5 megabits
;
;client_throttle_max_bps = 196608
; Per-client bytes per second rates for the various throttle categories.
; These are default values that will be overriden by clients
;
@ -435,7 +435,7 @@
;texture_default = 1000
;asset_default = 1000
;state_default = 1000
; Per-client maximum burst rates in bytes per second for the various
; throttle categories. These are default values that will be overriden by
; clients
@ -448,10 +448,10 @@
;texture_limit = 55750
;asset_limit = 27500
;state_limit = 37000
; Configures how ObjectUpdates are aggregated. These numbers
; do not literally mean how many updates will be put in each
; packet that goes over the wire, as packets are
; packet that goes over the wire, as packets are
; automatically split on a 1400 byte boundary. These control
; the balance between responsiveness of interest list updates
; and total throughput. Higher numbers will ensure more full-
@ -612,7 +612,7 @@
; used to control llMove2Target
body_pid_derivative = 35
body_pid_gain = 25
; maximum number of contact points to generate per collision
contacts_per_collision = 80
@ -801,7 +801,7 @@
;;arrival and departure of certain users. For example: admins, bots.
;exclude_list=User 1,User 2,User 3
;[CMS]
;enabled = true
@ -984,7 +984,7 @@
; Stack size per thread created
ThreadStackSize = 262144
; Set this to true (the default) to load each script into a separate
; AppDomain. Setting this to false will load all script assemblies into the
; current AppDomain, which will reduce the per-script overhead at the
@ -1179,25 +1179,25 @@
; Enables the Mini Region Modules Script Engine.
; default is false
Enabled = false
; Runs MRM in a Security Sandbox
; WARNING: DISABLING IS A SECURITY RISK.
Sandboxed = true
; The level sandbox to use, adjust at your OWN RISK.
; Valid values are:
; * FullTrust
; Runs MRM in a Security Sandbox
; WARNING: DISABLING IS A SECURITY RISK.
Sandboxed = true
; The level sandbox to use, adjust at your OWN RISK.
; Valid values are:
; * FullTrust
; * SkipVerification
; * Execution
; * Nothing
; * LocalIntranet
; * Internet
; * Everything
SandboxLevel = "Internet"
SandboxLevel = "Internet"
; Only allow Region Owners to run MRMs
; May represent a security risk if you disable this.
OwnerOnly = true
; Only allow Region Owners to run MRMs
; May represent a security risk if you disable this.
OwnerOnly = true
[Hypergrid]
; Keep it false for now. Making it true requires the use of a special client in order to access inventory
@ -1347,7 +1347,7 @@
[WebStats]
; View region statistics via a web page
; See http://opensimulator.org/wiki/FAQ#Region_Statistics_on_a_Web_Page
; See http://opensimulator.org/wiki/FAQ#Region_Statistics_on_a_Web_Page
; Use a web browser and type in the "Login URI" + "/SStats/"
; For example- http://127.0.0.1:9000/SStats/
; enabled=false
@ -1369,14 +1369,14 @@
[AssetService]
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
AssetLoaderArgs = "assets/AssetSets.xml"
; Disable this to prevent the default asset set from being inserted into the
; asset store each time the region starts
AssetLoaderEnabled = true
[GridService]
;; default standalone, overridable in StandaloneCommon.ini
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The following is the configuration section for the new style services

View File

@ -20,11 +20,10 @@
[InventoryService]
LocalServiceModule = "OpenSim.Services.InventoryService.dll:InventoryService"
[AuthorizationService]
LocalServiceModule = "OpenSim.Services.AuthorizationService.dll:AuthorizationService"
[GridService]
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
Realm = "regions"

View File

@ -533,7 +533,7 @@
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="Ode.NET.dll" />
<Reference name="Ode.NET.dll" />
<Reference name="log4net.dll"/>
<Files>
@ -601,8 +601,6 @@
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Region.Physics.Meshing" path="OpenSim/Region/Physics/Meshing" type="Library">
<Configuration name="Debug">
<Options>
@ -1318,7 +1316,7 @@
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Services.AuthorizationService" path="OpenSim/Services/AuthorizationService" type="Library">
<Configuration name="Debug">
<Options>
@ -1649,7 +1647,7 @@
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="GlynnTucker.Cache.dll"/>
<!-- For scripting in funny languages by default -->
<Reference name="Microsoft.JScript"/>
<Reference name="XMLRPC.dll"/>
@ -1657,8 +1655,8 @@
<Reference name="Nini.dll" />
<Reference name="log4net.dll"/>
<Reference name="DotNetOpenMail.dll"/>
<!-- To allow regions to have mono addins -->
<!-- To allow regions to have mono addins -->
<Reference name="Mono.Addins.dll" />
<Files>
@ -1741,7 +1739,6 @@
<Reference name="log4net.dll"/>
<Reference name="DotNetOpenMail.dll"/>
<Files>
<Match pattern="*.cs" recurse="true">
<Exclude name="Tests" pattern="Tests" />
@ -1750,8 +1747,7 @@
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Region.RegionCombinerModule" path="OpenSim/Region/RegionCombinerModule" type="Library">
<Project frameworkVersion="v3_5" name="OpenSim.Region.RegionCombinerModule" path="OpenSim/Region/RegionCombinerModule" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../../../bin/</OutputPath>
@ -1779,8 +1775,8 @@
<Reference name="OpenSim.Region.CoreModules" />
<Reference name="Nini.dll" />
<Reference name="log4net.dll"/>
<!-- To allow regions to have mono addins -->
<!-- To allow regions to have mono addins -->
<Reference name="Mono.Addins.dll" />
<Files>
@ -1789,9 +1785,6 @@
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Region.Communications.Hypergrid" path="OpenSim/Region/Communications/Hypergrid" type="Library">
<Configuration name="Debug">
<Options>
@ -2304,11 +2297,9 @@
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<!-- Client Stack Modules -->
<!-- Client Stack Modules -->
<Project frameworkVersion="v3_5" name="OpenSim.Client.MXP" path="OpenSim/Client/MXP" type="Library">
<Configuration name="Debug">
<Options>
@ -2357,10 +2348,10 @@
<Reference name="OpenMetaverseTypes.dll"/>
<Reference name="OpenMetaverse.dll"/>
<Reference name="System"/>
<Reference name="System.Drawing"/>
<Reference name="System.Drawing"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
<Reference name="OpenSim.Region.Framework"/>
<Reference name="OpenSim.Framework.Communications"/>
<Reference name="OpenSim.Services.Interfaces"/>
@ -2402,7 +2393,7 @@
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Client.Linden" path="OpenSim/Client/Linden" type="Library">
<Configuration name="Debug">
<Options>
@ -3052,7 +3043,7 @@
<ReferencePath>../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Xml"/>
<Reference name="System.Core"/>
<Reference name="System.Core"/>
<Reference name="System.Drawing"/>
<Reference name="System.Data"/>
<Reference name="OpenMetaverse.dll"/>
@ -3061,7 +3052,7 @@
<Reference name="OpenSim.Data"/>
<Reference name="OpenSim.Region.Framework"/>
<Reference name="OpenSim.Region.CoreModules"/>
<Reference name="OpenSim.Tests.Common"/>
<Reference name="OpenSim.Tests.Common"/>
<Reference name="log4net.dll"/>
<Reference name="Mono.Addins.dll" />
<Reference name="nunit.framework.dll" />
@ -3302,7 +3293,7 @@
<Reference name="OpenSim.Region.CoreModules"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="OpenSim.Services.Interfaces"/>
<!-- Unit tests -->
<Reference name="OpenSim.Tests.Common"/>
<Reference name="Nini.dll"/>
@ -3562,9 +3553,3 @@
</Solution>
</Prebuild>