本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.UpdateExtraPhysics方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectPart.UpdateExtraPhysics方法的具体用法?C# SceneObjectPart.UpdateExtraPhysics怎么用?C# SceneObjectPart.UpdateExtraPhysics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.SceneObjectPart
的用法示例。
在下文中一共展示了SceneObjectPart.UpdateExtraPhysics方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetPhysicsMaterial
private void SetPhysicsMaterial(SceneObjectPart part, int material_bits,
float material_density, float material_friction,
float material_restitution, float material_gravity_modifier)
{
ExtraPhysicsData physdata = new ExtraPhysicsData();
physdata.PhysShapeType = (PhysShapeType)part.PhysicsShapeType;
physdata.Density = part.Density;
physdata.Friction = part.Friction;
physdata.Bounce = part.Restitution;
physdata.GravitationModifier = part.GravityModifier;
if ((material_bits & (int)ScriptBaseClass.DENSITY) != 0)
physdata.Density = material_density;
if ((material_bits & (int)ScriptBaseClass.FRICTION) != 0)
physdata.Friction = material_friction;
if ((material_bits & (int)ScriptBaseClass.RESTITUTION) != 0)
physdata.Bounce = material_restitution;
if ((material_bits & (int)ScriptBaseClass.GRAVITY_MULTIPLIER) != 0)
physdata.GravitationModifier = material_gravity_modifier;
part.UpdateExtraPhysics(physdata);
}
示例2: SetPrimParams
//.........这里部分代码省略.........
return null;
string ph = rules.Data[idx++].ToString();
part.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));
break;
case (int)ScriptBaseClass.PRIM_PHYSICS:
if (remain < 1)
return null;
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_PHYSICS_SHAPE_TYPE:
if (remain < 1)
return null;
int shape_type = rules.GetLSLIntegerItem(idx++);
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 (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
if (remain < 1)
return null;
string temp = rules.Data[idx++].ToString();
part.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1"));
break;
case (int)ScriptBaseClass.PRIM_TEXGEN:
if (remain < 2)
return null;
//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 null;
string primText = rules.GetLSLStringItem(idx++);
LSL_Vector primTextColor = rules.GetVector3Item(idx++);
LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
Vector3 av3 = Util.Clip(primTextColor, 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)