本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.AddNewParticleSystem方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectPart.AddNewParticleSystem方法的具体用法?C# SceneObjectPart.AddNewParticleSystem怎么用?C# SceneObjectPart.AddNewParticleSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.SceneObjectPart
的用法示例。
在下文中一共展示了SceneObjectPart.AddNewParticleSystem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetParticleSystem
//.........这里部分代码省略.........
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_SRC_BURST_SPEED_MIN: arg #{0} - parameter 1 must be float", i + 1));
return;
}
prules.BurstSpeedMin = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MAX:
try
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_SRC_BURST_SPEED_MAX: arg #{0} - parameter 1 must be float", i + 1));
return;
}
prules.BurstSpeedMax = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_MAX_AGE:
try
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_SRC_MAX_AGE: arg #{0} - parameter 1 must be float", i + 1));
return;
}
prules.MaxAge = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_TARGET_KEY:
UUID key = UUID.Zero;
if (UUID.TryParse(rules.Data[i + 1].ToString(), out key))
{
prules.Target = key;
}
else
{
prules.Target = part.UUID;
}
break;
case (int)ScriptBaseClass.PSYS_SRC_OMEGA:
// AL: This is an assumption, since it is the only thing that would match.
try
{
tempv = rules.GetVector3Item(i + 1);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_SRC_OMEGA: arg #{0} - parameter 1 must be vector", i + 1));
return;
}
prules.AngularVelocity.X = (float)tempv.x;
prules.AngularVelocity.Y = (float)tempv.y;
prules.AngularVelocity.Z = (float)tempv.z;
break;
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN:
try
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_SRC_ANGLE_BEGIN: arg #{0} - parameter 1 must be float", i + 1));
return;
}
prules.InnerAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
break;
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END:
try
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
}
catch (InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_SRC_ANGLE_END: arg #{0} - parameter 1 must be float", i + 1));
return;
}
prules.OuterAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
break;
}
}
prules.CRC = 1;
part.AddNewParticleSystem(prules);
part.ParentGroup.HasGroupChanged = true;
}
part.SendFullUpdateToAllClients();
}
示例2: SetParticleSystem
//.........这里部分代码省略.........
prules.PartAcceleration.X = (float)tempv.x;
prules.PartAcceleration.Y = (float)tempv.y;
prules.PartAcceleration.Z = (float)tempv.z;
break;
case (int)ScriptBaseClass.PSYS_SRC_PATTERN:
int tmpi = (int)rules.GetLSLIntegerItem(i + 1);
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
break;
// PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The
// PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The
// client tells the difference between the two by looking at the 0x02 bit in
// the PartFlags variable.
case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.InnerAngle = (float)tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
break;
case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.OuterAngle = (float)tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
break;
case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_RATE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstRate = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_PART_COUNT:
prules.BurstPartCount = (byte)(int)rules.GetLSLIntegerItem(i + 1);
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_RADIUS:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstRadius = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MIN:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstSpeedMin = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MAX:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstSpeedMax = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_MAX_AGE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.MaxAge = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_TARGET_KEY:
UUID key = UUID.Zero;
if (UUID.TryParse(rules.Data[i + 1].ToString(), out key))
{
prules.Target = key;
}
else
{
prules.Target = part.UUID;
}
break;
case (int)ScriptBaseClass.PSYS_SRC_OMEGA:
// AL: This is an assumption, since it is the only thing that would match.
tempv = rules.GetVector3Item(i + 1);
prules.AngularVelocity.X = (float)tempv.x;
prules.AngularVelocity.Y = (float)tempv.y;
prules.AngularVelocity.Z = (float)tempv.z;
break;
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.InnerAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
break;
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.OuterAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
break;
}
}
prules.CRC = 1;
part.AddNewParticleSystem(prules);
part.ParentGroup.HasGroupChanged = true;
}
part.SendFullUpdateToAllClients();
}
示例3: SetAura
public void SetAura(SceneObjectPart From, Vector3 color, float radius, float burstRadius, float age, float burstRate, Primitive.ParticleSystem.SourcePattern patternFlags)
{
Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive |
// Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam |
// Primitive.ParticleSystem.ParticleDataFlags.TargetPos;
prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR
prules.PartStartColor.G = color.Y;
prules.PartStartColor.B = color.Z;
prules.PartStartColor.A = 0.5f; //PSYS_PART_START_ALPHA, transparency
prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR
prules.PartEndColor.G = color.Y;
prules.PartEndColor.B = color.Z;
prules.PartEndColor.A = 0.5f; //PSYS_PART_END_ALPHA, transparency
/*prules.PartStartScaleX = 0.5f; //PSYS_PART_START_SCALE
prules.PartStartScaleY = 0.5f;
prules.PartEndScaleX = 0.5f; //PSYS_PART_END_SCALE
prules.PartEndScaleY = 0.5f;
*/
prules.PartStartScaleX = radius; //PSYS_PART_START_SCALE
prules.PartStartScaleY = radius;
prules.PartEndScaleX = radius; //PSYS_PART_END_SCALE
prules.PartEndScaleY = radius;
prules.PartMaxAge = age; //PSYS_PART_MAX_AGE
prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL
prules.PartAcceleration.Y = 0.0f;
prules.PartAcceleration.Z = 0.0f;
prules.Pattern = patternFlags; //PSYS_SRC_PATTERN
//prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank
prules.BurstRate = burstRate; //PSYS_SRC_BURST_RATE
prules.BurstPartCount = 2; //PSYS_SRC_BURST_PART_COUNT
//prules.BurstRadius = radius; //PSYS_SRC_BURST_RADIUS
prules.BurstRadius = burstRadius; //PSYS_SRC_BURST_RADIUS
prules.BurstSpeedMin = 0.001f; //PSYS_SRC_BURST_SPEED_MIN
prules.BurstSpeedMax = 0.001f; //PSYS_SRC_BURST_SPEED_MAX
prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE
//prules.Target = To; //PSYS_SRC_TARGET_KEY
prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA
prules.AngularVelocity.Y = 0.0f;
prules.AngularVelocity.Z = 0.0f;
prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN
prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END
prules.CRC = 1; //activates the particle system??
From.AddNewParticleSystem(prules);
}