Merge branch 'master' into careminster-presence-refactor
commit
c920ff9d1d
|
@ -111,6 +111,7 @@ what it is today.
|
||||||
* Mircea Kitsune
|
* Mircea Kitsune
|
||||||
* mpallari
|
* mpallari
|
||||||
* MrMonkE
|
* MrMonkE
|
||||||
|
* Nebadon Izumi (Michael Cerquoni - http://OSgrid.org)
|
||||||
* nornalbion
|
* nornalbion
|
||||||
* Omar Vera Ustariz (IBM)
|
* Omar Vera Ustariz (IBM)
|
||||||
* openlifegrid.com
|
* openlifegrid.com
|
||||||
|
|
|
@ -213,6 +213,8 @@ namespace OpenSim.Framework
|
||||||
/// <param name="prim"></param>
|
/// <param name="prim"></param>
|
||||||
public PrimitiveBaseShape(Primitive prim)
|
public PrimitiveBaseShape(Primitive prim)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: Creating from {0}", prim.ID);
|
||||||
|
|
||||||
PCode = (byte)prim.PrimData.PCode;
|
PCode = (byte)prim.PrimData.PCode;
|
||||||
ExtraParams = new byte[1];
|
ExtraParams = new byte[1];
|
||||||
|
|
||||||
|
@ -376,7 +378,7 @@ namespace OpenSim.Framework
|
||||||
_pathEnd = Primitive.PackEndCut(end);
|
_pathEnd = Primitive.PackEndCut(end);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetSculptData(byte sculptType, UUID SculptTextureUUID)
|
public void SetSculptProperties(byte sculptType, UUID SculptTextureUUID)
|
||||||
{
|
{
|
||||||
_sculptType = sculptType;
|
_sculptType = sculptType;
|
||||||
_sculptTexture = SculptTextureUUID;
|
_sculptTexture = SculptTextureUUID;
|
||||||
|
@ -613,29 +615,39 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte SculptType {
|
public byte SculptType
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return _sculptType;
|
return _sculptType;
|
||||||
}
|
}
|
||||||
set {
|
set
|
||||||
|
{
|
||||||
_sculptType = value;
|
_sculptType = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] SculptData {
|
public byte[] SculptData
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return _sculptData;
|
return _sculptData;
|
||||||
}
|
}
|
||||||
set {
|
set
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: Setting SculptData to data with length {0}", value.Length);
|
||||||
_sculptData = value;
|
_sculptData = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int FlexiSoftness {
|
public int FlexiSoftness
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return _flexiSoftness;
|
return _flexiSoftness;
|
||||||
}
|
}
|
||||||
set {
|
set
|
||||||
|
{
|
||||||
_flexiSoftness = value;
|
_flexiSoftness = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -869,6 +881,8 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
public byte[] ExtraParamsToBytes()
|
public byte[] ExtraParamsToBytes()
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[EXTRAPARAMS]: Called ExtraParamsToBytes()");
|
||||||
|
|
||||||
ushort FlexiEP = 0x10;
|
ushort FlexiEP = 0x10;
|
||||||
ushort LightEP = 0x20;
|
ushort LightEP = 0x20;
|
||||||
ushort SculptEP = 0x30;
|
ushort SculptEP = 0x30;
|
||||||
|
@ -884,18 +898,21 @@ namespace OpenSim.Framework
|
||||||
TotalBytesLength += 16;// data
|
TotalBytesLength += 16;// data
|
||||||
TotalBytesLength += 2 + 4; // type
|
TotalBytesLength += 2 + 4; // type
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_lightEntry)
|
if (_lightEntry)
|
||||||
{
|
{
|
||||||
ExtraParamsNum++;
|
ExtraParamsNum++;
|
||||||
TotalBytesLength += 16;// data
|
TotalBytesLength += 16;// data
|
||||||
TotalBytesLength += 2 + 4; // type
|
TotalBytesLength += 2 + 4; // type
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_sculptEntry)
|
if (_sculptEntry)
|
||||||
{
|
{
|
||||||
ExtraParamsNum++;
|
ExtraParamsNum++;
|
||||||
TotalBytesLength += 17;// data
|
TotalBytesLength += 17;// data
|
||||||
TotalBytesLength += 2 + 4; // type
|
TotalBytesLength += 2 + 4; // type
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_projectionEntry)
|
if (_projectionEntry)
|
||||||
{
|
{
|
||||||
ExtraParamsNum++;
|
ExtraParamsNum++;
|
||||||
|
@ -905,7 +922,6 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
byte[] returnbytes = new byte[TotalBytesLength];
|
byte[] returnbytes = new byte[TotalBytesLength];
|
||||||
|
|
||||||
|
|
||||||
// uint paramlength = ExtraParamsNum;
|
// uint paramlength = ExtraParamsNum;
|
||||||
|
|
||||||
// Stick in the number of parameters
|
// Stick in the number of parameters
|
||||||
|
@ -925,6 +941,7 @@ namespace OpenSim.Framework
|
||||||
Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length);
|
Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length);
|
||||||
i += FlexiData.Length;
|
i += FlexiData.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_lightEntry)
|
if (_lightEntry)
|
||||||
{
|
{
|
||||||
byte[] LightData = GetLightBytes();
|
byte[] LightData = GetLightBytes();
|
||||||
|
@ -939,6 +956,7 @@ namespace OpenSim.Framework
|
||||||
Array.Copy(LightData, 0, returnbytes, i, LightData.Length);
|
Array.Copy(LightData, 0, returnbytes, i, LightData.Length);
|
||||||
i += LightData.Length;
|
i += LightData.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_sculptEntry)
|
if (_sculptEntry)
|
||||||
{
|
{
|
||||||
byte[] SculptData = GetSculptBytes();
|
byte[] SculptData = GetSculptBytes();
|
||||||
|
@ -953,6 +971,7 @@ namespace OpenSim.Framework
|
||||||
Array.Copy(SculptData, 0, returnbytes, i, SculptData.Length);
|
Array.Copy(SculptData, 0, returnbytes, i, SculptData.Length);
|
||||||
i += SculptData.Length;
|
i += SculptData.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_projectionEntry)
|
if (_projectionEntry)
|
||||||
{
|
{
|
||||||
byte[] ProjectionData = GetProjectionBytes();
|
byte[] ProjectionData = GetProjectionBytes();
|
||||||
|
@ -966,6 +985,7 @@ namespace OpenSim.Framework
|
||||||
Array.Copy(ProjectionData, 0, returnbytes, i, ProjectionData.Length);
|
Array.Copy(ProjectionData, 0, returnbytes, i, ProjectionData.Length);
|
||||||
i += ProjectionData.Length;
|
i += ProjectionData.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_flexiEntry && !_lightEntry && !_sculptEntry && !_projectionEntry)
|
if (!_flexiEntry && !_lightEntry && !_sculptEntry && !_projectionEntry)
|
||||||
{
|
{
|
||||||
byte[] returnbyte = new byte[1];
|
byte[] returnbyte = new byte[1];
|
||||||
|
@ -973,10 +993,7 @@ namespace OpenSim.Framework
|
||||||
return returnbyte;
|
return returnbyte;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return returnbytes;
|
return returnbytes;
|
||||||
//m_log.Info("[EXTRAPARAMS]: Length = " + m_shape.ExtraParams.Length.ToString());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadInUpdateExtraParam(ushort type, bool inUse, byte[] data)
|
public void ReadInUpdateExtraParam(ushort type, bool inUse, byte[] data)
|
||||||
|
@ -1047,7 +1064,6 @@ namespace OpenSim.Framework
|
||||||
extraParamCount = data[i++];
|
extraParamCount = data[i++];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (int k = 0; k < extraParamCount; k++)
|
for (int k = 0; k < extraParamCount; k++)
|
||||||
{
|
{
|
||||||
ushort epType = Utils.BytesToUInt16(data, i);
|
ushort epType = Utils.BytesToUInt16(data, i);
|
||||||
|
@ -1091,7 +1107,6 @@ namespace OpenSim.Framework
|
||||||
_sculptEntry = false;
|
_sculptEntry = false;
|
||||||
if (!lGotFilter)
|
if (!lGotFilter)
|
||||||
_projectionEntry = false;
|
_projectionEntry = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadSculptData(byte[] data, int pos)
|
public void ReadSculptData(byte[] data, int pos)
|
||||||
|
@ -1120,6 +1135,7 @@ namespace OpenSim.Framework
|
||||||
if (_sculptType != (byte)1 && _sculptType != (byte)2 && _sculptType != (byte)3 && _sculptType != (byte)4)
|
if (_sculptType != (byte)1 && _sculptType != (byte)2 && _sculptType != (byte)3 && _sculptType != (byte)4)
|
||||||
_sculptType = 4;
|
_sculptType = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
_sculptTexture = SculptUUID;
|
_sculptTexture = SculptUUID;
|
||||||
_sculptType = SculptTypel;
|
_sculptType = SculptTypel;
|
||||||
//m_log.Info("[SCULPT]:" + SculptUUID.ToString());
|
//m_log.Info("[SCULPT]:" + SculptUUID.ToString());
|
||||||
|
|
|
@ -324,10 +324,25 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Debug utility function to convert unbroken strings of XML into something human readable for occasional debugging purposes.
|
/// Debug utility function to convert OSD into formatted XML for debugging purposes.
|
||||||
///
|
|
||||||
/// Please don't delete me even if I appear currently unused!
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="osd">
|
||||||
|
/// A <see cref="OSD"/>
|
||||||
|
/// </param>
|
||||||
|
/// <returns>
|
||||||
|
/// A <see cref="System.String"/>
|
||||||
|
/// </returns>
|
||||||
|
public static string GetFormattedXml(OSD osd)
|
||||||
|
{
|
||||||
|
return GetFormattedXml(OSDParser.SerializeLLSDXmlString(osd));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Debug utility function to convert unbroken strings of XML into something human readable for occasional debugging purposes.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Please don't delete me even if I appear currently unused!
|
||||||
|
/// </remarks>
|
||||||
/// <param name="rawXml"></param>
|
/// <param name="rawXml"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string GetFormattedXml(string rawXml)
|
public static string GetFormattedXml(string rawXml)
|
||||||
|
@ -431,26 +446,36 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return an SHA1 hash of the given string
|
/// Return an SHA1 hash
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="data"></param>
|
/// <param name="data"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
||||||
public static string SHA1Hash(string data)
|
public static string SHA1Hash(string data, Encoding enc)
|
||||||
{
|
{
|
||||||
return SHA1Hash(data, Encoding.Default);
|
return SHA1Hash(enc.GetBytes(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string SHA1Hash(string data, Encoding encoding)
|
public static string SHA1Hash(string data)
|
||||||
{
|
{
|
||||||
byte[] hash = ComputeSHA1Hash(data, encoding);
|
return SHA1Hash(Encoding.Default.GetBytes(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return an SHA1 hash
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string SHA1Hash(byte[] data)
|
||||||
|
{
|
||||||
|
byte[] hash = ComputeSHA1Hash(data);
|
||||||
return BitConverter.ToString(hash).Replace("-", String.Empty);
|
return BitConverter.ToString(hash).Replace("-", String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] ComputeSHA1Hash(string src, Encoding encoding)
|
private static byte[] ComputeSHA1Hash(byte[] src)
|
||||||
{
|
{
|
||||||
SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider();
|
SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider();
|
||||||
return SHA1.ComputeHash(encoding.GetBytes(src));
|
return SHA1.ComputeHash(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int fast_distance2d(int x, int y)
|
public static int fast_distance2d(int x, int y)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) Contributors, http://opensimulator.org/
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
*
|
*
|
||||||
|
@ -595,21 +595,25 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
Vector3 scale = inner_instance_list["scale"].AsVector3();
|
Vector3 scale = inner_instance_list["scale"].AsVector3();
|
||||||
Quaternion rotation = inner_instance_list["rotation"].AsQuaternion();
|
Quaternion rotation = inner_instance_list["rotation"].AsQuaternion();
|
||||||
|
|
||||||
|
// no longer used - begin ------------------------
|
||||||
// int physicsShapeType = inner_instance_list["physics_shape_type"].AsInteger();
|
// int physicsShapeType = inner_instance_list["physics_shape_type"].AsInteger();
|
||||||
// int material = inner_instance_list["material"].AsInteger();
|
// int material = inner_instance_list["material"].AsInteger();
|
||||||
// int mesh = inner_instance_list["mesh"].AsInteger();
|
// int mesh = inner_instance_list["mesh"].AsInteger();
|
||||||
|
|
||||||
OSDMap permissions = (OSDMap)inner_instance_list["permissions"];
|
// OSDMap permissions = (OSDMap)inner_instance_list["permissions"];
|
||||||
int base_mask = permissions["base_mask"].AsInteger();
|
// int base_mask = permissions["base_mask"].AsInteger();
|
||||||
int everyone_mask = permissions["everyone_mask"].AsInteger();
|
// int everyone_mask = permissions["everyone_mask"].AsInteger();
|
||||||
UUID creator_id = permissions["creator_id"].AsUUID();
|
// UUID creator_id = permissions["creator_id"].AsUUID();
|
||||||
UUID group_id = permissions["group_id"].AsUUID();
|
// UUID group_id = permissions["group_id"].AsUUID();
|
||||||
int group_mask = permissions["group_mask"].AsInteger();
|
// int group_mask = permissions["group_mask"].AsInteger();
|
||||||
// bool is_owner_group = permissions["is_owner_group"].AsBoolean();
|
// bool is_owner_group = permissions["is_owner_group"].AsBoolean();
|
||||||
// UUID last_owner_id = permissions["last_owner_id"].AsUUID();
|
// UUID last_owner_id = permissions["last_owner_id"].AsUUID();
|
||||||
int next_owner_mask = permissions["next_owner_mask"].AsInteger();
|
// int next_owner_mask = permissions["next_owner_mask"].AsInteger();
|
||||||
UUID owner_id = permissions["owner_id"].AsUUID();
|
// UUID owner_id = permissions["owner_id"].AsUUID();
|
||||||
int owner_mask = permissions["owner_mask"].AsInteger();
|
// int owner_mask = permissions["owner_mask"].AsInteger();
|
||||||
|
// no longer used - end ------------------------
|
||||||
|
|
||||||
|
UUID owner_id = m_HostCapsObj.AgentID;
|
||||||
|
|
||||||
SceneObjectPart prim
|
SceneObjectPart prim
|
||||||
= new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero);
|
= new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero);
|
||||||
|
@ -619,19 +623,19 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
rotations.Add(rotation);
|
rotations.Add(rotation);
|
||||||
positions.Add(position);
|
positions.Add(position);
|
||||||
prim.UUID = UUID.Random();
|
prim.UUID = UUID.Random();
|
||||||
prim.CreatorID = creator_id;
|
prim.CreatorID = owner_id;
|
||||||
prim.OwnerID = owner_id;
|
prim.OwnerID = owner_id;
|
||||||
prim.GroupID = group_id;
|
prim.GroupID = UUID.Zero;
|
||||||
prim.LastOwnerID = prim.OwnerID;
|
prim.LastOwnerID = prim.OwnerID;
|
||||||
prim.CreationDate = Util.UnixTimeSinceEpoch();
|
prim.CreationDate = Util.UnixTimeSinceEpoch();
|
||||||
prim.Name = assetName;
|
prim.Name = assetName;
|
||||||
prim.Description = "";
|
prim.Description = "";
|
||||||
|
|
||||||
prim.BaseMask = (uint)base_mask;
|
// prim.BaseMask = (uint)base_mask;
|
||||||
prim.EveryoneMask = (uint)everyone_mask;
|
// prim.EveryoneMask = (uint)everyone_mask;
|
||||||
prim.GroupMask = (uint)group_mask;
|
// prim.GroupMask = (uint)group_mask;
|
||||||
prim.NextOwnerMask = (uint)next_owner_mask;
|
// prim.NextOwnerMask = (uint)next_owner_mask;
|
||||||
prim.OwnerMask = (uint)owner_mask;
|
// prim.OwnerMask = (uint)owner_mask;
|
||||||
|
|
||||||
if (grp == null)
|
if (grp == null)
|
||||||
grp = new SceneObjectGroup(prim);
|
grp = new SceneObjectGroup(prim);
|
||||||
|
|
|
@ -0,0 +1,149 @@
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
using System.Reflection;
|
||||||
|
using log4net;
|
||||||
|
using Nini.Config;
|
||||||
|
using Mono.Addins;
|
||||||
|
using OpenMetaverse;
|
||||||
|
using OpenMetaverse.StructuredData;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Framework.Servers.HttpServer;
|
||||||
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Services.Interfaces;
|
||||||
|
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// MeshUploadFlag capability. This is required for uploading Mesh.
|
||||||
|
/// </summary>
|
||||||
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||||
|
public class MeshUploadFlagModule : INonSharedRegionModule
|
||||||
|
{
|
||||||
|
private static readonly ILog m_log =
|
||||||
|
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is this module enabled?
|
||||||
|
/// </summary>
|
||||||
|
public bool Enabled { get; private set; }
|
||||||
|
|
||||||
|
private Scene m_scene;
|
||||||
|
private UUID m_agentID;
|
||||||
|
|
||||||
|
#region ISharedRegionModule Members
|
||||||
|
|
||||||
|
public MeshUploadFlagModule()
|
||||||
|
{
|
||||||
|
Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Initialise(IConfigSource source)
|
||||||
|
{
|
||||||
|
IConfig config = source.Configs["Mesh"];
|
||||||
|
if (config == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Enabled = config.GetBoolean("AllowMeshUpload", Enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddRegion(Scene s)
|
||||||
|
{
|
||||||
|
if (!Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_scene = s;
|
||||||
|
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegion(Scene s)
|
||||||
|
{
|
||||||
|
if (!Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegionLoaded(Scene s)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PostInitialise()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Close() { }
|
||||||
|
|
||||||
|
public string Name { get { return "MeshUploadFlagModule"; } }
|
||||||
|
|
||||||
|
public Type ReplaceableInterface
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public void RegisterCaps(UUID agentID, Caps caps)
|
||||||
|
{
|
||||||
|
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag);
|
||||||
|
caps.RegisterHandler("MeshUploadFlag", reqHandler);
|
||||||
|
m_agentID = agentID;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Hashtable MeshUploadFlag(Hashtable mDhttpMethod)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[SIMULATOR FEATURES MODULE]: MeshUploadFlag request");
|
||||||
|
|
||||||
|
OSDMap data = new OSDMap();
|
||||||
|
ScenePresence sp = m_scene.GetScenePresence(m_agentID);
|
||||||
|
data["username"] = sp.Firstname + "." + sp.Lastname;
|
||||||
|
data["display_name_next_update"] = new OSDDate(DateTime.Now);
|
||||||
|
data["legacy_first_name"] = sp.Firstname;
|
||||||
|
data["mesh_upload_status"] = "valid";
|
||||||
|
data["display_name"] = sp.Firstname + " " + sp.Lastname;
|
||||||
|
data["legacy_last_name"] = sp.Lastname;
|
||||||
|
data["id"] = m_agentID;
|
||||||
|
data["is_display_name_default"] = true;
|
||||||
|
|
||||||
|
//Send back data
|
||||||
|
Hashtable responsedata = new Hashtable();
|
||||||
|
responsedata["int_response_code"] = 200;
|
||||||
|
responsedata["content_type"] = "text/plain";
|
||||||
|
responsedata["keepalive"] = false;
|
||||||
|
responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(data);
|
||||||
|
return responsedata;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -250,11 +250,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
case 0x40:
|
case 0x40:
|
||||||
pbs.ReadProjectionData(extraParam.ExtraParamData, 0);
|
pbs.ReadProjectionData(extraParam.ExtraParamData, 0);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
pbs.PathBegin = (ushort) obj.PathBegin;
|
pbs.PathBegin = (ushort) obj.PathBegin;
|
||||||
pbs.PathCurve = (byte) obj.PathCurve;
|
pbs.PathCurve = (byte) obj.PathCurve;
|
||||||
pbs.PathEnd = (ushort) obj.PathEnd;
|
pbs.PathEnd = (ushort) obj.PathEnd;
|
||||||
|
|
|
@ -7614,13 +7614,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||||
if (invAccess != null)
|
if (invAccess != null)
|
||||||
{
|
{
|
||||||
if (!invAccess.GetAgentInventoryItem(this, itemID, requestID))
|
if (!invAccess.CanGetAgentInventoryItem(this, itemID, requestID))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7634,7 +7634,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
|
AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
|
||||||
|
|
||||||
|
|
||||||
// m_log.Debug("upload request " + request.ToString());
|
// m_log.Debug("upload request " + request.ToString());
|
||||||
// m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString());
|
// m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString());
|
||||||
UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId);
|
UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId);
|
||||||
|
|
|
@ -53,7 +53,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum distance, in standard region units (256m) that an agent is allowed to transfer.
|
/// The maximum distance, in standard region units (256m) that an agent is allowed to transfer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int MaxTransferDistance { get; set; }
|
private int m_MaxTransferDistance = 4095;
|
||||||
|
public int MaxTransferDistance
|
||||||
|
{
|
||||||
|
get { return m_MaxTransferDistance; }
|
||||||
|
set { m_MaxTransferDistance = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected bool m_Enabled = false;
|
protected bool m_Enabled = false;
|
||||||
protected Scene m_aScene;
|
protected Scene m_aScene;
|
||||||
|
|
|
@ -1030,7 +1030,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
|
public virtual bool CanGetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
|
||||||
{
|
{
|
||||||
InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID);
|
InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID);
|
||||||
if (assetRequestItem == null)
|
if (assetRequestItem == null)
|
||||||
|
@ -1109,7 +1109,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
InventoryItemBase item = new InventoryItemBase(itemID, agentID);
|
InventoryItemBase item = new InventoryItemBase(itemID, agentID);
|
||||||
item = invService.GetItem(item);
|
item = invService.GetItem(item);
|
||||||
|
|
||||||
if (item.CreatorData != null && item.CreatorData != string.Empty)
|
if (item != null && item.CreatorData != null && item.CreatorData != string.Empty)
|
||||||
UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData);
|
UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
|
|
@ -284,9 +284,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
|
|
||||||
item = m_InventoryService.GetItem(item);
|
item = m_InventoryService.GetItem(item);
|
||||||
|
|
||||||
if (null == item)
|
// if (null == item)
|
||||||
m_log.ErrorFormat(
|
// m_log.ErrorFormat(
|
||||||
"[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}", requestedItemId);
|
// "[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}", requestedItemId);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,15 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
|
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
|
||||||
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);
|
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);
|
||||||
void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver);
|
void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver);
|
||||||
bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID);
|
|
||||||
|
/// <summary>
|
||||||
|
/// Does the client have sufficient permissions to retrieve the inventory item?
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="remoteClient"></param>
|
||||||
|
/// <param name="itemID"></param>
|
||||||
|
/// <param name="requestID"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
bool CanGetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID);
|
||||||
|
|
||||||
// Must be here because of textures in user's inventory
|
// Must be here because of textures in user's inventory
|
||||||
bool IsForeignUser(UUID userID, out string assetServerURL);
|
bool IsForeignUser(UUID userID, out string assetServerURL);
|
||||||
|
|
|
@ -1603,6 +1603,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="m_physicalPrim"></param>
|
/// <param name="m_physicalPrim"></param>
|
||||||
public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive, bool m_physicalPrim)
|
public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive, bool m_physicalPrim)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[SCENE OBJECT PART]: Applying physics to {0} {1} {2}", Name, LocalId, UUID);
|
||||||
|
|
||||||
bool isPhysical = (((rootObjectFlags & (uint) PrimFlags.Physics) != 0) && m_physicalPrim);
|
bool isPhysical = (((rootObjectFlags & (uint) PrimFlags.Physics) != 0) && m_physicalPrim);
|
||||||
bool isPhantom = ((rootObjectFlags & (uint) PrimFlags.Phantom) != 0);
|
bool isPhantom = ((rootObjectFlags & (uint) PrimFlags.Phantom) != 0);
|
||||||
|
|
||||||
|
@ -2974,7 +2976,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SculptTextureCallback(UUID textureID, AssetBase texture)
|
public void SculptTextureCallback(UUID textureID, AssetBase texture)
|
||||||
{
|
{
|
||||||
if (m_shape.SculptEntry)
|
if (m_shape.SculptEntry)
|
||||||
|
|
|
@ -1008,6 +1008,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
|
|
||||||
private static void ProcessShpSculptData(PrimitiveBaseShape shp, XmlTextReader reader)
|
private static void ProcessShpSculptData(PrimitiveBaseShape shp, XmlTextReader reader)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[SCENE OBJECT SERIALIZER]: Setting sculpt data length {0}", shp.SculptData.Length);
|
||||||
|
|
||||||
shp.SculptData = Convert.FromBase64String(reader.ReadElementString("SculptData"));
|
shp.SculptData = Convert.FromBase64String(reader.ReadElementString("SculptData"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -801,7 +801,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
// retain pathcurve
|
// retain pathcurve
|
||||||
shapeBlock.PathCurve = part.Shape.PathCurve;
|
shapeBlock.PathCurve = part.Shape.PathCurve;
|
||||||
|
|
||||||
part.Shape.SetSculptData((byte)type, sculptId);
|
part.Shape.SetSculptProperties((byte)type, sculptId);
|
||||||
part.Shape.SculptEntry = true;
|
part.Shape.SculptEntry = true;
|
||||||
part.UpdateShape(shapeBlock);
|
part.UpdateShape(shapeBlock);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,10 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
Vector3 size, Quaternion rotation, bool isPhysical)
|
Vector3 size, Quaternion rotation, bool isPhysical)
|
||||||
{
|
{
|
||||||
PhysicsActor ret = AddPrimShape(primName, pbs, position, size, rotation, isPhysical);
|
PhysicsActor ret = AddPrimShape(primName, pbs, position, size, rotation, isPhysical);
|
||||||
if (ret != null) ret.LocalID = localID;
|
|
||||||
|
if (ret != null)
|
||||||
|
ret.LocalID = localID;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[SCULPT]: Unable to create {0} directory: ", decodedSculptMapPath, e.Message);
|
m_log.WarnFormat("[SCULPT]: Unable to create {0} directory: ", decodedSculptMapPath, e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -156,7 +155,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a simple bounding box mesh for a complex input mesh
|
/// Creates a simple bounding box mesh for a complex input mesh
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -193,7 +191,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
m_log.Error(message);
|
m_log.Error(message);
|
||||||
m_log.Error("\nPrim Name: " + primName);
|
m_log.Error("\nPrim Name: " + primName);
|
||||||
m_log.Error("****** PrimMesh Parameters ******\n" + primMesh.ParamsToDisplayString());
|
m_log.Error("****** PrimMesh Parameters ******\n" + primMesh.ParamsToDisplayString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ulong GetMeshKey(PrimitiveBaseShape pbs, Vector3 size, float lod)
|
private ulong GetMeshKey(PrimitiveBaseShape pbs, Vector3 size, float lod)
|
||||||
|
@ -257,6 +254,52 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
return ((hash << 5) + hash) + (ulong)(c >> 8);
|
return ((hash << 5) + hash) + (ulong)(c >> 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a submesh to an existing list of coords and faces.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="subMeshData"></param>
|
||||||
|
/// <param name="size">Size of entire object</param>
|
||||||
|
/// <param name="coords"></param>
|
||||||
|
/// <param name="faces"></param>
|
||||||
|
private void AddSubMesh(OSDMap subMeshData, Vector3 size, List<Coord> coords, List<Face> faces)
|
||||||
|
{
|
||||||
|
// Console.WriteLine("subMeshMap for {0} - {1}", primName, Util.GetFormattedXml((OSD)subMeshMap));
|
||||||
|
|
||||||
|
// As per http://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format, some Mesh Level
|
||||||
|
// of Detail Blocks (maps) contain just a NoGeometry key to signal there is no
|
||||||
|
// geometry for this submesh.
|
||||||
|
if (subMeshData.ContainsKey("NoGeometry") && ((OSDBoolean)subMeshData["NoGeometry"]))
|
||||||
|
return;
|
||||||
|
|
||||||
|
OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshData["PositionDomain"])["Max"].AsVector3();
|
||||||
|
OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshData["PositionDomain"])["Min"].AsVector3();
|
||||||
|
ushort faceIndexOffset = (ushort)coords.Count;
|
||||||
|
|
||||||
|
byte[] posBytes = subMeshData["Position"].AsBinary();
|
||||||
|
for (int i = 0; i < posBytes.Length; i += 6)
|
||||||
|
{
|
||||||
|
ushort uX = Utils.BytesToUInt16(posBytes, i);
|
||||||
|
ushort uY = Utils.BytesToUInt16(posBytes, i + 2);
|
||||||
|
ushort uZ = Utils.BytesToUInt16(posBytes, i + 4);
|
||||||
|
|
||||||
|
Coord c = new Coord(
|
||||||
|
Utils.UInt16ToFloat(uX, posMin.X, posMax.X) * size.X,
|
||||||
|
Utils.UInt16ToFloat(uY, posMin.Y, posMax.Y) * size.Y,
|
||||||
|
Utils.UInt16ToFloat(uZ, posMin.Z, posMax.Z) * size.Z);
|
||||||
|
|
||||||
|
coords.Add(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] triangleBytes = subMeshData["TriangleList"].AsBinary();
|
||||||
|
for (int i = 0; i < triangleBytes.Length; i += 6)
|
||||||
|
{
|
||||||
|
ushort v1 = (ushort)(Utils.BytesToUInt16(triangleBytes, i) + faceIndexOffset);
|
||||||
|
ushort v2 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 2) + faceIndexOffset);
|
||||||
|
ushort v3 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 4) + faceIndexOffset);
|
||||||
|
Face f = new Face(v1, v2, v3);
|
||||||
|
faces.Add(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, Vector3 size, float lod)
|
private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, Vector3 size, float lod)
|
||||||
{
|
{
|
||||||
|
@ -304,6 +347,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
{
|
{
|
||||||
m_log.Error("[MESH]: Exception deserializing mesh asset header:" + e.ToString());
|
m_log.Error("[MESH]: Exception deserializing mesh asset header:" + e.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
start = data.Position;
|
start = data.Position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,9 +359,10 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
physicsParms = (OSDMap)map["physics_shape"]; // old asset format
|
physicsParms = (OSDMap)map["physics_shape"]; // old asset format
|
||||||
else if (map.ContainsKey("physics_mesh"))
|
else if (map.ContainsKey("physics_mesh"))
|
||||||
physicsParms = (OSDMap)map["physics_mesh"]; // new asset format
|
physicsParms = (OSDMap)map["physics_mesh"]; // new asset format
|
||||||
|
|
||||||
if (physicsParms == null)
|
if (physicsParms == null)
|
||||||
{
|
{
|
||||||
m_log.Warn("[Mesh]: no recognized physics mesh found in mesh asset");
|
m_log.Warn("[MESH]: no recognized physics mesh found in mesh asset");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,42 +411,13 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
// physics_shape is an array of OSDMaps, one for each submesh
|
// physics_shape is an array of OSDMaps, one for each submesh
|
||||||
if (decodedMeshOsd is OSDArray)
|
if (decodedMeshOsd is OSDArray)
|
||||||
{
|
{
|
||||||
|
// Console.WriteLine("decodedMeshOsd for {0} - {1}", primName, Util.GetFormattedXml(decodedMeshOsd));
|
||||||
|
|
||||||
decodedMeshOsdArray = (OSDArray)decodedMeshOsd;
|
decodedMeshOsdArray = (OSDArray)decodedMeshOsd;
|
||||||
foreach (OSD subMeshOsd in decodedMeshOsdArray)
|
foreach (OSD subMeshOsd in decodedMeshOsdArray)
|
||||||
{
|
{
|
||||||
if (subMeshOsd is OSDMap)
|
if (subMeshOsd is OSDMap)
|
||||||
{
|
AddSubMesh(subMeshOsd as OSDMap, size, coords, faces);
|
||||||
OSDMap subMeshMap = (OSDMap)subMeshOsd;
|
|
||||||
|
|
||||||
OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3();
|
|
||||||
OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3();
|
|
||||||
ushort faceIndexOffset = (ushort)coords.Count;
|
|
||||||
|
|
||||||
byte[] posBytes = subMeshMap["Position"].AsBinary();
|
|
||||||
for (int i = 0; i < posBytes.Length; i += 6)
|
|
||||||
{
|
|
||||||
ushort uX = Utils.BytesToUInt16(posBytes, i);
|
|
||||||
ushort uY = Utils.BytesToUInt16(posBytes, i + 2);
|
|
||||||
ushort uZ = Utils.BytesToUInt16(posBytes, i + 4);
|
|
||||||
|
|
||||||
Coord c = new Coord(
|
|
||||||
Utils.UInt16ToFloat(uX, posMin.X, posMax.X) * size.X,
|
|
||||||
Utils.UInt16ToFloat(uY, posMin.Y, posMax.Y) * size.Y,
|
|
||||||
Utils.UInt16ToFloat(uZ, posMin.Z, posMax.Z) * size.Z);
|
|
||||||
|
|
||||||
coords.Add(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary();
|
|
||||||
for (int i = 0; i < triangleBytes.Length; i += 6)
|
|
||||||
{
|
|
||||||
ushort v1 = (ushort)(Utils.BytesToUInt16(triangleBytes, i) + faceIndexOffset);
|
|
||||||
ushort v2 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 2) + faceIndexOffset);
|
|
||||||
ushort v3 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 4) + faceIndexOffset);
|
|
||||||
Face f = new Face(v1, v2, v3);
|
|
||||||
faces.Add(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -524,7 +540,6 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
|
|
||||||
profileBegin = 0.5f * profileBegin + 0.5f;
|
profileBegin = 0.5f * profileBegin + 0.5f;
|
||||||
profileEnd = 0.5f * profileEnd + 0.5f;
|
profileEnd = 0.5f * profileEnd + 0.5f;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int hollowSides = sides;
|
int hollowSides = sides;
|
||||||
|
@ -633,6 +648,7 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
Face f = faces[i];
|
Face f = faces[i];
|
||||||
mesh.Add(new Triangle(vertices[f.v1], vertices[f.v2], vertices[f.v3]));
|
mesh.Add(new Triangle(vertices[f.v1], vertices[f.v2], vertices[f.v3]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -643,6 +659,10 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
|
|
||||||
public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical)
|
public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical)
|
||||||
{
|
{
|
||||||
|
#if SPAM
|
||||||
|
m_log.DebugFormat("[MESH]: Creating mesh for {0}", primName);
|
||||||
|
#endif
|
||||||
|
|
||||||
Mesh mesh = null;
|
Mesh mesh = null;
|
||||||
ulong key = 0;
|
ulong key = 0;
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
* switch between 'VEHICLE' parameter use and general dynamics
|
* switch between 'VEHICLE' parameter use and general dynamics
|
||||||
* settings use.
|
* settings use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//#define SPAM
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -54,7 +57,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves.
|
/// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
public class OdePrim : PhysicsActor
|
public class OdePrim : PhysicsActor
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
@ -279,14 +281,14 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
public override bool Selected
|
public override bool Selected
|
||||||
{
|
{
|
||||||
set {
|
set
|
||||||
|
{
|
||||||
|
|
||||||
// This only makes the object not collidable if the object
|
// This only makes the object not collidable if the object
|
||||||
// is physical or the object is modified somehow *IN THE FUTURE*
|
// is physical or the object is modified somehow *IN THE FUTURE*
|
||||||
// without this, if an avatar selects prim, they can walk right
|
// without this, if an avatar selects prim, they can walk right
|
||||||
// through it while it's selected
|
// through it while it's selected
|
||||||
m_collisionscore = 0;
|
m_collisionscore = 0;
|
||||||
|
|
||||||
if ((m_isphysical && !_zeroFlag) || !value)
|
if ((m_isphysical && !_zeroFlag) || !value)
|
||||||
{
|
{
|
||||||
m_taintselected = value;
|
m_taintselected = value;
|
||||||
|
@ -297,7 +299,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
m_taintselected = value;
|
m_taintselected = value;
|
||||||
m_isSelected = value;
|
m_isSelected = value;
|
||||||
}
|
}
|
||||||
if (m_isSelected) disableBodySoft();
|
|
||||||
|
if (m_isSelected)
|
||||||
|
disableBodySoft();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,8 +328,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
//m_log.Warn("Setting Geom to: " + prim_geom);
|
//m_log.Warn("Setting Geom to: " + prim_geom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void enableBodySoft()
|
public void enableBodySoft()
|
||||||
{
|
{
|
||||||
if (!childPrim)
|
if (!childPrim)
|
||||||
|
@ -626,8 +628,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float taperX1;
|
float taperX1;
|
||||||
float taperY1;
|
float taperY1;
|
||||||
float taperX;
|
float taperX;
|
||||||
|
@ -682,9 +682,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// else if (returnMass > _parent_scene.maximumMassObject)
|
// else if (returnMass > _parent_scene.maximumMassObject)
|
||||||
// returnMass = _parent_scene.maximumMassObject;
|
// returnMass = _parent_scene.maximumMassObject;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Recursively calculate mass
|
// Recursively calculate mass
|
||||||
bool HasChildPrim = false;
|
bool HasChildPrim = false;
|
||||||
lock (childrenPrim)
|
lock (childrenPrim)
|
||||||
|
@ -693,8 +690,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
{
|
{
|
||||||
HasChildPrim = true;
|
HasChildPrim = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasChildPrim)
|
if (HasChildPrim)
|
||||||
{
|
{
|
||||||
OdePrim[] childPrimArr = new OdePrim[0];
|
OdePrim[] childPrimArr = new OdePrim[0];
|
||||||
|
@ -711,10 +708,12 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (returnMass > _parent_scene.maximumMassObject)
|
if (returnMass > _parent_scene.maximumMassObject)
|
||||||
returnMass = _parent_scene.maximumMassObject;
|
returnMass = _parent_scene.maximumMassObject;
|
||||||
|
|
||||||
return returnMass;
|
return returnMass;
|
||||||
}// end CalculateMass
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -750,7 +749,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
|
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
d.BodyDestroy(Body);
|
d.BodyDestroy(Body);
|
||||||
lock (childrenPrim)
|
lock (childrenPrim)
|
||||||
{
|
{
|
||||||
|
@ -779,7 +777,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
|
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Body = IntPtr.Zero;
|
Body = IntPtr.Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -791,6 +788,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
public void setMesh(OdeScene parent_scene, IMesh mesh)
|
public void setMesh(OdeScene parent_scene, IMesh mesh)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[ODE PRIM]: Setting mesh on {0} to {1}", Name, mesh);
|
||||||
|
|
||||||
// This sleeper is there to moderate how long it takes between
|
// This sleeper is there to moderate how long it takes between
|
||||||
// setting up the mesh and pre-processing it when we get rapid fire mesh requests on a single object
|
// setting up the mesh and pre-processing it when we get rapid fire mesh requests on a single object
|
||||||
|
|
||||||
|
@ -860,7 +859,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
public void ProcessTaints(float timestep)
|
public void ProcessTaints(float timestep)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("ProcessTaints for " + Name);
|
Console.WriteLine("ProcessTaints for " + Name);
|
||||||
if (m_taintadd)
|
if (m_taintadd)
|
||||||
{
|
{
|
||||||
changeadd(timestep);
|
changeadd(timestep);
|
||||||
|
@ -887,19 +886,15 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
rotate(timestep);
|
rotate(timestep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
|
|
||||||
if (m_taintPhysics != m_isphysical && !(m_taintparent != _parent))
|
if (m_taintPhysics != m_isphysical && !(m_taintparent != _parent))
|
||||||
changePhysicsStatus(timestep);
|
changePhysicsStatus(timestep);
|
||||||
//
|
|
||||||
|
|
||||||
if (!_size.ApproxEquals(m_taintsize,0f))
|
if (!_size.ApproxEquals(m_taintsize, 0f))
|
||||||
changesize(timestep);
|
changesize(timestep);
|
||||||
//
|
|
||||||
|
|
||||||
if (m_taintshape)
|
if (m_taintshape)
|
||||||
changeshape(timestep);
|
changeshape(timestep);
|
||||||
//
|
|
||||||
|
|
||||||
if (m_taintforce)
|
if (m_taintforce)
|
||||||
changeAddForce(timestep);
|
changeAddForce(timestep);
|
||||||
|
@ -927,7 +922,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
if (!m_angularlock.ApproxEquals(m_taintAngularLock,0f))
|
if (!m_angularlock.ApproxEquals(m_taintAngularLock,0f))
|
||||||
changeAngularLock(timestep);
|
changeAngularLock(timestep);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -935,7 +929,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void changeAngularLock(float timestep)
|
private void changeAngularLock(float timestep)
|
||||||
{
|
{
|
||||||
// do we have a Physical object?
|
// do we have a Physical object?
|
||||||
|
@ -963,7 +956,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
// Store this for later in case we get turned into a separate body
|
// Store this for later in case we get turned into a separate body
|
||||||
m_angularlock = m_taintAngularLock;
|
m_angularlock = m_taintAngularLock;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changelink(float timestep)
|
private void changelink(float timestep)
|
||||||
|
@ -1102,7 +1094,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
m_log.DebugFormat("[PHYSICS]: {0} ain't got no boooooooooddy, no body", Name);
|
m_log.DebugFormat("[PHYSICS]: {0} ain't got no boooooooooddy, no body", Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
prm.m_interpenetrationcount = 0;
|
prm.m_interpenetrationcount = 0;
|
||||||
prm.m_collisionscore = 0;
|
prm.m_collisionscore = 0;
|
||||||
prm.m_disabled = false;
|
prm.m_disabled = false;
|
||||||
|
@ -1162,7 +1153,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChildSetGeom(OdePrim odePrim)
|
private void ChildSetGeom(OdePrim odePrim)
|
||||||
|
@ -1224,16 +1214,11 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
childrenPrim.Remove(odePrim);
|
childrenPrim.Remove(odePrim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (Body != IntPtr.Zero)
|
if (Body != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
_parent_scene.remActivePrim(this);
|
_parent_scene.remActivePrim(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lock (childrenPrim)
|
lock (childrenPrim)
|
||||||
{
|
{
|
||||||
foreach (OdePrim prm in childrenPrim)
|
foreach (OdePrim prm in childrenPrim)
|
||||||
|
@ -1242,8 +1227,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
ParentPrim(prm);
|
ParentPrim(prm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeSelectedStatus(float timestep)
|
private void changeSelectedStatus(float timestep)
|
||||||
|
@ -1398,7 +1381,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_parent_scene.waitForSpaceUnlock(m_targetSpace);
|
_parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||||
|
@ -1438,10 +1420,11 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lock (_parent_scene.OdeLock)
|
lock (_parent_scene.OdeLock)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("changeadd 1");
|
#if SPAM
|
||||||
|
Console.WriteLine("changeadd 1");
|
||||||
|
#endif
|
||||||
CreateGeom(m_targetSpace, _mesh);
|
CreateGeom(m_targetSpace, _mesh);
|
||||||
|
|
||||||
if (prim_geom != IntPtr.Zero)
|
if (prim_geom != IntPtr.Zero)
|
||||||
|
@ -1685,12 +1668,10 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
PID_G = m_PIDTau + 1;
|
PID_G = m_PIDTau + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Where are we, and where are we headed?
|
// Where are we, and where are we headed?
|
||||||
d.Vector3 pos = d.BodyGetPosition(Body);
|
d.Vector3 pos = d.BodyGetPosition(Body);
|
||||||
d.Vector3 vel = d.BodyGetLinearVel(Body);
|
d.Vector3 vel = d.BodyGetLinearVel(Body);
|
||||||
|
|
||||||
|
|
||||||
// Non-Vehicles have a limited set of Hover options.
|
// Non-Vehicles have a limited set of Hover options.
|
||||||
// determine what our target height really is based on HoverType
|
// determine what our target height really is based on HoverType
|
||||||
switch (m_PIDHoverType)
|
switch (m_PIDHoverType)
|
||||||
|
@ -1796,8 +1777,6 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void rotate(float timestep)
|
public void rotate(float timestep)
|
||||||
{
|
{
|
||||||
d.Quaternion myrot = new d.Quaternion();
|
d.Quaternion myrot = new d.Quaternion();
|
||||||
|
@ -1908,6 +1887,9 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
|
|
||||||
public void changesize(float timestamp)
|
public void changesize(float timestamp)
|
||||||
{
|
{
|
||||||
|
#if SPAM
|
||||||
|
m_log.DebugFormat("[ODE PRIM]: Called changesize");
|
||||||
|
#endif
|
||||||
|
|
||||||
string oldname = _parent_scene.geom_name_map[prim_geom];
|
string oldname = _parent_scene.geom_name_map[prim_geom];
|
||||||
|
|
||||||
|
@ -1918,8 +1900,9 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
// Cleanup of old prim geometry
|
// Cleanup of old prim geometry
|
||||||
if (_mesh != null)
|
if (_mesh != null)
|
||||||
{
|
{
|
||||||
// Cleanup meshing here
|
// TODO: Cleanup meshing here
|
||||||
}
|
}
|
||||||
|
|
||||||
//kill body to rebuild
|
//kill body to rebuild
|
||||||
if (IsPhysical && Body != IntPtr.Zero)
|
if (IsPhysical && Body != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
|
@ -1936,11 +1919,13 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
disableBody();
|
disableBody();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d.SpaceQuery(m_targetSpace, prim_geom))
|
if (d.SpaceQuery(m_targetSpace, prim_geom))
|
||||||
{
|
{
|
||||||
_parent_scene.waitForSpaceUnlock(m_targetSpace);
|
_parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||||
d.SpaceRemove(m_targetSpace, prim_geom);
|
d.SpaceRemove(m_targetSpace, prim_geom);
|
||||||
}
|
}
|
||||||
|
|
||||||
d.GeomDestroy(prim_geom);
|
d.GeomDestroy(prim_geom);
|
||||||
prim_geom = IntPtr.Zero;
|
prim_geom = IntPtr.Zero;
|
||||||
// we don't need to do space calculation because the client sends a position update also.
|
// we don't need to do space calculation because the client sends a position update also.
|
||||||
|
@ -1960,15 +1945,19 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
||||||
|
|
||||||
//IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
//IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
||||||
//Console.WriteLine("changesize 1");
|
#if SPAM
|
||||||
|
Console.WriteLine("changesize 1");
|
||||||
|
#endif
|
||||||
CreateGeom(m_targetSpace, mesh);
|
CreateGeom(m_targetSpace, mesh);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_mesh = null;
|
_mesh = null;
|
||||||
//Console.WriteLine("changesize 2");
|
|
||||||
|
#if SPAM
|
||||||
|
Console.WriteLine("changesize 2");
|
||||||
|
#endif
|
||||||
|
|
||||||
CreateGeom(m_targetSpace, _mesh);
|
CreateGeom(m_targetSpace, _mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2004,8 +1993,6 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
m_taintsize = _size;
|
m_taintsize = _size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void changefloatonwater(float timestep)
|
public void changefloatonwater(float timestep)
|
||||||
{
|
{
|
||||||
m_collidesWater = m_taintCollidesWater;
|
m_collidesWater = m_taintCollidesWater;
|
||||||
|
@ -2053,6 +2040,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
prim_geom = IntPtr.Zero;
|
prim_geom = IntPtr.Zero;
|
||||||
m_log.ErrorFormat("[PHYSICS]: PrimGeom dead for {0}", Name);
|
m_log.ErrorFormat("[PHYSICS]: PrimGeom dead for {0}", Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
prim_geom = IntPtr.Zero;
|
prim_geom = IntPtr.Zero;
|
||||||
// we don't need to do space calculation because the client sends a position update also.
|
// we don't need to do space calculation because the client sends a position update also.
|
||||||
if (_size.X <= 0) _size.X = 0.01f;
|
if (_size.X <= 0) _size.X = 0.01f;
|
||||||
|
@ -2062,7 +2050,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
|
|
||||||
if (_parent_scene.needsMeshing(_pbs))
|
if (_parent_scene.needsMeshing(_pbs))
|
||||||
{
|
{
|
||||||
// Don't need to re-enable body.. it's done in SetMesh
|
// Don't need to re-enable body.. it's done in CreateMesh
|
||||||
float meshlod = _parent_scene.meshSculptLOD;
|
float meshlod = _parent_scene.meshSculptLOD;
|
||||||
|
|
||||||
if (IsPhysical)
|
if (IsPhysical)
|
||||||
|
@ -2070,12 +2058,18 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
|
|
||||||
IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
||||||
// createmesh returns null when it doesn't mesh.
|
// createmesh returns null when it doesn't mesh.
|
||||||
|
#if SPAM
|
||||||
|
Console.WriteLine("changeshape needed meshing");
|
||||||
|
#endif
|
||||||
CreateGeom(m_targetSpace, mesh);
|
CreateGeom(m_targetSpace, mesh);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_mesh = null;
|
_mesh = null;
|
||||||
//Console.WriteLine("changeshape");
|
|
||||||
|
#if SPAM
|
||||||
|
Console.WriteLine("changeshape not need meshing");
|
||||||
|
#endif
|
||||||
CreateGeom(m_targetSpace, null);
|
CreateGeom(m_targetSpace, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2160,11 +2154,8 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_taintforce = false;
|
m_taintforce = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void changeSetTorque(float timestamp)
|
public void changeSetTorque(float timestamp)
|
||||||
{
|
{
|
||||||
if (!m_isSelected)
|
if (!m_isSelected)
|
||||||
|
@ -2833,7 +2824,6 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
|
|
||||||
public override float APIDDamping{ set { return; } }
|
public override float APIDDamping{ set { return; } }
|
||||||
|
|
||||||
|
|
||||||
private void createAMotor(Vector3 axis)
|
private void createAMotor(Vector3 axis)
|
||||||
{
|
{
|
||||||
if (Body == IntPtr.Zero)
|
if (Body == IntPtr.Zero)
|
||||||
|
@ -2953,7 +2943,6 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
//d.JointSetAMotorParam(Amotor, (int) dParam.Vel, 9000f);
|
//d.JointSetAMotorParam(Amotor, (int) dParam.Vel, 9000f);
|
||||||
d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f);
|
d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f);
|
||||||
d.JointSetAMotorParam(Amotor, (int)dParam.FMax, Mass * 50f);//
|
d.JointSetAMotorParam(Amotor, (int)dParam.FMax, Mass * 50f);//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Matrix4 FromDMass(d.Mass pMass)
|
public Matrix4 FromDMass(d.Mass pMass)
|
||||||
|
@ -3038,8 +3027,6 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
return Matrix4.Identity; // should probably throw an error. singluar matrix inverse not possible
|
return Matrix4.Identity; // should probably throw an error. singluar matrix inverse not possible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (Adjoint(pMat) / determinant3x3(pMat));
|
return (Adjoint(pMat) / determinant3x3(pMat));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3076,6 +3063,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
}
|
}
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return minor;
|
return minor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3178,7 +3166,6 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
|
|
||||||
det = diag1 + diag2 + diag3 - (diag4 + diag5 + diag6);
|
det = diag1 + diag2 + diag3 - (diag4 + diag5 + diag6);
|
||||||
return det;
|
return det;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DMassCopy(ref d.Mass src, ref d.Mass dst)
|
private static void DMassCopy(ref d.Mass src, ref d.Mass dst)
|
||||||
|
@ -3203,6 +3190,5 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
{
|
{
|
||||||
m_material = pMaterial;
|
m_material = pMaterial;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -7382,7 +7382,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
// retain pathcurve
|
// retain pathcurve
|
||||||
shapeBlock.PathCurve = part.Shape.PathCurve;
|
shapeBlock.PathCurve = part.Shape.PathCurve;
|
||||||
|
|
||||||
part.Shape.SetSculptData((byte)type, sculptId);
|
part.Shape.SetSculptProperties((byte)type, sculptId);
|
||||||
part.Shape.SculptEntry = true;
|
part.Shape.SculptEntry = true;
|
||||||
part.UpdateShape(shapeBlock);
|
part.UpdateShape(shapeBlock);
|
||||||
}
|
}
|
||||||
|
@ -7945,7 +7945,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID[] anims;
|
UUID[] anims;
|
||||||
anims = av.Animator.GetAnimationArray();
|
anims = av.Animator.GetAnimationArray();
|
||||||
foreach (UUID foo in anims)
|
foreach (UUID foo in anims)
|
||||||
l.Add(foo.ToString());
|
l.Add(new LSL_Key(foo.ToString()));
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8551,17 +8551,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
break;
|
break;
|
||||||
case (int)ScriptBaseClass.PRIM_TEXT:
|
case (int)ScriptBaseClass.PRIM_TEXT:
|
||||||
Color4 textColor = part.GetTextColor();
|
Color4 textColor = part.GetTextColor();
|
||||||
res.Add(part.Text);
|
res.Add(new LSL_String(part.Text));
|
||||||
res.Add(new LSL_Vector(textColor.R,
|
res.Add(new LSL_Vector(textColor.R,
|
||||||
textColor.G,
|
textColor.G,
|
||||||
textColor.B));
|
textColor.B));
|
||||||
res.Add(new LSL_Float(textColor.A));
|
res.Add(new LSL_Float(textColor.A));
|
||||||
break;
|
break;
|
||||||
case (int)ScriptBaseClass.PRIM_NAME:
|
case (int)ScriptBaseClass.PRIM_NAME:
|
||||||
res.Add(part.Name);
|
res.Add(new LSL_String(part.Name));
|
||||||
break;
|
break;
|
||||||
case (int)ScriptBaseClass.PRIM_DESC:
|
case (int)ScriptBaseClass.PRIM_DESC:
|
||||||
res.Add(part.Description);
|
res.Add(new LSL_String(part.Description));
|
||||||
break;
|
break;
|
||||||
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
|
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
|
||||||
res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W));
|
res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W));
|
||||||
|
@ -10579,7 +10579,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
foreach (KeyValuePair<UUID, int> detectedParams in land.GetLandObjectOwners())
|
foreach (KeyValuePair<UUID, int> detectedParams in land.GetLandObjectOwners())
|
||||||
{
|
{
|
||||||
ret.Add(new LSL_String(detectedParams.Key.ToString()));
|
ret.Add(new LSL_String(detectedParams.Key.ToString()));
|
||||||
ret.Add(detectedParams.Value);
|
ret.Add(new LSL_Integer(detectedParams.Value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScriptSleep(2000);
|
ScriptSleep(2000);
|
||||||
|
@ -10629,25 +10629,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
switch (o.ToString())
|
switch (o.ToString())
|
||||||
{
|
{
|
||||||
case "0":
|
case "0":
|
||||||
ret = ret + new LSL_List(land.Name);
|
ret.Add(new LSL_String(land.Name));
|
||||||
break;
|
break;
|
||||||
case "1":
|
case "1":
|
||||||
ret = ret + new LSL_List(land.Description);
|
ret.Add(new LSL_String(land.Description));
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
ret = ret + new LSL_List(land.OwnerID.ToString());
|
ret.Add(new LSL_Key(land.OwnerID.ToString()));
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
ret = ret + new LSL_List(land.GroupID.ToString());
|
ret.Add(new LSL_Key(land.GroupID.ToString()));
|
||||||
break;
|
break;
|
||||||
case "4":
|
case "4":
|
||||||
ret = ret + new LSL_List(land.Area);
|
ret.Add(new LSL_Integer(land.Area));
|
||||||
break;
|
break;
|
||||||
case "5":
|
case "5":
|
||||||
ret = ret + new LSL_List(land.GlobalID);
|
ret.Add(new LSL_Key(land.GlobalID.ToString()));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = ret + new LSL_List(0);
|
ret.Add(new LSL_Integer(0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10679,10 +10679,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
switch (o.ToString())
|
switch (o.ToString())
|
||||||
{
|
{
|
||||||
case "1":
|
case "1":
|
||||||
ret.Add(av.Firstname + " " + av.Lastname);
|
ret.Add(new LSL_String(av.Firstname + " " + av.Lastname));
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
ret.Add("");
|
ret.Add(new LSL_String(""));
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
ret.Add(new LSL_Vector((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z));
|
ret.Add(new LSL_Vector((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z));
|
||||||
|
@ -10694,13 +10694,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
ret.Add(new LSL_Vector(av.Velocity.X, av.Velocity.Y, av.Velocity.Z));
|
ret.Add(new LSL_Vector(av.Velocity.X, av.Velocity.Y, av.Velocity.Z));
|
||||||
break;
|
break;
|
||||||
case "6":
|
case "6":
|
||||||
ret.Add(id);
|
ret.Add(new LSL_String(id));
|
||||||
break;
|
break;
|
||||||
case "7":
|
case "7":
|
||||||
ret.Add(UUID.Zero.ToString());
|
ret.Add(new LSL_String(UUID.Zero.ToString()));
|
||||||
break;
|
break;
|
||||||
case "8":
|
case "8":
|
||||||
ret.Add(UUID.Zero.ToString());
|
ret.Add(new LSL_String(UUID.Zero.ToString()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10714,10 +10714,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
switch (o.ToString())
|
switch (o.ToString())
|
||||||
{
|
{
|
||||||
case "1":
|
case "1":
|
||||||
ret.Add(obj.Name);
|
ret.Add(new LSL_String(obj.Name));
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
ret.Add(obj.Description);
|
ret.Add(new LSL_String(obj.Description));
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z));
|
ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z));
|
||||||
|
@ -10729,13 +10729,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
ret.Add(new LSL_Vector(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z));
|
ret.Add(new LSL_Vector(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z));
|
||||||
break;
|
break;
|
||||||
case "6":
|
case "6":
|
||||||
ret.Add(obj.OwnerID.ToString());
|
ret.Add(new LSL_String(obj.OwnerID.ToString()));
|
||||||
break;
|
break;
|
||||||
case "7":
|
case "7":
|
||||||
ret.Add(obj.GroupID.ToString());
|
ret.Add(new LSL_String(obj.GroupID.ToString()));
|
||||||
break;
|
break;
|
||||||
case "8":
|
case "8":
|
||||||
ret.Add(obj.CreatorID.ToString());
|
ret.Add(new LSL_String(obj.CreatorID.ToString()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -820,7 +820,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
World.ForEachScenePresence(delegate(ScenePresence sp)
|
World.ForEachScenePresence(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (!sp.IsChildAgent)
|
if (!sp.IsChildAgent)
|
||||||
result.Add(sp.Name);
|
result.Add(new LSL_String(sp.Name));
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -2043,8 +2043,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
if (g.Success)
|
if (g.Success)
|
||||||
{
|
{
|
||||||
result.Add(g.Value);
|
result.Add(new LSL_String(g.Value));
|
||||||
result.Add(g.Index);
|
result.Add(new LSL_Integer(g.Index));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2378,8 +2378,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
if (avatar.IsChildAgent == false)
|
if (avatar.IsChildAgent == false)
|
||||||
{
|
{
|
||||||
result.Add(new LSL_Key(avatar.UUID.ToString()));
|
result.Add(new LSL_String(avatar.UUID.ToString()));
|
||||||
result.Add(new LSL_Vector(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z));
|
OpenMetaverse.Vector3 ap = avatar.AbsolutePosition;
|
||||||
|
result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z));
|
||||||
result.Add(new LSL_String(avatar.Name));
|
result.Add(new LSL_String(avatar.Name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,10 +84,19 @@ namespace OpenSim.Services.AssetService
|
||||||
if (assetLoaderEnabled)
|
if (assetLoaderEnabled)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs);
|
m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs);
|
||||||
m_AssetLoader.ForEachDefaultXmlAsset(loaderArgs,
|
|
||||||
|
m_AssetLoader.ForEachDefaultXmlAsset(
|
||||||
|
loaderArgs,
|
||||||
delegate(AssetBase a)
|
delegate(AssetBase a)
|
||||||
{
|
{
|
||||||
|
AssetBase existingAsset = Get(a.ID);
|
||||||
|
// AssetMetadata existingMetadata = GetMetadata(a.ID);
|
||||||
|
|
||||||
|
if (existingAsset == null || Util.SHA1Hash(existingAsset.Data) != Util.SHA1Hash(a.Data))
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[ASSET]: Storing {0} {1}", a.Name, a.ID);
|
||||||
Store(a);
|
Store(a);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Place .ini files here to have them picked up automatically
|
|
Loading…
Reference in New Issue