本文整理汇总了C#中ISceneChildEntity.ScheduleUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# ISceneChildEntity.ScheduleUpdate方法的具体用法?C# ISceneChildEntity.ScheduleUpdate怎么用?C# ISceneChildEntity.ScheduleUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneChildEntity
的用法示例。
在下文中一共展示了ISceneChildEntity.ScheduleUpdate方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetRootPartOwner
/// <summary>
/// Set the owner of the root part.
/// </summary>
/// <param name = "part"></param>
/// <param name = "cAgentID"></param>
/// <param name = "cGroupID"></param>
public void SetRootPartOwner(ISceneChildEntity part, UUID cAgentID, UUID cGroupID)
{
part.LastOwnerID = part.OwnerID;
part.OwnerID = cAgentID;
part.GroupID = cGroupID;
if (part.OwnerID != cAgentID)
{
// Apply Next Owner Permissions if we're not bypassing permissions
if (!m_scene.Permissions.BypassPermissions())
ApplyNextOwnerPermissions();
}
part.ScheduleUpdate(PrimUpdateFlags.ForcedFullUpdate);
}
示例2: SetMediaEntry
public void SetMediaEntry (ISceneChildEntity part, int face, MediaEntry me)
{
CheckFaceParam(part, face);
if (null == part.Shape.Media)
{
if (me == null)
return;
else
part.Shape.Media = new PrimitiveBaseShape.MediaList(new MediaEntry[part.GetNumberOfSides()]);
}
lock (part.Shape.Media)
part.Shape.Media[face] = me;
UpdateMediaUrl(part, UUID.Zero);
SetPartMediaFlags(part, face, me != null);
part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
part.TriggerScriptChangedEvent(Changed.MEDIA);
}
示例3: SetParticleSystem
//.........这里部分代码省略.........
// 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.
else if (rule == (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.
}
else if (rule == (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.
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_TEXTURE)
{
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_RATE)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstRate = (float)tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_PART_COUNT)
{
prules.BurstPartCount = (byte)(int)rules.GetLSLIntegerItem(i + 1);
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_RADIUS)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstRadius = (float)tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MIN)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstSpeedMin = (float)tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MAX)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstSpeedMax = (float)tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_MAX_AGE)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.MaxAge = (float)tempf;
}
else if (rule == (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;
}
}
else if (rule == (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;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.InnerAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_ANGLE_END)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.OuterAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
}
}
prules.CRC = 1;
part.AddNewParticleSystem(prules);
}
part.ScheduleUpdate(PrimUpdateFlags.Particles);
}
示例4: PlayfwdState
public void PlayfwdState(ISceneChildEntity part)
{
if (part != null)
{
bool ChangedScale = false;
bool ChangedRot = false;
bool ChangedPos = false;
part.Undoing = true;
if (part.UUID == part.ParentEntity.UUID)
{
if (Position != Vector3.Zero)
{
ChangedPos = true;
part.ParentEntity.AbsolutePosition = Position;
}
if (Rotation != Quaternion.Identity)
{
ChangedRot = true;
part.UpdateRotation(Rotation);
}
if (Scale != Vector3.Zero)
{
ChangedScale = true;
part.Resize(Scale);
}
foreach (
ISceneChildEntity child in
part.ParentEntity.ChildrenEntities().Where(child => child.UUID != part.UUID))
{
child.Redo(); //No updates here, child redo will do it on their own
}
}
else
{
if (Position != Vector3.Zero)
{
ChangedPos = true;
part.FixOffsetPosition(Position, false);
}
if (Rotation != Quaternion.Identity)
{
ChangedRot = true;
part.ParentEntity.Rotation = (Rotation);
}
if (Scale != Vector3.Zero)
{
ChangedScale = true;
part.Resize(Scale);
}
}
part.ScheduleUpdate((ChangedScale ? PrimUpdateFlags.Shape : PrimUpdateFlags.None) |
(ChangedPos ? PrimUpdateFlags.Position : PrimUpdateFlags.None) |
(ChangedRot ? PrimUpdateFlags.Rotation : PrimUpdateFlags.None));
part.Undoing = false;
}
}
示例5: SetAlpha
protected void SetAlpha (ISceneChildEntity part, double alpha, int face)
{
Primitive.TextureEntry tex = part.Shape.Textures;
Color4 texcolor;
if (face >= 0 && face < GetNumberOfSides(part))
{
texcolor = tex.CreateFace((uint)face).RGBA;
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
tex.FaceTextures[face].RGBA = texcolor;
part.UpdateTexture(tex);
}
else if (face == ScriptBaseClass.ALL_SIDES)
{
for (int i = 0; i < GetNumberOfSides(part); i++)
{
if (tex.FaceTextures[i] != null)
{
texcolor = tex.FaceTextures[i].RGBA;
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
tex.FaceTextures[i].RGBA = texcolor;
}
}
texcolor = tex.DefaultTexture.RGBA;
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
tex.DefaultTexture.RGBA = texcolor;
part.UpdateTexture(tex);
}
part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
}
示例6: SetTextureAnim
private void SetTextureAnim (ISceneChildEntity part, int mode, int face, int sizex, int sizey, double start, double length, double rate)
{
Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation();
pTexAnim.Flags = (Primitive.TextureAnimMode)mode;
//ALL_SIDES
if (face == ScriptBaseClass.ALL_SIDES)
face = 255;
pTexAnim.Face = (uint)face;
pTexAnim.Length = (float)length;
pTexAnim.Rate = (float)rate;
pTexAnim.SizeX = (uint)sizex;
pTexAnim.SizeY = (uint)sizey;
pTexAnim.Start = (float)start;
part.AddTextureAnimation(pTexAnim);
part.ScheduleUpdate(PrimUpdateFlags.FindBest);
}
示例7: SetScale
protected void SetScale(ISceneChildEntity part, LSL_Vector scale)
{
if (part == null || part.ParentEntity == null || part.ParentEntity.IsDeleted)
return;
IOpenRegionSettingsModule WSModule = m_host.ParentEntity.Scene.RequestModuleInterface<IOpenRegionSettingsModule> ();
if (WSModule != null)
{
if (WSModule.MinimumPrimScale != -1)
{
if (scale.x < WSModule.MinimumPrimScale)
scale.x = WSModule.MinimumPrimScale;
if (scale.y < WSModule.MinimumPrimScale)
scale.y = WSModule.MinimumPrimScale;
if (scale.z < WSModule.MinimumPrimScale)
scale.z = WSModule.MinimumPrimScale;
}
if (part.ParentEntity.RootChild.PhysActor != null && part.ParentEntity.RootChild.PhysActor.IsPhysical &&
WSModule.MaximumPhysPrimScale != -1)
{
if (scale.x > WSModule.MaximumPhysPrimScale)
scale.x = WSModule.MaximumPhysPrimScale;
if (scale.y > WSModule.MaximumPhysPrimScale)
scale.y = WSModule.MaximumPhysPrimScale;
if (scale.z > WSModule.MaximumPhysPrimScale)
scale.z = WSModule.MaximumPhysPrimScale;
}
if (WSModule.MaximumPrimScale != -1)
{
if (scale.x > WSModule.MaximumPrimScale)
scale.x = WSModule.MaximumPrimScale;
if (scale.y > WSModule.MaximumPrimScale)
scale.y = WSModule.MaximumPrimScale;
if (scale.z > WSModule.MaximumPrimScale)
scale.z = WSModule.MaximumPrimScale;
}
}
Vector3 tmp = part.Scale;
tmp.X = (float)scale.x;
tmp.Y = (float)scale.y;
tmp.Z = (float)scale.z;
part.Scale = tmp;
part.ScheduleUpdate(PrimUpdateFlags.FindBest);
}
示例8: SetPointLight
/// <summary>
/// Set a light point on a part
/// </summary>
/// FIXME: Much of this code should probably be in SceneObjectGroup
///
/// <param name="part"></param>
/// <param name="light"></param>
/// <param name="color"></param>
/// <param name="intensity"></param>
/// <param name="radius"></param>
/// <param name="falloff"></param>
protected void SetPointLight (ISceneChildEntity part, bool light, LSL_Vector color, float intensity, float radius, float falloff)
{
if (part == null)
return;
bool same = true;
if (light)
{
if (part.Shape.LightEntry != true)
same = false;
part.Shape.LightEntry = true;
if (part.Shape.LightColorR != Util.Clip ((float)color.x, 0.0f, 1.0f))
same = false;
part.Shape.LightColorR = Util.Clip ((float)color.x, 0.0f, 1.0f);
if (part.Shape.LightColorG != Util.Clip ((float)color.y, 0.0f, 1.0f))
same = false;
part.Shape.LightColorG = Util.Clip ((float)color.y, 0.0f, 1.0f);
if (part.Shape.LightColorB != Util.Clip ((float)color.z, 0.0f, 1.0f))
same = false;
part.Shape.LightColorB = Util.Clip((float)color.z, 0.0f, 1.0f);
if (part.Shape.LightIntensity != intensity)
same = false;
part.Shape.LightIntensity = intensity;
if (part.Shape.LightRadius != radius)
same = false;
part.Shape.LightRadius = radius;
if (part.Shape.LightFalloff != falloff)
same = false;
part.Shape.LightFalloff = falloff;
}
else
{
if (part.Shape.LightEntry != false)
same = false;
part.Shape.LightEntry = false;
}
if (!same)
{
part.ParentEntity.HasGroupChanged = true;
part.ScheduleUpdate (PrimUpdateFlags.FindBest);
}
}
示例9: SetFlexi
/// <summary>
/// Set flexi parameters of a part.
///
/// FIXME: Much of this code should probably be within the part itself.
/// </summary>
/// <param name="part"></param>
/// <param name="flexi"></param>
/// <param name="softness"></param>
/// <param name="gravity"></param>
/// <param name="friction"></param>
/// <param name="wind"></param>
/// <param name="tension"></param>
/// <param name="Force"></param>
protected void SetFlexi (ISceneChildEntity part, bool flexi, int softness, float gravity, float friction,
float wind, float tension, LSL_Vector Force)
{
if (part == null)
return;
if (flexi)
{
part.Shape.PathCurve |= (byte)Extrusion.Flexible;
part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do
// work once the prim is already flexi
part.Shape.FlexiSoftness = softness;
part.Shape.FlexiGravity = gravity;
part.Shape.FlexiDrag = friction;
part.Shape.FlexiWind = wind;
part.Shape.FlexiTension = tension;
part.Shape.FlexiForceX = (float)Force.x;
part.Shape.FlexiForceY = (float)Force.y;
part.Shape.FlexiForceZ = (float)Force.z;
part.Shape.PathCurve = 0x80;
}
else
{
int curve = part.Shape.PathCurve;
curve &= (int)(~(Extrusion.Flexible));
part.Shape.PathCurve = (byte)curve;
part.Shape.FlexiEntry = false;
}
part.ParentEntity.HasGroupChanged = true;
part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
}
示例10: SetMediaEntry
public void SetMediaEntry(ISceneChildEntity part, int face, MediaEntry me)
{
CheckFaceParam(part, face);
if (null == part.Shape.Media)
{
if (me == null)
return;
else
{
part.Shape.Media = new PrimitiveBaseShape.MediaList(new MediaEntry[part.GetNumberOfSides()]);
}
}
if (part.Shape.Media[face] == null) //If it doesn't exist, set the default parameters for it
me.InteractPermissions = MediaPermission.All;
lock (part.Shape.Media)
part.Shape.Media[face] = me;
UpdateMediaUrl(part, UUID.Zero);
SetPartMediaFlags(part, face, me != null);
part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
part.TriggerScriptChangedEvent(Changed.MEDIA);
}
示例11: PlaybackState
public void PlaybackState (ISceneChildEntity part)
{
if (part != null) {
part.Undoing = true;
bool ChangedScale = false;
bool ChangedPos = false;
if (part.UUID == part.ParentEntity.UUID) {
if (Position != Vector3.Zero) {
ChangedPos = true;
part.ParentEntity.AbsolutePosition = Position;
}
part.SetRotationOffset (true, Rotation, true);
if (Scale != Vector3.Zero) {
ChangedScale = true;
part.Scale = Scale;
}
foreach (
ISceneChildEntity child in
part.ParentEntity.ChildrenEntities ().Where (child => child.UUID != part.UUID)) {
child.Undo (); //No updates here, child undo will do it on their own
}
} else {
if (Position != Vector3.Zero) {
ChangedPos = true;
part.FixOffsetPosition (Position, false);
}
part.UpdateRotation (Rotation);
if (Scale != Vector3.Zero) {
ChangedScale = true;
part.Resize (Scale);
}
}
part.Undoing = false;
var updateFlags =
(ChangedScale ? PrimUpdateFlags.Shape : PrimUpdateFlags.None) |
(ChangedPos ? PrimUpdateFlags.Position : PrimUpdateFlags.None) |
PrimUpdateFlags.Rotation;
part.ScheduleUpdate (updateFlags);
}
}