Merge branch 'master' of /home/opensim/var/repo/opensim
Conflicts: OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.csintegration
commit
5b14941d0f
|
@ -93,6 +93,8 @@ namespace OpenSim.Framework.Serialization.External
|
||||||
"MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL"));
|
"MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL"));
|
||||||
m_ldProcessors.Add(
|
m_ldProcessors.Add(
|
||||||
"MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL"));
|
"MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL"));
|
||||||
|
m_ldProcessors.Add(
|
||||||
|
"OwnerID", (ld, xtr) => ld.OwnerID = UUID.Parse(xtr.ReadElementString("OwnerID")));
|
||||||
|
|
||||||
m_ldProcessors.Add(
|
m_ldProcessors.Add(
|
||||||
"ParcelAccessList", ProcessParcelAccessList);
|
"ParcelAccessList", ProcessParcelAccessList);
|
||||||
|
@ -186,7 +188,16 @@ namespace OpenSim.Framework.Serialization.External
|
||||||
return landData;
|
return landData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string Serialize(LandData landData)
|
/// <summary>
|
||||||
|
/// Serialize land data
|
||||||
|
/// </summary>
|
||||||
|
/// <param name='landData'></param>
|
||||||
|
/// <param name='options'>
|
||||||
|
/// Serialization options.
|
||||||
|
/// Can be null if there are no options.
|
||||||
|
/// "wipe-owners" will write UUID.Zero rather than the ownerID so that a later reload loads all parcels with the estate owner as the owner
|
||||||
|
/// </param>
|
||||||
|
public static string Serialize(LandData landData, Dictionary<string, object> options)
|
||||||
{
|
{
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
XmlTextWriter xtw = new XmlTextWriter(sw);
|
XmlTextWriter xtw = new XmlTextWriter(sw);
|
||||||
|
@ -215,7 +226,14 @@ namespace OpenSim.Framework.Serialization.External
|
||||||
xtw.WriteElementString("MediaID", landData.MediaID.ToString());
|
xtw.WriteElementString("MediaID", landData.MediaID.ToString());
|
||||||
xtw.WriteElementString("MediaURL", landData.MediaURL);
|
xtw.WriteElementString("MediaURL", landData.MediaURL);
|
||||||
xtw.WriteElementString("MusicURL", landData.MusicURL);
|
xtw.WriteElementString("MusicURL", landData.MusicURL);
|
||||||
xtw.WriteElementString("OwnerID", landData.OwnerID.ToString());
|
|
||||||
|
UUID ownerIdToWrite;
|
||||||
|
if (options != null && options.ContainsKey("wipe-owners"))
|
||||||
|
ownerIdToWrite = UUID.Zero;
|
||||||
|
else
|
||||||
|
ownerIdToWrite = landData.OwnerID;
|
||||||
|
|
||||||
|
xtw.WriteElementString("OwnerID", ownerIdToWrite.ToString());
|
||||||
|
|
||||||
xtw.WriteStartElement("ParcelAccessList");
|
xtw.WriteStartElement("ParcelAccessList");
|
||||||
foreach (LandAccessEntry pal in landData.ParcelAccessList)
|
foreach (LandAccessEntry pal in landData.ParcelAccessList)
|
||||||
|
|
|
@ -42,22 +42,23 @@ namespace OpenSim.Framework.Serialization.Tests
|
||||||
private LandData land;
|
private LandData land;
|
||||||
private LandData landWithParcelAccessList;
|
private LandData landWithParcelAccessList;
|
||||||
|
|
||||||
private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation><0, 0, 0></UserLocation>\n <UserLookAt><0, 0, 0></UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
|
// private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation><0, 0, 0></UserLocation>\n <UserLookAt><0, 0, 0></UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
|
||||||
private static string preSerializedWithParcelAccessList = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>0</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>0</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation><0, 0, 0></UserLocation>\n <UserLookAt><0, 0, 0></UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
|
private static string preSerializedWithParcelAccessList
|
||||||
|
= "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>0</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>0</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation><0, 0, 0></UserLocation>\n <UserLookAt><0, 0, 0></UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void setup()
|
public void setup()
|
||||||
{
|
{
|
||||||
// setup LandData object
|
// setup LandData object
|
||||||
this.land = new LandData();
|
this.land = new LandData();
|
||||||
this.land.AABBMax = new Vector3(0, 0, 0);
|
this.land.AABBMax = new Vector3(1, 2, 3);
|
||||||
this.land.AABBMin = new Vector3(128, 128, 128);
|
this.land.AABBMin = new Vector3(129, 130, 131);
|
||||||
this.land.Area = 128;
|
this.land.Area = 128;
|
||||||
this.land.AuctionID = 0;
|
this.land.AuctionID = 4;
|
||||||
this.land.AuthBuyerID = new UUID();
|
this.land.AuthBuyerID = new UUID("7176df0c-6c50-45db-8a37-5e78be56a0cd");
|
||||||
this.land.Category = ParcelCategory.Residential;
|
this.land.Category = ParcelCategory.Residential;
|
||||||
this.land.ClaimDate = 0;
|
this.land.ClaimDate = 1;
|
||||||
this.land.ClaimPrice = 0;
|
this.land.ClaimPrice = 2;
|
||||||
this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50");
|
this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50");
|
||||||
this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5");
|
this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5");
|
||||||
this.land.Description = "land data to test LandDataSerializer";
|
this.land.Description = "land data to test LandDataSerializer";
|
||||||
|
@ -65,7 +66,7 @@ namespace OpenSim.Framework.Serialization.Tests
|
||||||
this.land.LandingType = (byte)LandingType.Direct;
|
this.land.LandingType = (byte)LandingType.Direct;
|
||||||
this.land.Name = "LandDataSerializerTest Land";
|
this.land.Name = "LandDataSerializerTest Land";
|
||||||
this.land.Status = ParcelStatus.Leased;
|
this.land.Status = ParcelStatus.Leased;
|
||||||
this.land.LocalID = 0;
|
this.land.LocalID = 1;
|
||||||
this.land.MediaAutoScale = (byte)0x01;
|
this.land.MediaAutoScale = (byte)0x01;
|
||||||
this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7");
|
this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7");
|
||||||
this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4";
|
this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4";
|
||||||
|
@ -90,26 +91,26 @@ namespace OpenSim.Framework.Serialization.Tests
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test the LandDataSerializer.Serialize() method
|
/// Test the LandDataSerializer.Serialize() method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
// [Test]
|
||||||
public void LandDataSerializerSerializeTest()
|
// public void LandDataSerializerSerializeTest()
|
||||||
{
|
// {
|
||||||
TestHelpers.InMethod();
|
// TestHelpers.InMethod();
|
||||||
|
//
|
||||||
string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n");
|
// string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n");
|
||||||
Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string");
|
// Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string");
|
||||||
|
//
|
||||||
// adding a simple boolean variable because resharper nUnit integration doesn't like this
|
// // adding a simple boolean variable because resharper nUnit integration doesn't like this
|
||||||
// XML data in the Assert.That statement. Not sure why.
|
// // XML data in the Assert.That statement. Not sure why.
|
||||||
bool result = (serialized == preSerialized);
|
// bool result = (serialized == preSerialized);
|
||||||
Assert.That(result, "result of Serialize LandData does not match expected result");
|
// Assert.That(result, "result of Serialize LandData does not match expected result");
|
||||||
|
//
|
||||||
string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList).Replace("\r\n", "\n");
|
// string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList).Replace("\r\n", "\n");
|
||||||
Assert.That(serializedWithParcelAccessList.Length > 0,
|
// Assert.That(serializedWithParcelAccessList.Length > 0,
|
||||||
"Serialize(LandData) returned empty string for LandData object with ParcelAccessList");
|
// "Serialize(LandData) returned empty string for LandData object with ParcelAccessList");
|
||||||
result = (serializedWithParcelAccessList == preSerializedWithParcelAccessList);
|
// result = (serializedWithParcelAccessList == preSerializedWithParcelAccessList);
|
||||||
Assert.That(result,
|
// Assert.That(result,
|
||||||
"result of Serialize(LandData) does not match expected result (pre-serialized with parcel access list");
|
// "result of Serialize(LandData) does not match expected result (pre-serialized with parcel access list");
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test the LandDataSerializer.Deserialize() method
|
/// Test the LandDataSerializer.Deserialize() method
|
||||||
|
@ -120,10 +121,28 @@ namespace OpenSim.Framework.Serialization.Tests
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
LandData ld = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized);
|
LandData ld = LandDataSerializer.Deserialize(LandDataSerializer.Serialize(this.land, null));
|
||||||
Assert.That(ld != null, "Deserialize(string) returned null");
|
Assert.That(ld, Is.Not.Null, "Deserialize(string) returned null");
|
||||||
Assert.That(ld.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID");
|
// Assert.That(ld.AABBMax, Is.EqualTo(land.AABBMax));
|
||||||
Assert.That(ld.Name == this.land.Name, "Reified LandData.Name != original LandData.Name");
|
// Assert.That(ld.AABBMin, Is.EqualTo(land.AABBMin));
|
||||||
|
Assert.That(ld.Area, Is.EqualTo(land.Area));
|
||||||
|
Assert.That(ld.AuctionID, Is.EqualTo(land.AuctionID));
|
||||||
|
Assert.That(ld.AuthBuyerID, Is.EqualTo(land.AuthBuyerID));
|
||||||
|
Assert.That(ld.Category, Is.EqualTo(land.Category));
|
||||||
|
Assert.That(ld.ClaimDate, Is.EqualTo(land.ClaimDate));
|
||||||
|
Assert.That(ld.ClaimPrice, Is.EqualTo(land.ClaimPrice));
|
||||||
|
Assert.That(ld.GlobalID, Is.EqualTo(land.GlobalID), "Reified LandData.GlobalID != original LandData.GlobalID");
|
||||||
|
Assert.That(ld.GroupID, Is.EqualTo(land.GroupID));
|
||||||
|
Assert.That(ld.Description, Is.EqualTo(land.Description));
|
||||||
|
Assert.That(ld.Flags, Is.EqualTo(land.Flags));
|
||||||
|
Assert.That(ld.LandingType, Is.EqualTo(land.LandingType));
|
||||||
|
Assert.That(ld.Name, Is.EqualTo(land.Name), "Reified LandData.Name != original LandData.Name");
|
||||||
|
Assert.That(ld.Status, Is.EqualTo(land.Status));
|
||||||
|
Assert.That(ld.LocalID, Is.EqualTo(land.LocalID));
|
||||||
|
Assert.That(ld.MediaAutoScale, Is.EqualTo(land.MediaAutoScale));
|
||||||
|
Assert.That(ld.MediaID, Is.EqualTo(land.MediaID));
|
||||||
|
Assert.That(ld.MediaURL, Is.EqualTo(land.MediaURL));
|
||||||
|
Assert.That(ld.OwnerID, Is.EqualTo(land.OwnerID));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -294,14 +294,13 @@ namespace OpenSim
|
||||||
"save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [<OAR path>]",
|
"save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [<OAR path>]",
|
||||||
"Save a region's data to an OAR archive.",
|
"Save a region's data to an OAR archive.",
|
||||||
// "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
|
// "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
|
||||||
"-h|--home=<url> adds the url of the profile service to the saved user information." + Environment.NewLine
|
"-h|--home=<url> adds the url of the profile service to the saved user information.\n"
|
||||||
+ "--noassets stops assets being saved to the OAR." + Environment.NewLine
|
+ "--noassets stops assets being saved to the OAR.\n"
|
||||||
+ "--publish saves an OAR stripped of owner and last owner information." + Environment.NewLine
|
+ "--publish saves an OAR stripped of owner and last owner information.\n"
|
||||||
+ " on reload, the estate owner will be the owner of all objects" + Environment.NewLine
|
+ " on reload, the estate owner will be the owner of all objects\n"
|
||||||
+ " this is useful if you're making oars generally available that might be reloaded to the same grid from which you published" + Environment.NewLine
|
+ " this is useful if you're making oars generally available that might be reloaded to the same grid from which you published\n"
|
||||||
+ " this option is EXPERIMENTAL" + Environment.NewLine
|
+ "--perm=<permissions> stops objects with insufficient permissions from being saved to the OAR.\n"
|
||||||
+ "--perm=<permissions> stops objects with insufficient permissions from being saved to the OAR." + Environment.NewLine
|
+ " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer\n"
|
||||||
+ " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer" + Environment.NewLine
|
|
||||||
+ "The OAR path must be a filesystem path."
|
+ "The OAR path must be a filesystem path."
|
||||||
+ " If this is not given then the oar is saved to region.oar in the current directory.",
|
+ " If this is not given then the oar is saved to region.oar in the current directory.",
|
||||||
SaveOar);
|
SaveOar);
|
||||||
|
|
|
@ -123,9 +123,14 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
IConfig sconfig = config.Configs["Startup"];
|
IConfig sconfig = config.Configs["Startup"];
|
||||||
if (sconfig != null)
|
if (sconfig != null)
|
||||||
{
|
{
|
||||||
m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
|
|
||||||
m_levelUpload = sconfig.GetInt("LevelUpload", 0);
|
m_levelUpload = sconfig.GetInt("LevelUpload", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IConfig appearanceConfig = config.Configs["Appearance"];
|
||||||
|
if (appearanceConfig != null)
|
||||||
|
{
|
||||||
|
m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_assetService = m_Scene.AssetService;
|
m_assetService = m_Scene.AssetService;
|
||||||
|
|
|
@ -66,9 +66,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
public void Initialise(IConfigSource source)
|
||||||
{
|
{
|
||||||
IConfig sconfig = source.Configs["Startup"];
|
IConfig appearanceConfig = source.Configs["Appearance"];
|
||||||
if (sconfig != null)
|
if (appearanceConfig != null)
|
||||||
m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
|
m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddRegion(Scene s)
|
public void AddRegion(Scene s)
|
||||||
|
|
|
@ -66,11 +66,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
|
scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
|
||||||
scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||||
|
|
||||||
IConfig sconfig = config.Configs["Startup"];
|
IConfig appearanceConfig = config.Configs["Appearance"];
|
||||||
if (sconfig != null)
|
if (appearanceConfig != null)
|
||||||
{
|
{
|
||||||
m_savetime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime)));
|
m_savetime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime)));
|
||||||
m_sendtime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime)));
|
m_sendtime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime)));
|
||||||
// m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime);
|
// m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
LandData landData = lo.LandData;
|
LandData landData = lo.LandData;
|
||||||
string landDataPath = String.Format("{0}{1}.xml", ArchiveConstants.LANDDATA_PATH,
|
string landDataPath = String.Format("{0}{1}.xml", ArchiveConstants.LANDDATA_PATH,
|
||||||
landData.GlobalID.ToString());
|
landData.GlobalID.ToString());
|
||||||
m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData));
|
m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData, m_options));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.InfoFormat("[ARCHIVER]: Adding terrain information to archive.");
|
m_log.InfoFormat("[ARCHIVER]: Adding terrain information to archive.");
|
||||||
|
|
|
@ -814,8 +814,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences);
|
m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences);
|
||||||
m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
|
m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
|
||||||
m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
|
m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
|
||||||
|
}
|
||||||
|
|
||||||
SendPeriodicAppearanceUpdates = startupConfig.GetBoolean("SendPeriodicAppearanceUpdates", SendPeriodicAppearanceUpdates);
|
// FIXME: Ultimately this should be in a module.
|
||||||
|
IConfig appearanceConfig = m_config.Configs["Appearance"];
|
||||||
|
if (appearanceConfig != null)
|
||||||
|
{
|
||||||
|
SendPeriodicAppearanceUpdates
|
||||||
|
= appearanceConfig.GetBoolean("ResendAppearanceUpdates", SendPeriodicAppearanceUpdates);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Region Config
|
#endregion Region Config
|
||||||
|
|
|
@ -650,7 +650,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// its existing localID and UUID.
|
/// its existing localID and UUID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name='part'>Root part for this scene object.</param>
|
/// <param name='part'>Root part for this scene object.</param>
|
||||||
public SceneObjectGroup(SceneObjectPart part)
|
public SceneObjectGroup(SceneObjectPart part) : this()
|
||||||
{
|
{
|
||||||
SetRootPart(part);
|
SetRootPart(part);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ public class BSCharacter : PhysicsActor
|
||||||
private static readonly string LogHeader = "[BULLETS CHAR]";
|
private static readonly string LogHeader = "[BULLETS CHAR]";
|
||||||
|
|
||||||
private BSScene _scene;
|
private BSScene _scene;
|
||||||
|
public BSScene Scene { get { return _scene; } }
|
||||||
private String _avName;
|
private String _avName;
|
||||||
// private bool _stopped;
|
// private bool _stopped;
|
||||||
private Vector3 _size;
|
private Vector3 _size;
|
||||||
|
@ -73,6 +74,12 @@ public class BSCharacter : PhysicsActor
|
||||||
private bool _kinematic;
|
private bool _kinematic;
|
||||||
private float _buoyancy;
|
private float _buoyancy;
|
||||||
|
|
||||||
|
private BulletBody m_body;
|
||||||
|
public BulletBody Body {
|
||||||
|
get { return m_body; }
|
||||||
|
set { m_body = value; }
|
||||||
|
}
|
||||||
|
|
||||||
private int _subscribedEventsMs = 0;
|
private int _subscribedEventsMs = 0;
|
||||||
private int _nextCollisionOkTime = 0;
|
private int _nextCollisionOkTime = 0;
|
||||||
|
|
||||||
|
@ -116,6 +123,10 @@ public class BSCharacter : PhysicsActor
|
||||||
_scene.TaintedObject(delegate()
|
_scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
BulletSimAPI.CreateObject(parent_scene.WorldID, shapeData);
|
BulletSimAPI.CreateObject(parent_scene.WorldID, shapeData);
|
||||||
|
|
||||||
|
m_body = new BulletBody(LocalID, BulletSimAPI.GetBodyHandle2(_scene.World.Ptr, LocalID));
|
||||||
|
// avatars get all collisions no matter what
|
||||||
|
BulletSimAPI.AddToCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -124,6 +135,7 @@ public class BSCharacter : PhysicsActor
|
||||||
// called when this character is being destroyed and the resources should be released
|
// called when this character is being destroyed and the resources should be released
|
||||||
public void Destroy()
|
public void Destroy()
|
||||||
{
|
{
|
||||||
|
// DetailLog("{0},Destroy", LocalID);
|
||||||
_scene.TaintedObject(delegate()
|
_scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
BulletSimAPI.DestroyObject(_scene.WorldID, _localID);
|
BulletSimAPI.DestroyObject(_scene.WorldID, _localID);
|
||||||
|
@ -174,6 +186,7 @@ public class BSCharacter : PhysicsActor
|
||||||
_position = value;
|
_position = value;
|
||||||
_scene.TaintedObject(delegate()
|
_scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
|
DetailLog("{0},SetPosition,taint,pos={1},orient={2}", LocalID, _position, _orientation);
|
||||||
BulletSimAPI.SetObjectTranslation(_scene.WorldID, _localID, _position, _orientation);
|
BulletSimAPI.SetObjectTranslation(_scene.WorldID, _localID, _position, _orientation);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -188,9 +201,10 @@ public class BSCharacter : PhysicsActor
|
||||||
set {
|
set {
|
||||||
_force = value;
|
_force = value;
|
||||||
// m_log.DebugFormat("{0}: Force = {1}", LogHeader, _force);
|
// m_log.DebugFormat("{0}: Force = {1}", LogHeader, _force);
|
||||||
_scene.TaintedObject(delegate()
|
Scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
BulletSimAPI.SetObjectForce(_scene.WorldID, _localID, _force);
|
DetailLog("{0},setForce,taint,force={1}", LocalID, _force);
|
||||||
|
BulletSimAPI.SetObjectForce(Scene.WorldID, LocalID, _force);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,6 +230,7 @@ public class BSCharacter : PhysicsActor
|
||||||
// m_log.DebugFormat("{0}: set velocity = {1}", LogHeader, _velocity);
|
// m_log.DebugFormat("{0}: set velocity = {1}", LogHeader, _velocity);
|
||||||
_scene.TaintedObject(delegate()
|
_scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
|
DetailLog("{0},setVelocity,taint,vel={1}", LocalID, _velocity);
|
||||||
BulletSimAPI.SetObjectVelocity(_scene.WorldID, _localID, _velocity);
|
BulletSimAPI.SetObjectVelocity(_scene.WorldID, _localID, _velocity);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -305,6 +320,7 @@ public class BSCharacter : PhysicsActor
|
||||||
set { _buoyancy = value;
|
set { _buoyancy = value;
|
||||||
_scene.TaintedObject(delegate()
|
_scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
|
DetailLog("{0},setBuoyancy,taint,buoy={1}", LocalID, _buoyancy);
|
||||||
BulletSimAPI.SetObjectBuoyancy(_scene.WorldID, LocalID, _buoyancy);
|
BulletSimAPI.SetObjectBuoyancy(_scene.WorldID, LocalID, _buoyancy);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -351,7 +367,8 @@ public class BSCharacter : PhysicsActor
|
||||||
// m_log.DebugFormat("{0}: AddForce. adding={1}, newForce={2}", LogHeader, force, _force);
|
// m_log.DebugFormat("{0}: AddForce. adding={1}, newForce={2}", LogHeader, force, _force);
|
||||||
_scene.TaintedObject(delegate()
|
_scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
BulletSimAPI.SetObjectForce(_scene.WorldID, _localID, _force);
|
DetailLog("{0},setAddForce,taint,addedForce={1}", LocalID, _force);
|
||||||
|
BulletSimAPI.AddObjectForce2(Body.Ptr, _force);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -369,11 +386,25 @@ public class BSCharacter : PhysicsActor
|
||||||
// Turn on collision events at a rate no faster than one every the given milliseconds
|
// Turn on collision events at a rate no faster than one every the given milliseconds
|
||||||
public override void SubscribeEvents(int ms) {
|
public override void SubscribeEvents(int ms) {
|
||||||
_subscribedEventsMs = ms;
|
_subscribedEventsMs = ms;
|
||||||
_nextCollisionOkTime = Util.EnvironmentTickCount() - _subscribedEventsMs; // make first collision happen
|
if (ms > 0)
|
||||||
|
{
|
||||||
|
// make sure first collision happens
|
||||||
|
_nextCollisionOkTime = Util.EnvironmentTickCount() - _subscribedEventsMs;
|
||||||
|
|
||||||
|
Scene.TaintedObject(delegate()
|
||||||
|
{
|
||||||
|
BulletSimAPI.AddToCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Stop collision events
|
// Stop collision events
|
||||||
public override void UnSubscribeEvents() {
|
public override void UnSubscribeEvents() {
|
||||||
_subscribedEventsMs = 0;
|
_subscribedEventsMs = 0;
|
||||||
|
// Avatars get all their collision events
|
||||||
|
// Scene.TaintedObject(delegate()
|
||||||
|
// {
|
||||||
|
// BulletSimAPI.RemoveFromCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
// Return 'true' if someone has subscribed to events
|
// Return 'true' if someone has subscribed to events
|
||||||
public override bool SubscribedEvents() {
|
public override bool SubscribedEvents() {
|
||||||
|
@ -480,5 +511,10 @@ public class BSCharacter : PhysicsActor
|
||||||
// End kludge
|
// End kludge
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Invoke the detailed logger and output something if it's enabled.
|
||||||
|
private void DetailLog(string msg, params Object[] args)
|
||||||
|
{
|
||||||
|
Scene.PhysicsLogging.Write(msg, args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ public sealed class BSPrim : PhysicsActor
|
||||||
{
|
{
|
||||||
_mass = CalculateMass(); // changing size changes the mass
|
_mass = CalculateMass(); // changing size changes the mass
|
||||||
BulletSimAPI.SetObjectScaleMass(_scene.WorldID, _localID, _scale, (IsPhysical ? _mass : 0f), IsPhysical);
|
BulletSimAPI.SetObjectScaleMass(_scene.WorldID, _localID, _scale, (IsPhysical ? _mass : 0f), IsPhysical);
|
||||||
DetailLog("{0}: setSize: size={1}, mass={2}, physical={3}", LocalID, _size, _mass, IsPhysical);
|
// DetailLog("{0}: setSize: size={1}, mass={2}, physical={3}", LocalID, _size, _mass, IsPhysical);
|
||||||
RecreateGeomAndObject();
|
RecreateGeomAndObject();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ public sealed class BSPrim : PhysicsActor
|
||||||
_force = value;
|
_force = value;
|
||||||
_scene.TaintedObject(delegate()
|
_scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
DetailLog("{0},SetForce,taint,force={1}", LocalID, _force);
|
DetailLog("{0},setForce,taint,force={1}", LocalID, _force);
|
||||||
// BulletSimAPI.SetObjectForce(_scene.WorldID, _localID, _force);
|
// BulletSimAPI.SetObjectForce(_scene.WorldID, _localID, _force);
|
||||||
BulletSimAPI.SetObjectForce2(Body.Ptr, _force);
|
BulletSimAPI.SetObjectForce2(Body.Ptr, _force);
|
||||||
});
|
});
|
||||||
|
@ -443,7 +443,7 @@ public sealed class BSPrim : PhysicsActor
|
||||||
_scene.TaintedObject(delegate()
|
_scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
// _position = BulletSimAPI.GetObjectPosition(_scene.WorldID, _localID);
|
// _position = BulletSimAPI.GetObjectPosition(_scene.WorldID, _localID);
|
||||||
DetailLog("{0},SetOrientation,taint,pos={1},orient={2}", LocalID, _position, _orientation);
|
DetailLog("{0},setOrientation,taint,pos={1},orient={2}", LocalID, _position, _orientation);
|
||||||
BulletSimAPI.SetObjectTranslation(_scene.WorldID, _localID, _position, _orientation);
|
BulletSimAPI.SetObjectTranslation(_scene.WorldID, _localID, _position, _orientation);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -487,10 +487,8 @@ public sealed class BSPrim : PhysicsActor
|
||||||
// Maybe a VerifyCorrectPhysicalShape() routine?
|
// Maybe a VerifyCorrectPhysicalShape() routine?
|
||||||
// RecreateGeomAndObject();
|
// RecreateGeomAndObject();
|
||||||
|
|
||||||
float mass = _mass;
|
// Bullet wants static objects to have a mass of zero
|
||||||
// Bullet wants static objects have a mass of zero
|
float mass = IsStatic ? 0f : _mass;
|
||||||
if (IsStatic)
|
|
||||||
mass = 0f;
|
|
||||||
|
|
||||||
DetailLog("{0},SetObjectDynamic,taint,static={1},solid={2},mass={3}", LocalID, IsStatic, IsSolid, mass);
|
DetailLog("{0},SetObjectDynamic,taint,static={1},solid={2},mass={3}", LocalID, IsStatic, IsSolid, mass);
|
||||||
BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), mass);
|
BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), mass);
|
||||||
|
@ -607,6 +605,7 @@ public sealed class BSPrim : PhysicsActor
|
||||||
|
|
||||||
private List<OMV.Vector3> m_accumulatedForces = new List<OMV.Vector3>();
|
private List<OMV.Vector3> m_accumulatedForces = new List<OMV.Vector3>();
|
||||||
public override void AddForce(OMV.Vector3 force, bool pushforce) {
|
public override void AddForce(OMV.Vector3 force, bool pushforce) {
|
||||||
|
// for an object, doesn't matter if force is a pushforce or not
|
||||||
if (force.IsFinite())
|
if (force.IsFinite())
|
||||||
{
|
{
|
||||||
// _force += force;
|
// _force += force;
|
||||||
|
@ -620,21 +619,17 @@ public sealed class BSPrim : PhysicsActor
|
||||||
}
|
}
|
||||||
_scene.TaintedObject(delegate()
|
_scene.TaintedObject(delegate()
|
||||||
{
|
{
|
||||||
|
OMV.Vector3 fSum = OMV.Vector3.Zero;
|
||||||
lock (m_accumulatedForces)
|
lock (m_accumulatedForces)
|
||||||
{
|
{
|
||||||
if (m_accumulatedForces.Count > 0)
|
foreach (OMV.Vector3 v in m_accumulatedForces)
|
||||||
{
|
{
|
||||||
OMV.Vector3 fSum = OMV.Vector3.Zero;
|
fSum += v;
|
||||||
foreach (OMV.Vector3 v in m_accumulatedForces)
|
|
||||||
{
|
|
||||||
fSum += v;
|
|
||||||
}
|
|
||||||
m_accumulatedForces.Clear();
|
|
||||||
|
|
||||||
DetailLog("{0},SetObjectForce,taint,force={1}", LocalID, fSum);
|
|
||||||
BulletSimAPI.SetObjectForce(_scene.WorldID, _localID, fSum);
|
|
||||||
}
|
}
|
||||||
|
m_accumulatedForces.Clear();
|
||||||
}
|
}
|
||||||
|
DetailLog("{0},AddObjectForce,taint,force={1}", LocalID, _force);
|
||||||
|
BulletSimAPI.AddObjectForce2(Body.Ptr, fSum);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -647,11 +642,23 @@ public sealed class BSPrim : PhysicsActor
|
||||||
}
|
}
|
||||||
public override void SubscribeEvents(int ms) {
|
public override void SubscribeEvents(int ms) {
|
||||||
_subscribedEventsMs = ms;
|
_subscribedEventsMs = ms;
|
||||||
// make sure first collision happens
|
if (ms > 0)
|
||||||
_nextCollisionOkTime = Util.EnvironmentTickCount() - _subscribedEventsMs;
|
{
|
||||||
|
// make sure first collision happens
|
||||||
|
_nextCollisionOkTime = Util.EnvironmentTickCount() - _subscribedEventsMs;
|
||||||
|
|
||||||
|
Scene.TaintedObject(delegate()
|
||||||
|
{
|
||||||
|
BulletSimAPI.AddToCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public override void UnSubscribeEvents() {
|
public override void UnSubscribeEvents() {
|
||||||
_subscribedEventsMs = 0;
|
_subscribedEventsMs = 0;
|
||||||
|
Scene.TaintedObject(delegate()
|
||||||
|
{
|
||||||
|
BulletSimAPI.RemoveFromCollisionFlags2(Body.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
public override bool SubscribedEvents() {
|
public override bool SubscribedEvents() {
|
||||||
return (_subscribedEventsMs > 0);
|
return (_subscribedEventsMs > 0);
|
||||||
|
|
|
@ -179,17 +179,18 @@ public struct ConfigurationParameters
|
||||||
// Values used by Bullet and BulletSim to control collisions
|
// Values used by Bullet and BulletSim to control collisions
|
||||||
public enum CollisionFlags : uint
|
public enum CollisionFlags : uint
|
||||||
{
|
{
|
||||||
STATIC_OBJECT = 1 << 0,
|
CF_STATIC_OBJECT = 1 << 0,
|
||||||
KINEMATIC_OBJECT = 1 << 1,
|
CF_KINEMATIC_OBJECT = 1 << 1,
|
||||||
NO_CONTACT_RESPONSE = 1 << 2,
|
CF_NO_CONTACT_RESPONSE = 1 << 2,
|
||||||
CUSTOM_MATERIAL_CALLBACK = 1 << 3,
|
CF_CUSTOM_MATERIAL_CALLBACK = 1 << 3,
|
||||||
CHARACTER_OBJECT = 1 << 4,
|
CF_CHARACTER_OBJECT = 1 << 4,
|
||||||
DISABLE_VISUALIZE_OBJECT = 1 << 5,
|
CF_DISABLE_VISUALIZE_OBJECT = 1 << 5,
|
||||||
DISABLE_SPU_COLLISION_PROCESS = 1 << 6,
|
CF_DISABLE_SPU_COLLISION_PROCESS = 1 << 6,
|
||||||
// Following used by BulletSim to control collisions
|
// Following used by BulletSim to control collisions
|
||||||
VOLUME_DETECT_OBJECT = 1 << 10,
|
BS_SUBSCRIBE_COLLISION_EVENTS = 1 << 10,
|
||||||
PHANTOM_OBJECT = 1 << 11,
|
BS_VOLUME_DETECT_OBJECT = 1 << 11,
|
||||||
PHYSICAL_OBJECT = 1 << 12,
|
BS_PHANTOM_OBJECT = 1 << 12,
|
||||||
|
BS_PHYSICAL_OBJECT = 1 << 13,
|
||||||
};
|
};
|
||||||
|
|
||||||
// CFM controls the 'hardness' of the constraint. 0=fixed, 0..1=violatable. Default=0
|
// CFM controls the 'hardness' of the constraint. 0=fixed, 0..1=violatable. Default=0
|
||||||
|
@ -447,6 +448,9 @@ public static extern bool SetAngularVelocity2(IntPtr obj, Vector3 angularVelocit
|
||||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern bool SetObjectForce2(IntPtr obj, Vector3 force);
|
public static extern bool SetObjectForce2(IntPtr obj, Vector3 force);
|
||||||
|
|
||||||
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
|
public static extern bool AddObjectForce2(IntPtr obj, Vector3 force);
|
||||||
|
|
||||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern bool SetCcdMotionThreshold2(IntPtr obj, float val);
|
public static extern bool SetCcdMotionThreshold2(IntPtr obj, float val);
|
||||||
|
|
||||||
|
@ -478,13 +482,13 @@ public static extern bool SetLinearVelocity2(IntPtr obj, Vector3 val);
|
||||||
public static extern bool SetInterpolation2(IntPtr obj, Vector3 lin, Vector3 ang);
|
public static extern bool SetInterpolation2(IntPtr obj, Vector3 lin, Vector3 ang);
|
||||||
|
|
||||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern IntPtr SetCollisionFlags2(IntPtr obj, uint flags);
|
public static extern IntPtr SetCollisionFlags2(IntPtr obj, CollisionFlags flags);
|
||||||
|
|
||||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern IntPtr AddToCollisionFlags2(IntPtr obj, uint flags);
|
public static extern IntPtr AddToCollisionFlags2(IntPtr obj, CollisionFlags flags);
|
||||||
|
|
||||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern IntPtr RemoveFromCollisionFlags2(IntPtr obj, uint flags);
|
public static extern IntPtr RemoveFromCollisionFlags2(IntPtr obj, CollisionFlags flags);
|
||||||
|
|
||||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern bool SetMassProps2(IntPtr obj, float mass, Vector3 inertia);
|
public static extern bool SetMassProps2(IntPtr obj, float mass, Vector3 inertia);
|
||||||
|
|
|
@ -181,11 +181,6 @@
|
||||||
; Objects will always be considered for persistance in the next sweep if the first change occurred this number of seconds ago
|
; Objects will always be considered for persistance in the next sweep if the first change occurred this number of seconds ago
|
||||||
MaximumTimeBeforePersistenceConsidered = 600
|
MaximumTimeBeforePersistenceConsidered = 600
|
||||||
|
|
||||||
; Experimental setting to resend appearance updates every 60 seconds.
|
|
||||||
; These packets are small and this can help with grey avatar syndrome.
|
|
||||||
; Default is false
|
|
||||||
SendPeriodicAppearanceUpdates = false
|
|
||||||
|
|
||||||
; ##
|
; ##
|
||||||
; ## PHYSICS
|
; ## PHYSICS
|
||||||
; ##
|
; ##
|
||||||
|
@ -341,27 +336,12 @@
|
||||||
; OpenJPEG if false
|
; OpenJPEG if false
|
||||||
; UseCSJ2K = true
|
; UseCSJ2K = true
|
||||||
|
|
||||||
|
|
||||||
; Use "Trash" folder for items deleted from the scene
|
; Use "Trash" folder for items deleted from the scene
|
||||||
; When set to True (the default) items deleted from the scene will be
|
; When set to True (the default) items deleted from the scene will be
|
||||||
; stored in the user's trash or lost and found folder. When set to
|
; stored in the user's trash or lost and found folder. When set to
|
||||||
; False items will be removed from the scene permanently
|
; False items will be removed from the scene permanently
|
||||||
UseTrashOnDelete = True
|
UseTrashOnDelete = True
|
||||||
|
|
||||||
; Persist avatar baked textures
|
|
||||||
; Persisting baked textures can speed up login and region border
|
|
||||||
; crossings especially with large numbers of users, though it
|
|
||||||
; will store potentially large numbers of textures in your asset
|
|
||||||
; database
|
|
||||||
PersistBakedTextures = false
|
|
||||||
|
|
||||||
; Control the delay before appearance is sent to other avatars and
|
|
||||||
; saved in the avatar service. Attempts to limit the impact caused
|
|
||||||
; by the very chatty dialog that sets appearance when an avatar
|
|
||||||
; logs in or teleports into a region; values are in seconds
|
|
||||||
DelayBeforeAppearanceSave = 5
|
|
||||||
DelayBeforeAppearanceSend = 2
|
|
||||||
|
|
||||||
|
|
||||||
[RegionReady]
|
[RegionReady]
|
||||||
; Enable this module to get notified once all items and scripts in the region have been completely loaded and compiled
|
; Enable this module to get notified once all items and scripts in the region have been completely loaded and compiled
|
||||||
|
@ -671,6 +651,28 @@
|
||||||
CoalesceMultipleObjectsToInventory = true
|
CoalesceMultipleObjectsToInventory = true
|
||||||
|
|
||||||
|
|
||||||
|
[Appearance]
|
||||||
|
; Persist avatar baked textures
|
||||||
|
; Persisting baked textures can speed up login and region border
|
||||||
|
; crossings especially with large numbers of users, though it
|
||||||
|
; will store potentially large numbers of textures in your asset
|
||||||
|
; database
|
||||||
|
PersistBakedTextures = false
|
||||||
|
|
||||||
|
; Control the delay before appearance is sent to other avatars and
|
||||||
|
; saved in the avatar service. Attempts to limit the impact caused
|
||||||
|
; by the very chatty dialog that sets appearance when an avatar
|
||||||
|
; logs in or teleports into a region; values are in seconds
|
||||||
|
DelayBeforeAppearanceSave = 5
|
||||||
|
DelayBeforeAppearanceSend = 2
|
||||||
|
|
||||||
|
; If true, avatar appearance information is resent to other avatars in the simulator every 60 seconds.
|
||||||
|
; This may help with some situations where avatars are persistently grey, though it will not help
|
||||||
|
; in other situations (e.g. appearance baking failures where the avatar only appears as a cloud to others).
|
||||||
|
; This setting is experimental.
|
||||||
|
ResendAppearanceUpdates = false
|
||||||
|
|
||||||
|
|
||||||
[Attachments]
|
[Attachments]
|
||||||
; Controls whether avatar attachments are enabled.
|
; Controls whether avatar attachments are enabled.
|
||||||
; Defaults to true - only set to false for debugging purposes
|
; Defaults to true - only set to false for debugging purposes
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue