本文整理汇总了C#中ISceneChildEntity.Resize方法的典型用法代码示例。如果您正苦于以下问题:C# ISceneChildEntity.Resize方法的具体用法?C# ISceneChildEntity.Resize怎么用?C# ISceneChildEntity.Resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneChildEntity
的用法示例。
在下文中一共展示了ISceneChildEntity.Resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: 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);
}
}