本文整理汇总了C#中OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat类的典型用法代码示例。如果您正苦于以下问题:C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat类的具体用法?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat怎么用?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat类属于命名空间,在下文中一共展示了OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: osGetHealRate
public LSL_Float osGetHealRate(string avatar)
{
CheckThreatLevel(ThreatLevel.None, "osGetHealRate");
m_host.AddScriptLPS(1);
LSL_Float rate = new LSL_Float(0);
ScenePresence presence = World.GetScenePresence(new UUID(avatar));
if (presence != null)
rate = presence.HealRate;
return rate;
}
示例2: modInvokeL
public LSL_List modInvokeL(string fname, params object[] parms)
{
Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(object[]))
MODError(String.Format("return type mismatch for {0}",fname));
object[] result = (object[])modInvoke(fname,parms);
object[] llist = new object[result.Length];
for (int i = 0; i < result.Length; i++)
{
if (result[i] is string)
{
llist[i] = new LSL_String((string)result[i]);
}
else if (result[i] is int)
{
llist[i] = new LSL_Integer((int)result[i]);
}
else if (result[i] is float)
{
llist[i] = new LSL_Float((float)result[i]);
}
else if (result[i] is UUID)
{
llist[i] = new LSL_Key(result[i].ToString());
}
else if (result[i] is OpenMetaverse.Vector3)
{
OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i];
llist[i] = new LSL_Vector(vresult.X, vresult.Y, vresult.Z);
}
else if (result[i] is OpenMetaverse.Quaternion)
{
OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i];
llist[i] = new LSL_Rotation(qresult.X, qresult.Y, qresult.Z, qresult.W);
}
else
{
MODError(String.Format("unknown list element {1} returned by {0}", fname, result[i].GetType().Name));
}
}
return new LSL_List(llist);
}
示例3: osSetSpeed
public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
{
CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
m_host.AddScriptLPS(1);
ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
if (avatar != null)
avatar.SpeedModifier = (float)SpeedModifier;
}
示例4: osGetHealth
public LSL_Float osGetHealth(string avatar)
{
CheckThreatLevel(ThreatLevel.None, "osGetHealth");
m_host.AddScriptLPS(1);
LSL_Float health = new LSL_Float(-1);
ScenePresence presence = World.GetScenePresence(new UUID(avatar));
if (presence != null) health = presence.Health;
return health;
}
示例5: llSetVehicleFloatParam
//CFK 9/28: Most, but not all of the underlying plumbing between here and the physics modules is in
//CFK 9/28: so these are not complete yet.
public void llSetVehicleFloatParam(int param, LSL_Float value)
{
m_host.AddScriptLPS(1);
if (!m_host.ParentGroup.IsDeleted)
{
m_host.ParentGroup.RootPart.SetVehicleFloatParam(param, (float)value);
}
}
示例6: osSetWindParam
public void osSetWindParam(string plugin, string param, LSL_Float value)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
m_host.AddScriptLPS(1);
IWindModule module = World.RequestModuleInterface<IWindModule>();
if (module != null)
{
try
{
module.WindParamSet(plugin, param, (float)value);
}
catch (Exception) { }
}
}
示例7: osSetSpeed
public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
{
m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
}
示例8: llSetVehicleFloatParam
public void llSetVehicleFloatParam(int param, LSL_Float value)
{
m_LSL_Functions.llSetVehicleFloatParam(param, value);
}
示例9: osSetWindParam
public void osSetWindParam(string plugin, string param, LSL_Float value)
{
m_OSSL_Functions.osSetWindParam(plugin, param, value);
}
示例10: llGetObjectDetails
public LSL_List llGetObjectDetails(string id, LSL_List args)
{
m_host.AddScriptLPS(1);
LSL_List ret = new LSL_List();
UUID key = new UUID();
if (UUID.TryParse(id, out key))
{
ScenePresence av = World.GetScenePresence(key);
if (av != null)
{
foreach (object o in args.Data)
{
switch (int.Parse(o.ToString()))
{
case ScriptBaseClass.OBJECT_NAME:
ret.Add(new LSL_String(av.Firstname + " " + av.Lastname));
break;
case ScriptBaseClass.OBJECT_DESC:
ret.Add(new LSL_String(""));
break;
case ScriptBaseClass.OBJECT_POS:
ret.Add(new LSL_Vector((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z));
break;
case ScriptBaseClass.OBJECT_ROT:
ret.Add(new LSL_Rotation(av.GetWorldRotation()));
break;
case ScriptBaseClass.OBJECT_VELOCITY:
ret.Add(new LSL_Vector(av.GetWorldVelocity()));
break;
case ScriptBaseClass.OBJECT_OWNER:
ret.Add(new LSL_String(id));
break;
case ScriptBaseClass.OBJECT_GROUP:
ret.Add(new LSL_String(UUID.Zero.ToString()));
break;
case ScriptBaseClass.OBJECT_CREATOR:
ret.Add(new LSL_String(UUID.Zero.ToString()));
break;
// For the following 8 see the Object version below
case ScriptBaseClass.OBJECT_RUNNING_SCRIPT_COUNT:
ret.Add(new LSL_Integer(av.RunningScriptCount()));
break;
case ScriptBaseClass.OBJECT_TOTAL_SCRIPT_COUNT:
ret.Add(new LSL_Integer(av.ScriptCount()));
break;
case ScriptBaseClass.OBJECT_SCRIPT_MEMORY:
ret.Add(new LSL_Integer(av.RunningScriptCount() * 16384));
break;
case ScriptBaseClass.OBJECT_SCRIPT_TIME:
ret.Add(new LSL_Float(av.ScriptExecutionTime() / 1000.0f));
break;
case ScriptBaseClass.OBJECT_PRIM_EQUIVALENCE:
ret.Add(new LSL_Integer(1));
break;
case ScriptBaseClass.OBJECT_SERVER_COST:
ret.Add(new LSL_Float(0));
break;
case ScriptBaseClass.OBJECT_STREAMING_COST:
ret.Add(new LSL_Float(0));
break;
case ScriptBaseClass.OBJECT_PHYSICS_COST:
ret.Add(new LSL_Float(0));
break;
case ScriptBaseClass.OBJECT_CHARACTER_TIME: // Pathfinding
ret.Add(new LSL_Float(0));
break;
case ScriptBaseClass.OBJECT_ROOT:
SceneObjectPart p = av.ParentPart;
if (p != null)
{
ret.Add(new LSL_String(p.ParentGroup.RootPart.UUID.ToString()));
}
else
{
ret.Add(new LSL_String(id));
}
break;
case ScriptBaseClass.OBJECT_ATTACHED_POINT:
ret.Add(new LSL_Integer(0));
break;
case ScriptBaseClass.OBJECT_PATHFINDING_TYPE: // Pathfinding
ret.Add(new LSL_Integer(ScriptBaseClass.OPT_AVATAR));
break;
case ScriptBaseClass.OBJECT_PHYSICS:
ret.Add(new LSL_Integer(0));
break;
case ScriptBaseClass.OBJECT_PHANTOM:
ret.Add(new LSL_Integer(0));
break;
case ScriptBaseClass.OBJECT_TEMP_ON_REZ:
ret.Add(new LSL_Integer(0));
break;
case ScriptBaseClass.OBJECT_RENDER_WEIGHT:
ret.Add(new LSL_Integer(-1));
break;
case ScriptBaseClass.OBJECT_HOVER_HEIGHT:
ret.Add(new LSL_Float(0));
break;
//.........这里部分代码省略.........
示例11: modInvokeL
public LSL_List modInvokeL(string fname, params object[] parms)
{
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(object[]))
MODError(String.Format("return type mismatch for {0}",fname));
object[] result = (object[])modInvoke(fname,parms);
object[] llist = new object[result.Length];
for (int i = 0; i < result.Length; i++)
{
if (result[i] is string)
{
llist[i] = new LSL_String((string)result[i]);
}
else if (result[i] is int)
{
llist[i] = new LSL_Integer((int)result[i]);
}
else if (result[i] is float)
{
llist[i] = new LSL_Float((float)result[i]);
}
else if (result[i] is double)
{
llist[i] = new LSL_Float((double)result[i]);
}
else if (result[i] is UUID)
{
llist[i] = new LSL_Key(result[i].ToString());
}
else if (result[i] is OpenMetaverse.Vector3)
{
OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i];
llist[i] = new LSL_Vector(vresult.X, vresult.Y, vresult.Z);
}
else if (result[i] is OpenMetaverse.Quaternion)
{
OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i];
llist[i] = new LSL_Rotation(qresult.X, qresult.Y, qresult.Z, qresult.W);
}
else
{
MODError(String.Format("unknown list element {1} returned by {0}", fname, result[i].GetType().Name));
}
}
return new LSL_List(llist);
}
示例12: osSetWindParam
public void osSetWindParam(string plugin, string param, LSL_Float value)
{
m_host.AddScriptLPS(1);
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID))
{
OSSLShoutError("osSetWindParam can only be used by estate managers or owner");
return;
}
IWindModule module = World.RequestModuleInterface<IWindModule>();
if (module != null)
{
try
{
module.WindParamSet(plugin, param, (float)value);
}
catch (Exception) { }
}
}