Added explicit Quaternion->string and list->string conversions.

Some preliminary work on llSetStatus and llGetStatus.
ThreadPoolClientBranch
alondria 2008-02-05 15:06:37 +00:00
parent 542cd417c8
commit 36f7a087e6
3 changed files with 116 additions and 2 deletions

View File

@ -1877,6 +1877,7 @@ namespace OpenSim.Region.ScriptEngine.Common
public const int STATUS_BLOCK_GRAB = 64; public const int STATUS_BLOCK_GRAB = 64;
public const int STATUS_DIE_AT_EDGE = 128; public const int STATUS_DIE_AT_EDGE = 128;
public const int STATUS_RETURN_AT_EDGE = 256; public const int STATUS_RETURN_AT_EDGE = 256;
public const int STATUS_CAST_SHADOWS = 512;
public const int AGENT = 1; public const int AGENT = 1;
public const int ACTIVE = 2; public const int ACTIVE = 2;
public const int PASSIVE = 4; public const int PASSIVE = 4;

View File

@ -425,13 +425,105 @@ namespace OpenSim.Region.ScriptEngine.Common
public void llSetStatus(int status, int value) public void llSetStatus(int status, int value)
{ {
NotImplemented("llSetStatus"); if ((status & LSL_BaseClass.STATUS_PHYSICS) == LSL_BaseClass.STATUS_PHYSICS)
{
m_host.AddFlag(LLObject.ObjectFlags.Physics);
}
if ((status & LSL_BaseClass.STATUS_PHANTOM) == LSL_BaseClass.STATUS_PHANTOM)
{
m_host.AddFlag(LLObject.ObjectFlags.Phantom);
}
if ((status & LSL_BaseClass.STATUS_CAST_SHADOWS) == LSL_BaseClass.STATUS_CAST_SHADOWS)
{
m_host.AddFlag(LLObject.ObjectFlags.CastShadows);
}
if ((status & LSL_BaseClass.STATUS_ROTATE_X) == LSL_BaseClass.STATUS_ROTATE_X)
{
NotImplemented("llSetStatus - STATUS_ROTATE_X");
}
if ((status & LSL_BaseClass.STATUS_ROTATE_Y) == LSL_BaseClass.STATUS_ROTATE_Y)
{
NotImplemented("llSetStatus - STATUS_ROTATE_Y");
}
if ((status & LSL_BaseClass.STATUS_ROTATE_Z) == LSL_BaseClass.STATUS_ROTATE_Z)
{
NotImplemented("llSetStatus - STATUS_ROTATE_Z");
}
if ((status & LSL_BaseClass.STATUS_BLOCK_GRAB) == LSL_BaseClass.STATUS_BLOCK_GRAB)
{
NotImplemented("llSetStatus - STATUS_BLOCK_GRAB");
}
if ((status & LSL_BaseClass.STATUS_DIE_AT_EDGE) == LSL_BaseClass.STATUS_DIE_AT_EDGE)
{
NotImplemented("llSetStatus - STATUS_DIE_AT_EDGE");
}
if ((status & LSL_BaseClass.STATUS_RETURN_AT_EDGE) == LSL_BaseClass.STATUS_RETURN_AT_EDGE)
{
NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE");
}
if ((status & LSL_BaseClass.STATUS_SANDBOX) == LSL_BaseClass.STATUS_SANDBOX)
{
NotImplemented("llSetStatus - STATUS_SANDBOX");
}
return; return;
} }
public int llGetStatus(int status) public int llGetStatus(int status)
{ {
NotImplemented("llGetStatus"); Console.WriteLine(m_host.UUID.ToString() + " status is " + m_host.ObjectFlags.ToString());
switch (status)
{
case LSL_BaseClass.STATUS_PHYSICS:
if ((m_host.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) == (uint)LLObject.ObjectFlags.Physics)
{
return 1;
}
return 0;
break;
case LSL_BaseClass.STATUS_PHANTOM:
if ((m_host.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == (uint)LLObject.ObjectFlags.Phantom)
{
return 1;
}
return 0;
break;
case LSL_BaseClass.STATUS_CAST_SHADOWS:
if ((m_host.ObjectFlags & (uint)LLObject.ObjectFlags.CastShadows) == (uint)LLObject.ObjectFlags.CastShadows)
{
return 1;
}
return 0;
break;
case LSL_BaseClass.STATUS_BLOCK_GRAB:
NotImplemented("llGetStatus - STATUS_BLOCK_GRAB");
return 0;
break;
case LSL_BaseClass.STATUS_DIE_AT_EDGE:
NotImplemented("llGetStatus - STATUS_DIE_AT_EDGE");
return 0;
break;
case LSL_BaseClass.STATUS_RETURN_AT_EDGE:
NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE");
return 0;
break;
case LSL_BaseClass.STATUS_ROTATE_X:
NotImplemented("llGetStatus - STATUS_ROTATE_X");
return 0;
break;
case LSL_BaseClass.STATUS_ROTATE_Y:
NotImplemented("llGetStatus - STATUS_ROTATE_Y");
return 0;
break;
case LSL_BaseClass.STATUS_ROTATE_Z:
NotImplemented("llGetStatus - STATUS_ROTATE_Z");
return 0;
break;
case LSL_BaseClass.STATUS_SANDBOX:
NotImplemented("llGetStatus - STATUS_SANDBOX");
return 0;
break;
}
NotImplemented("llGetStatus - Unknown Status parameter");
return 0; return 0;
} }

View File

@ -305,6 +305,11 @@ namespace OpenSim.Region.ScriptEngine.Common
return "<" + x.ToString() + ", " + y.ToString() + ", " + z.ToString() + ", " + s.ToString() + ">"; return "<" + x.ToString() + ", " + y.ToString() + ", " + z.ToString() + ", " + s.ToString() + ">";
} }
public static explicit operator string(Quaternion r)
{
return "<" + r.x.ToString() + ", " + r.y.ToString() + ", " + r.z.ToString() + ", " + r.s.ToString() + ">";
}
public static bool operator ==(Quaternion lhs, Quaternion rhs) public static bool operator ==(Quaternion lhs, Quaternion rhs)
{ {
// Return true if the fields match: // Return true if the fields match:
@ -454,6 +459,8 @@ namespace OpenSim.Region.ScriptEngine.Common
return output; return output;
} }
public override string ToString() public override string ToString()
{ {
string output; string output;
@ -470,6 +477,20 @@ namespace OpenSim.Region.ScriptEngine.Common
} }
public static explicit operator string(list l)
{
string output;
output = String.Empty;
if (l.m_data.Length == 0)
{
return String.Empty;
}
foreach (object o in l.m_data)
{
output = output + o.ToString();
}
return output;
}
} }
// //