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


C# Body.GetLocalPoint方法代码示例

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


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

示例1: Initialize

 public void Initialize(Body body1, Body body2, Vec2 anchor)
 {
     this.Body1 = body1;
     this.Body2 = body2;
     this.LocalAnchor1 = body1.GetLocalPoint(anchor);
     this.LocalAnchor2 = body2.GetLocalPoint(anchor);
     this.ReferenceAngle = body2.GetAngle() - body1.GetAngle();
 }
开发者ID:litdev1,项目名称:LitDev,代码行数:8,代码来源:RevoluteJointDef.cs

示例2: Initialize

 public void Initialize(Body body1, Body body2, Vec2 anchor, Vec2 axis)
 {
     this.Body1 = body1;
     this.Body2 = body2;
     this.localAnchor1 = body1.GetLocalPoint(anchor);
     this.localAnchor2 = body2.GetLocalPoint(anchor);
     this.localAxis1 = body1.GetLocalVector(axis);
 }
开发者ID:litdev1,项目名称:LitDev,代码行数:8,代码来源:LineJointDef.cs

示例3: Initialize

 public void Initialize(Body body1, Body body2, Vec2 anchor1, Vec2 anchor2)
 {
     this.Body1 = body1;
     this.Body2 = body2;
     this.LocalAnchor1 = body1.GetLocalPoint(anchor1);
     this.LocalAnchor2 = body2.GetLocalPoint(anchor2);
     this.Length = (anchor2 - anchor1).Length();
 }
开发者ID:litdev1,项目名称:LitDev,代码行数:8,代码来源:DistanceJointDef.cs

示例4: Initialize

		/// <summary>
		/// Initialize the bodies, anchors, and length using the world anchors.
		/// </summary>
		public void Initialize(Body body1, Body body2, Vec2 anchor1, Vec2 anchor2)
		{
			Body1 = body1;
			Body2 = body2;
			LocalAnchor1 = body1.GetLocalPoint(anchor1);
			LocalAnchor2 = body2.GetLocalPoint(anchor2);
			Vec2 d = anchor2 - anchor1;
			Length = d.Length();
		}
开发者ID:ajmaya,项目名称:box2dx,代码行数:12,代码来源:DistanceJoint.cs

示例5: Initialize

 public void Initialize(Body body1, Body body2, Vec2 groundAnchor1, Vec2 groundAnchor2, Vec2 anchor1, Vec2 anchor2, float ratio)
 {
     this.Body1 = body1;
     this.Body2 = body2;
     this.GroundAnchor1 = groundAnchor1;
     this.GroundAnchor2 = groundAnchor2;
     this.LocalAnchor1 = body1.GetLocalPoint(anchor1);
     this.LocalAnchor2 = body2.GetLocalPoint(anchor2);
     this.Length1 = (anchor1 - groundAnchor1).Length();
     this.Length2 = (anchor2 - groundAnchor2).Length();
     this.Ratio = ratio;
     Box2DXDebug.Assert(ratio > Settings.FLT_EPSILON);
     float num = this.Length1 + ratio * this.Length2;
     this.MaxLength1 = num - ratio * PulleyJoint.MinPulleyLength;
     this.MaxLength2 = (num - PulleyJoint.MinPulleyLength) / ratio;
 }
开发者ID:litdev1,项目名称:LitDev,代码行数:16,代码来源:PulleyJointDef.cs

示例6: Initialize

		/// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.
		public void Initialize(Body body1, Body body2,
						Vec2 groundAnchor1, Vec2 groundAnchor2,
						Vec2 anchor1, Vec2 anchor2,
						float ratio)
		{
			Body1 = body1;
			Body2 = body2;
			GroundAnchor1 = groundAnchor1;
			GroundAnchor2 = groundAnchor2;
			LocalAnchor1 = body1.GetLocalPoint(anchor1);
			LocalAnchor2 = body2.GetLocalPoint(anchor2);
			Vec2 d1 = anchor1 - groundAnchor1;
			Length1 = d1.Length();
			Vec2 d2 = anchor2 - groundAnchor2;
			Length2 = d2.Length();
			Ratio = ratio;
			Box2DXDebug.Assert(ratio > Settings.FLT_EPSILON);
			float C = Length1 + ratio * Length2;
			MaxLength1 = C - ratio * PulleyJoint.MinPulleyLength;
			MaxLength2 = (C - PulleyJoint.MinPulleyLength) / ratio;
		}
开发者ID:ajmaya,项目名称:box2dx,代码行数:22,代码来源:PulleyJoint.cs

示例7: Initialize

 /// <summary>
 /// Initialize the bodies, anchors, axis, and reference angle using the world
 /// anchor and world axis.
 /// </summary>
 public void Initialize(Body body1, Body body2, Vector2 anchor, Vector2 axis)
 {
     Body1 = body1;
     Body2 = body2;
     LocalAnchor1 = body1.GetLocalPoint(anchor);
     LocalAnchor2 = body2.GetLocalPoint(anchor);
     LocalAxis1 = body1.GetLocalVector(axis);
     ReferenceAngle = body2.GetAngle() - body1.GetAngle();
 }
开发者ID:imnotanderson,项目名称:Box2dUnity,代码行数:13,代码来源:PrismaticJoint.cs


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