本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.ScriptSetPhysicsStatus方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectPart.ScriptSetPhysicsStatus方法的具体用法?C# SceneObjectPart.ScriptSetPhysicsStatus怎么用?C# SceneObjectPart.ScriptSetPhysicsStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.SceneObjectPart
的用法示例。
在下文中一共展示了SceneObjectPart.ScriptSetPhysicsStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetPrimParams
//.........这里部分代码省略.........
return;
face = rules.GetLSLIntegerItem(idx++);
bool st = rules.GetLSLIntegerItem(idx++);
SetFullBright(part, face , st);
break;
case (int)ScriptBaseClass.PRIM_MATERIAL:
if (remain < 1)
return;
int mat = rules.GetLSLIntegerItem(idx++);
if (mat < 0 || mat > 7)
return;
part.Material = Convert.ToByte(mat);
break;
case (int)ScriptBaseClass.PRIM_PHANTOM:
if (remain < 1)
return;
string ph = rules.Data[idx++].ToString();
bool phantom;
if (ph.Equals("1"))
phantom = true;
else
phantom = false;
part.ScriptSetPhantomStatus(phantom);
break;
case (int)ScriptBaseClass.PRIM_PHYSICS:
if (remain < 1)
return;
string phy = rules.Data[idx++].ToString();
bool physics;
if (phy.Equals("1"))
physics = true;
else
physics = false;
part.ScriptSetPhysicsStatus(physics);
break;
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
if (remain < 1)
return;
string temp = rules.Data[idx++].ToString();
bool tempOnRez;
if (temp.Equals("1"))
tempOnRez = true;
else
tempOnRez = false;
part.ScriptSetTemporaryStatus(tempOnRez);
break;
case (int)ScriptBaseClass.PRIM_TEXGEN:
if (remain < 2)
return;
//face,type
face = rules.GetLSLIntegerItem(idx++);
int style = rules.GetLSLIntegerItem(idx++);
SetTexGen(part, face, style);
break;
case (int)ScriptBaseClass.PRIM_TEXT:
if (remain < 3)
return;
string primText = rules.GetLSLStringItem(idx++);
LSL_Vector primTextColor = rules.GetVector3Item(idx++);
LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
break;
case (int)ScriptBaseClass.PRIM_NAME:
if (remain < 1)
return;
string primName = rules.GetLSLStringItem(idx++);
part.Name = primName;
break;
case (int)ScriptBaseClass.PRIM_DESC:
if (remain < 1)
return;
string primDesc = rules.GetLSLStringItem(idx++);
part.Description = primDesc;
break;
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
if (remain < 1)
return;
LSL_Rotation lr = rules.GetQuaternionItem(idx++);
SetRot(part, Rot2Quaternion(lr));
break;
}
}
}
示例2: SetPrimParams
//.........这里部分代码省略.........
SetFullBright(part, face , st);
break;
case (int)ScriptBaseClass.PRIM_MATERIAL:
if (remain < 1)
return;
int mat = rules.GetLSLIntegerItem(idx++);
if (mat < 0 || mat > 7)
return;
part.Material = Convert.ToByte(mat);
break;
case (int)ScriptBaseClass.PRIM_PHANTOM:
if (remain < 1)
return;
string ph = rules.Data[idx++].ToString();
m_host.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));
break;
case (int)ScriptBaseClass.PRIM_PHYSICS:
if (remain < 1)
return;
string phy = rules.Data[idx++].ToString();
bool physics;
if (phy.Equals("1"))
physics = true;
else
physics = false;
part.ScriptSetPhysicsStatus(physics);
break;
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
if (remain < 1)
return;
string temp = rules.Data[idx++].ToString();
m_host.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1"));
break;
case (int)ScriptBaseClass.PRIM_TEXGEN:
if (remain < 2)
return;
//face,type
face = rules.GetLSLIntegerItem(idx++);
int style = rules.GetLSLIntegerItem(idx++);
SetTexGen(part, face, style);
break;
case (int)ScriptBaseClass.PRIM_TEXT:
if (remain < 3)
return;
string primText = rules.GetLSLStringItem(idx++);
LSL_Vector primTextColor = rules.GetVector3Item(idx++);
LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
break;
case (int)ScriptBaseClass.PRIM_NAME:
示例3: SetPrimParams
//.........这里部分代码省略.........
case ScriptBaseClass.PRIM_MATERIAL:
if (remain < 1)
return new LSL_List();
int mat;
try
{
mat = rules.GetLSLIntegerItem(idx++);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule #{0} -> PRIM_MATERIAL: arg #{1} - parameter 2 must be integer", rulesParsed, idx - idxStart - 1));
return new LSL_List();
}
if (mat < 0 || mat > 7)
return new LSL_List();
part.Material = Convert.ToByte(mat);
break;
case ScriptBaseClass.PRIM_PHANTOM:
if (remain < 1)
return new LSL_List();
string ph = rules.Data[idx++].ToString();
part.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));
break;
case ScriptBaseClass.PRIM_PHYSICS:
if (remain < 1)
return new LSL_List();
string phy = rules.Data[idx++].ToString();
part.ScriptSetPhysicsStatus(phy.Equals("1"));
break;
case ScriptBaseClass.PRIM_PHYSICS_SHAPE_TYPE:
if (remain < 1)
return new LSL_List();
int shape_type;
try
{
shape_type = rules.GetLSLIntegerItem(idx++);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule #{0} -> PRIM_PHYSICS_SHAPE_TYPE: arg #{1} - parameter 2 must be integer", rulesParsed, idx - idxStart - 1));
return new LSL_List();
}
ExtraPhysicsData physdata = new ExtraPhysicsData();
physdata.Density = part.Density;
physdata.Bounce = part.Restitution;
physdata.GravitationModifier = part.GravityModifier;
physdata.PhysShapeType = (PhysShapeType)shape_type;
part.UpdateExtraPhysics(physdata);
break;
case ScriptBaseClass.PRIM_TEMP_ON_REZ:
if (remain < 1)
return new LSL_List();
string temp = rules.Data[idx++].ToString();