mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
Formatting cleanup.
This commit is contained in:
@@ -361,23 +361,23 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting
|
||||
vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis.
|
||||
*/
|
||||
|
||||
|
||||
/* How we arrived at this llEuler2Rot
|
||||
*
|
||||
*
|
||||
* Experiment in SL to determine conventions:
|
||||
* llEuler2Rot(<PI,0,0>)=<1,0,0,0>
|
||||
* llEuler2Rot(<0,PI,0>)=<0,1,0,0>
|
||||
* llEuler2Rot(<0,0,PI>)=<0,0,1,0>
|
||||
*
|
||||
*
|
||||
* Important facts about Quaternions
|
||||
* - multiplication is non-commutative (a*b != b*a)
|
||||
* - http://en.wikipedia.org/wiki/Quaternion#Basis_multiplication
|
||||
*
|
||||
*
|
||||
* Above SL experiment gives (c1,c2,c3,s1,s2,s3 as defined in our llEuler2Rot):
|
||||
* Qx = c1+i*s1
|
||||
* Qy = c2+j*s2;
|
||||
* Qz = c3+k*s3;
|
||||
*
|
||||
*
|
||||
* Rotations applied in order (from above) Z, Y, X
|
||||
* Q = (Qz * Qy) * Qx
|
||||
* ((c1+i*s1)*(c2+j*s2))*(c3+k*s3)
|
||||
@@ -389,23 +389,23 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
* y=j*(c1*s2*c3-s1*c2*s3)
|
||||
* z=k*(s1*s2*c3+c1*c2*s3)
|
||||
* s= c1*c2*c3-s1*s2*s3
|
||||
*
|
||||
*
|
||||
* This implementation agrees with the functions found here:
|
||||
* http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions
|
||||
* And with the results in SL.
|
||||
*
|
||||
*
|
||||
* It's also possible to calculate llEuler2Rot by direct multiplication of
|
||||
* the Qz, Qy, and Qx vectors (as above - and done in the "accurate" function
|
||||
* from the wiki).
|
||||
* Apparently in some cases this is better from a numerical precision perspective?
|
||||
*/
|
||||
* from the wiki).
|
||||
* Apparently in some cases this is better from a numerical precision perspective?
|
||||
*/
|
||||
|
||||
public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
double x,y,z,s;
|
||||
|
||||
|
||||
double c1 = Math.Cos(v.x/2.0);
|
||||
double c2 = Math.Cos(v.y/2.0);
|
||||
double c3 = Math.Cos(v.z/2.0);
|
||||
@@ -417,7 +417,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
y = c1*s2*c3-s1*c2*s3;
|
||||
z = s1*s2*c3+c1*c2*s3;
|
||||
s = c1*c2*c3-s1*s2*s3;
|
||||
|
||||
|
||||
return new LSL_Types.Quaternion(x, y, z, s);
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
double x,y,z,s;
|
||||
int f=0;
|
||||
// Important Note: q1=<x,y,z,s> is equal to q2=<-x,-y,-z,-s>
|
||||
// Computing quaternion x,y,z,s values
|
||||
// Computing quaternion x,y,z,s values
|
||||
x = ((fwd.x - left.y - up.z + 1) / 4);
|
||||
x *= x;
|
||||
x = Math.Sqrt(Math.Sqrt(x));
|
||||
@@ -441,7 +441,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
s *= s;
|
||||
s = Math.Sqrt(Math.Sqrt(s));
|
||||
|
||||
// Set f for signs detection
|
||||
// Set f for signs detection
|
||||
if (fwd.y+left.x >= 0){f+=1;}
|
||||
if (fwd.z+up.x >= 0){f+=2;}
|
||||
if (left.z-up.y >= 0){f+=4;}
|
||||
@@ -510,7 +510,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
x = 2 * (r.x * r.y - r.z * r.s);
|
||||
y = -r.x * r.x + r.y * r.y - r.z * r.z + r.s * r.s;
|
||||
z = 2 * (r.x * r.s + r.y * r.z);
|
||||
return (new LSL_Types.Vector3(x, y, z));
|
||||
return (new LSL_Types.Vector3(x, y, z));
|
||||
}
|
||||
|
||||
public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r)
|
||||
@@ -536,7 +536,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
z = -r.x * r.x - r.y * r.y + r.z * r.z + r.s * r.s;
|
||||
return (new LSL_Types.Vector3(x, y, z));
|
||||
}
|
||||
|
||||
|
||||
public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
|
||||
{
|
||||
//A and B should both be normalized
|
||||
@@ -1215,7 +1215,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
/// <summary>
|
||||
/// Set flexi parameters of a part.
|
||||
///
|
||||
///
|
||||
/// FIXME: Much of this code should probably be within the part itself.
|
||||
/// </summary>
|
||||
/// <param name="part"></param>
|
||||
@@ -1226,7 +1226,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
/// <param name="wind"></param>
|
||||
/// <param name="tension"></param>
|
||||
/// <param name="Force"></param>
|
||||
private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
|
||||
private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
|
||||
float wind, float tension, LSL_Types.Vector3 Force)
|
||||
{
|
||||
if (part == null)
|
||||
@@ -1239,7 +1239,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
needs_fakedelete = true;
|
||||
}
|
||||
part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do
|
||||
part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do
|
||||
// work once the prim is already flexi
|
||||
part.Shape.FlexiSoftness = softness;
|
||||
part.Shape.FlexiGravity = gravity;
|
||||
@@ -1265,7 +1265,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if (needs_fakedelete)
|
||||
{
|
||||
if (part.ParentGroup != null)
|
||||
{
|
||||
{
|
||||
part.ParentGroup.FakeDeleteGroup();
|
||||
}
|
||||
}
|
||||
@@ -1276,7 +1276,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
/// <summary>
|
||||
/// Set a light point on a part
|
||||
///
|
||||
///
|
||||
/// FIXME: Much of this code should probably be in SceneObjectGroup
|
||||
/// </summary>
|
||||
/// <param name="part"></param>
|
||||
@@ -1781,7 +1781,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.SoundGain = volume;
|
||||
m_host.SoundFlags = 1; // looping
|
||||
m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable?
|
||||
|
||||
|
||||
m_host.ScheduleFullUpdate();
|
||||
m_host.SendFullUpdateToAllClients();
|
||||
}
|
||||
@@ -2908,13 +2908,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
bool found = false;
|
||||
LLUUID destId = LLUUID.Zero;
|
||||
LLUUID objId = LLUUID.Zero;
|
||||
|
||||
|
||||
if (!LLUUID.TryParse(destination, out destId))
|
||||
{
|
||||
llSay(0, "Could not parse key " + destination);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// move the first object found with this inventory name
|
||||
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
@@ -2931,7 +2931,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
llSay(0, String.Format("Could not find object '{0}'", inventory));
|
||||
throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory));
|
||||
}
|
||||
|
||||
|
||||
// check if destination is an avatar
|
||||
if (World.GetScenePresence(destId) != null)
|
||||
{
|
||||
@@ -2993,7 +2993,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
LLUUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest(
|
||||
m_localID, m_itemID, item.AssetID.ToString());
|
||||
|
||||
|
||||
LLVector3 region = new LLVector3(
|
||||
World.RegionInfo.RegionLocX * Constants.RegionSize,
|
||||
World.RegionInfo.RegionLocY * Constants.RegionSize,
|
||||
@@ -4155,13 +4155,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if (LLUUID.TryParse(id,out key))
|
||||
{
|
||||
ScenePresence presence = World.GetScenePresence(key);
|
||||
|
||||
|
||||
if (presence != null)
|
||||
{
|
||||
return presence.ControllingClient.Name;
|
||||
//return presence.Name;
|
||||
}
|
||||
|
||||
|
||||
if (World.GetSceneObjectPart(key) != null)
|
||||
{
|
||||
return World.GetSceneObjectPart(key).Name;
|
||||
@@ -4516,7 +4516,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues()
|
||||
{
|
||||
Primitive.ParticleSystem ps = new Primitive.ParticleSystem();
|
||||
|
||||
|
||||
// TODO find out about the other defaults and add them here
|
||||
ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
@@ -4530,7 +4530,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
ps.PartMaxAge = 10.0f;
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
||||
public void llParticleSystem(LSL_Types.list rules)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
@@ -4725,7 +4725,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
itemList.Add(itemID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (itemList.Count == 0)
|
||||
return;
|
||||
|
||||
@@ -4973,7 +4973,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public void llSetRemoteScriptAccessPin(int pin)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
|
||||
m_host.ScriptAccessPin = pin;
|
||||
}
|
||||
|
||||
@@ -4983,19 +4983,19 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
bool found = false;
|
||||
LLUUID destId = LLUUID.Zero;
|
||||
LLUUID srcId = LLUUID.Zero;
|
||||
|
||||
|
||||
if (!LLUUID.TryParse(target, out destId))
|
||||
{
|
||||
llSay(0, "Could not parse key " + target);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// target must be a different prim than the one containing the script
|
||||
if (m_host.UUID == destId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// copy the first script found with this inventory name
|
||||
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
@@ -5010,13 +5010,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!found)
|
||||
{
|
||||
llSay(0, "Could not find script " + name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// the rest of the permission checks are done in RezScript, so check the pin there as well
|
||||
World.RezScript(srcId, m_host, destId, pin, running, start_param);
|
||||
// this will cause the delay even if the script pin or permissions were wrong - seems ok
|
||||
@@ -5066,11 +5066,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.AddScriptLPS(1);
|
||||
return Util.Md5Hash(src + ":" + nonce.ToString());
|
||||
}
|
||||
|
||||
|
||||
private ObjectShapePacket.ObjectDataBlock SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist)
|
||||
{
|
||||
ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
|
||||
|
||||
|
||||
if (holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_DEFAULT &&
|
||||
holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_CIRCLE &&
|
||||
holeshape != (int)BuiltIn_Commands_BaseClass.PRIM_HOLE_SQUARE &&
|
||||
@@ -5128,23 +5128,23 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
}
|
||||
shapeBlock.PathTwistBegin = (sbyte)(200 * twist.x);
|
||||
shapeBlock.PathTwist = (sbyte)(200 * twist.y);
|
||||
|
||||
|
||||
shapeBlock.ObjectLocalID = m_host.LocalId;
|
||||
|
||||
|
||||
// retain pathcurve
|
||||
shapeBlock.PathCurve = m_host.Shape.PathCurve;
|
||||
|
||||
shapeBlock.PathCurve = m_host.Shape.PathCurve;
|
||||
|
||||
return shapeBlock;
|
||||
}
|
||||
|
||||
|
||||
private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 taper_b, LSL_Types.Vector3 topshear, byte fudge)
|
||||
{
|
||||
ObjectShapePacket.ObjectDataBlock shapeBlock;
|
||||
|
||||
|
||||
shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist);
|
||||
|
||||
|
||||
shapeBlock.ProfileCurve += fudge;
|
||||
|
||||
|
||||
if (taper_b.x < 0f)
|
||||
{
|
||||
taper_b.x = 0f;
|
||||
@@ -5181,25 +5181,25 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
}
|
||||
shapeBlock.PathShearX = (byte)(100 * topshear.x);
|
||||
shapeBlock.PathShearY = (byte)(100 * topshear.y);
|
||||
|
||||
|
||||
m_host.UpdateShape(shapeBlock);
|
||||
}
|
||||
|
||||
|
||||
private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 dimple, byte fudge)
|
||||
{
|
||||
ObjectShapePacket.ObjectDataBlock shapeBlock;
|
||||
|
||||
|
||||
shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist);
|
||||
|
||||
|
||||
// profile/path swapped for a sphere
|
||||
shapeBlock.PathBegin = shapeBlock.ProfileBegin;
|
||||
shapeBlock.PathEnd = shapeBlock.ProfileEnd;
|
||||
|
||||
|
||||
shapeBlock.ProfileCurve += fudge;
|
||||
|
||||
|
||||
shapeBlock.PathScaleX = 100;
|
||||
shapeBlock.PathScaleY = 100;
|
||||
|
||||
|
||||
if (dimple.x < 0f)
|
||||
{
|
||||
dimple.x = 0f;
|
||||
@@ -5222,22 +5222,22 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
}
|
||||
shapeBlock.ProfileBegin = (ushort)(50000 * dimple.x);
|
||||
shapeBlock.ProfileEnd = (ushort)(50000 * (1 - dimple.y));
|
||||
|
||||
|
||||
m_host.UpdateShape(shapeBlock);
|
||||
}
|
||||
|
||||
|
||||
private void SetPrimitiveShapeParams(int holeshape, LSL_Types.Vector3 cut, float hollow, LSL_Types.Vector3 twist, LSL_Types.Vector3 holesize, LSL_Types.Vector3 topshear, LSL_Types.Vector3 profilecut, LSL_Types.Vector3 taper_a, float revolutions, float radiusoffset, float skew, byte fudge)
|
||||
{
|
||||
ObjectShapePacket.ObjectDataBlock shapeBlock;
|
||||
|
||||
|
||||
shapeBlock = SetPrimitiveShapeParams(holeshape, cut, hollow, twist);
|
||||
|
||||
|
||||
shapeBlock.ProfileCurve += fudge;
|
||||
|
||||
// profile/path swapped for a torrus, tube, ring
|
||||
shapeBlock.PathBegin = shapeBlock.ProfileBegin;
|
||||
shapeBlock.PathEnd = shapeBlock.ProfileEnd;
|
||||
|
||||
|
||||
if (holesize.x < 0.05f)
|
||||
{
|
||||
holesize.x = 0.05f;
|
||||
@@ -5342,15 +5342,15 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
skew = 0.95f;
|
||||
}
|
||||
shapeBlock.PathSkew = (sbyte)(100 * skew);
|
||||
|
||||
|
||||
m_host.UpdateShape(shapeBlock);
|
||||
}
|
||||
|
||||
|
||||
private void SetPrimitiveShapeParams(string map, int type)
|
||||
{
|
||||
ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
|
||||
LLUUID sculptId;
|
||||
|
||||
|
||||
if (!LLUUID.TryParse(map, out sculptId))
|
||||
{
|
||||
llSay(0, "Could not parse key " + map);
|
||||
@@ -5360,7 +5360,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
shapeBlock.ObjectLocalID = m_host.LocalId;
|
||||
shapeBlock.PathScaleX = 100;
|
||||
shapeBlock.PathScaleY = 150;
|
||||
|
||||
|
||||
if (type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_CYLINDER &&
|
||||
type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_PLANE &&
|
||||
type != (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE &&
|
||||
@@ -5369,7 +5369,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
// default
|
||||
type = (int)BuiltIn_Commands_BaseClass.PRIM_SCULPT_TYPE_SPHERE;
|
||||
}
|
||||
|
||||
|
||||
// retain pathcurve
|
||||
shapeBlock.PathCurve = m_host.Shape.PathCurve;
|
||||
|
||||
@@ -5422,7 +5422,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
v=new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
||||
SetScale(part, v);
|
||||
|
||||
|
||||
break;
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_ROTATION:
|
||||
if (remain < 1)
|
||||
@@ -5432,13 +5432,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
SetRot(part, q);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE:
|
||||
if (remain < 3)
|
||||
return;
|
||||
|
||||
|
||||
code = Convert.ToInt32(rules.Data[idx++]);
|
||||
|
||||
|
||||
remain = rules.Length - idx;
|
||||
float hollow;
|
||||
LSL_Types.Vector3 twist;
|
||||
@@ -5449,9 +5449,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
float skew;
|
||||
LSL_Types.Vector3 holesize;
|
||||
LSL_Types.Vector3 profilecut;
|
||||
|
||||
|
||||
switch (code)
|
||||
{
|
||||
{
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_BOX:
|
||||
if (remain < 6)
|
||||
return;
|
||||
@@ -5465,7 +5465,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.Shape.PathCurve = (byte) Extrusion.Straight;
|
||||
SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 1);
|
||||
break;
|
||||
|
||||
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_CYLINDER:
|
||||
if (remain < 6)
|
||||
return;
|
||||
@@ -5480,12 +5480,12 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.Shape.PathCurve = (byte) Extrusion.Straight;
|
||||
SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, topshear, 0);
|
||||
break;
|
||||
|
||||
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_PRISM:
|
||||
if (remain < 6)
|
||||
return;
|
||||
|
||||
face = Convert.ToInt32(rules.Data[idx++]); // holeshape
|
||||
face = Convert.ToInt32(rules.Data[idx++]); // holeshape
|
||||
v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
|
||||
hollow = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||
twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
||||
@@ -5507,12 +5507,12 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.Shape.PathCurve = (byte) Extrusion.Curve1;
|
||||
SetPrimitiveShapeParams(face, v, hollow, twist, taper_b, 5);
|
||||
break;
|
||||
|
||||
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TORUS:
|
||||
if (remain < 11)
|
||||
return;
|
||||
|
||||
face = Convert.ToInt32(rules.Data[idx++]); // holeshape
|
||||
face = Convert.ToInt32(rules.Data[idx++]); // holeshape
|
||||
v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
|
||||
hollow = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||
twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
||||
@@ -5526,12 +5526,12 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.Shape.PathCurve = (byte) Extrusion.Curve1;
|
||||
SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0);
|
||||
break;
|
||||
|
||||
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_TUBE:
|
||||
if (remain < 11)
|
||||
return;
|
||||
|
||||
face = Convert.ToInt32(rules.Data[idx++]); // holeshape
|
||||
face = Convert.ToInt32(rules.Data[idx++]); // holeshape
|
||||
v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
|
||||
hollow = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||
twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
||||
@@ -5545,12 +5545,12 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.Shape.PathCurve = (byte) Extrusion.Curve1;
|
||||
SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1);
|
||||
break;
|
||||
|
||||
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_RING:
|
||||
if (remain < 11)
|
||||
return;
|
||||
|
||||
face = Convert.ToInt32(rules.Data[idx++]); // holeshape
|
||||
face = Convert.ToInt32(rules.Data[idx++]); // holeshape
|
||||
v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); //cut
|
||||
hollow = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||
twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
|
||||
@@ -5564,7 +5564,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.Shape.PathCurve = (byte) Extrusion.Curve1;
|
||||
SetPrimitiveShapeParams(face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3);
|
||||
break;
|
||||
|
||||
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_TYPE_SCULPT:
|
||||
if (remain < 2)
|
||||
return;
|
||||
@@ -5575,7 +5575,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
SetPrimitiveShapeParams(map, face);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case (int)BuiltIn_Commands_BaseClass.PRIM_TEXTURE:
|
||||
@@ -5630,7 +5630,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
float intensity = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||
float radius = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||
float falloff = (float)Convert.ToDouble(rules.Data[idx++]);
|
||||
|
||||
|
||||
SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff);
|
||||
|
||||
break;
|
||||
@@ -5701,7 +5701,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public LSL_Types.list llGetAnimationList( string id )
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
|
||||
LSL_Types.list l = new LSL_Types.list();
|
||||
ScenePresence av = World.GetScenePresence(id);
|
||||
if (av == null)
|
||||
@@ -6560,7 +6560,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
IConfigSource config = new IniConfigSource(Application.iniFilePath);
|
||||
if (config.Configs["LL-Functions"] == null)
|
||||
config.AddConfig("LL-Functions");
|
||||
|
||||
|
||||
if (config.Configs["LL-Functions"].GetBoolean("AllowGodFunctions", false))
|
||||
{
|
||||
if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID))
|
||||
@@ -6829,7 +6829,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
//PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later)
|
||||
m_host.AddScriptLPS(1);
|
||||
for (int i = 0; i < commandList.Data.Length; i++)
|
||||
{
|
||||
{
|
||||
switch ((ParcelMediaCommandEnum)commandList.Data[i])
|
||||
{
|
||||
case ParcelMediaCommandEnum.Play:
|
||||
@@ -6839,7 +6839,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if (!agent.IsChildAgent)
|
||||
{
|
||||
agent.ControllingClient.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ParcelMediaCommandEnum.Stop:
|
||||
@@ -6870,7 +6870,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
//Set the new media URL only if the user is the owner of the land
|
||||
osSetParcelMediaURL(commandList.Data[i + 1].ToString());
|
||||
|
||||
|
||||
List<ScenePresence> scenePresenceList = World.GetScenePresences();
|
||||
LandData landData = World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
|
||||
//Send an update of the mediaURL to all the clients that are in the parcel
|
||||
@@ -6881,8 +6881,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
//Send parcel media update to the client
|
||||
agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, landData.MediaAutoScale, "", landData.Description, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -6892,7 +6892,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
NotImplemented("llParcelMediaCommandList parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType(), commandList.Data[i].ToString()).ToString());
|
||||
break;
|
||||
}//end switch
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6935,7 +6935,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public LSL_Types.LSLInteger llModPow(int a, int b, int c)
|
||||
@@ -6979,7 +6979,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
LLUUID invItemID=InventorySelf();
|
||||
if (invItemID == LLUUID.Zero)
|
||||
if (invItemID == LLUUID.Zero)
|
||||
return new LSL_Types.Vector3();
|
||||
if (m_host.TaskInventory[invItemID].PermsGranter == LLUUID.Zero)
|
||||
return new LSL_Types.Vector3();
|
||||
@@ -6989,7 +6989,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
return new LSL_Types.Vector3();
|
||||
}
|
||||
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
||||
if (presence != null)
|
||||
if (presence != null)
|
||||
{
|
||||
LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z);
|
||||
return pos;
|
||||
@@ -7111,8 +7111,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
public void llSetCameraParams(LSL_Types.list rules)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
// our key in the object we are in
|
||||
|
||||
// our key in the object we are in
|
||||
LLUUID invItemID=InventorySelf();
|
||||
if (invItemID == LLUUID.Zero) return;
|
||||
|
||||
@@ -7126,10 +7126,10 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
|
||||
|
||||
ScenePresence presence = World.GetScenePresence(agentID);
|
||||
|
||||
|
||||
// we are not interested in child-agents
|
||||
if (presence.IsChildAgent) return;
|
||||
|
||||
|
||||
SortedDictionary<int, float> parameters = new SortedDictionary<int, float>();
|
||||
object[] data = rules.Data;
|
||||
for (int i = 0; i < data.Length; ++i) {
|
||||
@@ -7142,8 +7142,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
case BuiltIn_Commands_BaseClass.CAMERA_FOCUS_OFFSET:
|
||||
case BuiltIn_Commands_BaseClass.CAMERA_POSITION:
|
||||
LSL_Types.Vector3 v = (LSL_Types.Vector3)data[i];
|
||||
parameters.Add(type + 1, (float)v.x);
|
||||
parameters.Add(type + 2, (float)v.y);
|
||||
parameters.Add(type + 1, (float)v.x);
|
||||
parameters.Add(type + 2, (float)v.y);
|
||||
parameters.Add(type + 3, (float)v.z);
|
||||
break;
|
||||
default:
|
||||
@@ -7163,7 +7163,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
// our key in the object we are in
|
||||
// our key in the object we are in
|
||||
LLUUID invItemID=InventorySelf();
|
||||
if (invItemID == LLUUID.Zero) return;
|
||||
|
||||
@@ -7177,10 +7177,10 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
|
||||
|
||||
ScenePresence presence = World.GetScenePresence(agentID);
|
||||
|
||||
|
||||
// we are not interested in child-agents
|
||||
if (presence.IsChildAgent) return;
|
||||
|
||||
|
||||
presence.ControllingClient.SendClearFollowCamProperties(objectID);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user