當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。