本文整理汇总了C#中Vector3.Jitter方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.Jitter方法的具体用法?C# Vector3.Jitter怎么用?C# Vector3.Jitter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3
的用法示例。
在下文中一共展示了Vector3.Jitter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrimaryUse
public override void PrimaryUse(Vector3 origin, Vector3 direction)
{
var focus = this.World.Trace(origin.Jitter(), direction.Jitter(), TraceOptions.IgnoreDynamic);
if (focus == null)
return;
this.Server.SpawnDetail("door", focus.Position.TK());
}
示例2: SecondaryUse
public override void SecondaryUse(Vector3 origin, Vector3 direction)
{
var focus = this.World.Trace(origin.Jitter(), direction.Jitter(), TraceOptions.IgnoreDynamic);
var detail = focus?.Body?.Tag as DetailObject;
if (detail == null)
return;
while(detail.Parent != null)
{
detail = detail.Parent;
}
this.Server.DestroyDetail(detail);
}
示例3: SecondaryUse
public override void SecondaryUse(Vector3 origin, Vector3 direction)
{
var focus = this.World.Trace(origin.Jitter(), direction.Jitter(), TraceOptions.IgnoreDynamic);
if (focus == null)
return;
JVector block = focus.Position + 0.5f * focus.Normal;
int x = (int)Math.Round(block.X);
int y = (int)Math.Round(block.Y);
int z = (int)Math.Round(block.Z);
this.Server.SetBlock(x, y, z, new BasicBlock(4));
}
示例4: CreateShape
public static Shape CreateShape(Vector3 size)
{
return new BoxShape(size.Jitter());
}