当前位置: 首页>>代码示例>>C#>>正文


C# Body.GetAbsoluteLocation方法代码示例

本文整理汇总了C#中Body.GetAbsoluteLocation方法的典型用法代码示例。如果您正苦于以下问题:C# Body.GetAbsoluteLocation方法的具体用法?C# Body.GetAbsoluteLocation怎么用?C# Body.GetAbsoluteLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Body的用法示例。


在下文中一共展示了Body.GetAbsoluteLocation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoggingObject

		public LoggingObject(Body pb, Body root)
		{
			Body = pb;
			_root = root;
			InitialLocation = pb.GetAbsoluteLocation();
			_lastLocation = InitialLocation.NewX(InitialLocation.X + 1);
			_lastVisibility = !IsVisible();
		}
开发者ID:DmitryZyr,项目名称:CVARC,代码行数:8,代码来源:LoggingObject.cs

示例2: AbsoluteLocationLinear

		public void AbsoluteLocationLinear()
		{
			var root = new Body {Location = new Frame3D(0, 0, 10)};
			Assert.AreEqual(root.Location, root.GetAbsoluteLocation());
			var box = new Box {Location = new Frame3D(10, 0, 0)};
			Assert.AreEqual(box.Location, box.GetAbsoluteLocation());
			root.Add(box);
			Assert.AreEqual(box.Location.Apply(root.Location), box.GetAbsoluteLocation());
			int sum = 0;
			for(int i = 0; i < 10; i++)
			{
				sum += i;
				Body child = new Box {Location = new Frame3D(i, 0, 0)};
				root.Add(child);
				Assert.AreEqual(sum, child.GetAbsoluteLocation().X);
				root = child;
			}
		}
开发者ID:DmitryZyr,项目名称:CVARC,代码行数:18,代码来源:BodyLocationTests.cs

示例3: MoveAndCheck

			private static void MoveAndCheck(LoggingObject lo, Body box)
			{
				for(int i = 0; i < 5; i++)
				{
					box.Location = box.Location.Apply(new Frame3D(1, 1, 0));
					lo.SaveLocation(box.GetAbsoluteLocation(), _totalTime);
					Frame3D loc = lo.Movements.Last().NextLocation();
					Assert.AreEqual(box.GetAbsoluteLocation(), loc);
				}
				Assert.AreEqual(_totalTime, lo.Movements[_movementCount].StartTime);
				_totalTime += 0.1;
				_movementCount++;
				Assert.AreEqual(_movementCount, lo.Movements.Count);
			}
开发者ID:DmitryZyr,项目名称:CVARC,代码行数:14,代码来源:SavingBodiesTests.cs

示例4: CaptureDevicet

 private void CaptureDevicet(Body box, Body newChild)
 {
     var childAbsolute = newChild.GetAbsoluteLocation();
     if (newChild.Parent != null)
         newChild.Parent.Remove(newChild);
     newChild.Location = box.GetAbsoluteLocation().Invert().Apply(childAbsolute);
     newChild.Location = newChild.Location.NewYaw(Angle.Zero);
     newChild.Location = newChild.Location.NewX(14);
     newChild.Location = newChild.Location.NewY(0);
     frictionCoefficientsById.SafeAdd(newChild.Id, newChild.FrictionCoefficient);
     newChild.FrictionCoefficient = 0;
     box.Add(newChild);
 }
开发者ID:DmitryZyr,项目名称:CVARC,代码行数:13,代码来源:CvarcEngine.cs

示例5: Distance

 private double Distance(Body from, Body to)
 {
     return Geometry.Hypot(from.GetAbsoluteLocation() - to.GetAbsoluteLocation());
 }
开发者ID:DmitryZyr,项目名称:CVARC,代码行数:4,代码来源:CvarcEngine.cs


注:本文中的Body.GetAbsoluteLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。