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


C# World.addJoint方法代码示例

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


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

示例1: CreateRevoluteJoint

		public static RevoluteJoint CreateRevoluteJoint( World world, Body bodyA, Body bodyB, Vector2 anchor )
		{
			var localanchorA = bodyA.getLocalPoint( bodyB.getWorldPoint( anchor ) );
			var joint = new RevoluteJoint( bodyA, bodyB, localanchorA, anchor );
			world.addJoint( joint );
			return joint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:7,代码来源:JointFactory.cs

示例2: attachBodiesWithRevoluteJoint

		/// <summary>
		/// Attaches the bodies with revolute joints.
		/// </summary>
		/// <param name="world">The world.</param>
		/// <param name="bodies">The bodies.</param>
		/// <param name="localAnchorA">The local anchor A.</param>
		/// <param name="localAnchorB">The local anchor B.</param>
		/// <param name="connectFirstAndLast">if set to <c>true</c> [connect first and last].</param>
		/// <param name="collideConnected">if set to <c>true</c> [collide connected].</param>
		public static List<RevoluteJoint> attachBodiesWithRevoluteJoint( World world, List<Body> bodies, Vector2 localAnchorA, Vector2 localAnchorB, bool connectFirstAndLast, bool collideConnected )
		{
			var joints = new List<RevoluteJoint>( bodies.Count + 1 );

			for( int i = 1; i < bodies.Count; i++ )
			{
				RevoluteJoint joint = new RevoluteJoint( bodies[i], bodies[i - 1], localAnchorA, localAnchorB );
				joint.collideConnected = collideConnected;
				world.addJoint( joint );
				joints.Add( joint );
			}

			if( connectFirstAndLast )
			{
				RevoluteJoint lastjoint = new RevoluteJoint( bodies[0], bodies[bodies.Count - 1], localAnchorA, localAnchorB );
				lastjoint.collideConnected = collideConnected;
				world.addJoint( lastjoint );
				joints.Add( lastjoint );
			}

			return joints;
		}
开发者ID:prime31,项目名称:Nez,代码行数:31,代码来源:PathManager.cs

示例3: CreateAngleJoint

		public static AngleJoint CreateAngleJoint( World world, Body bodyA, Body bodyB )
		{
			var angleJoint = new AngleJoint( bodyA, bodyB );
			world.addJoint( angleJoint );
			return angleJoint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs

示例4: CreateWheelJoint

		public static WheelJoint CreateWheelJoint( World world, Body bodyA, Body bodyB, Vector2 anchor, Vector2 axis, bool useWorldCoordinates = false )
		{
			WheelJoint joint = new WheelJoint( bodyA, bodyB, anchor, axis, useWorldCoordinates );
			world.addJoint( joint );
			return joint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs

示例5: CreateWeldJoint

		public static WeldJoint CreateWeldJoint( World world, Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false )
		{
			var weldJoint = new WeldJoint( bodyA, bodyB, anchorA, anchorB, useWorldCoordinates );
			world.addJoint( weldJoint );
			return weldJoint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs

示例6: CreateRopeJoint

		public static RopeJoint CreateRopeJoint( World world, Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false )
		{
			var ropeJoint = new RopeJoint( bodyA, bodyB, anchorA, anchorB, useWorldCoordinates );
			world.addJoint( ropeJoint );
			return ropeJoint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs

示例7: CreateFixedMouseJoint

		public static FixedMouseJoint CreateFixedMouseJoint( World world, Body body, Vector2 worldAnchor )
		{
			var joint = new FixedMouseJoint( body, worldAnchor );
			world.addJoint( joint );
			return joint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs

示例8: CreatePulleyJoint

		public static PulleyJoint CreatePulleyJoint( World world, Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, Vector2 worldAnchorA, Vector2 worldAnchorB, float ratio, bool useWorldCoordinates = false )
		{
			var pulleyJoint = new PulleyJoint( bodyA, bodyB, anchorA, anchorB, worldAnchorA, worldAnchorB, ratio, useWorldCoordinates );
			world.addJoint( pulleyJoint );
			return pulleyJoint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs

示例9: CreateMotorJoint

		public static MotorJoint CreateMotorJoint( World world, Body bodyA, Body bodyB, bool useWorldCoordinates = false )
		{
			var joint = new MotorJoint( bodyA, bodyB, useWorldCoordinates );
			world.addJoint( joint );
			return joint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs

示例10: CreateGearJoint

		public static GearJoint CreateGearJoint( World world, Body bodyA, Body bodyB, Joint jointA, Joint jointB, float ratio )
		{
			var gearJoint = new GearJoint( bodyA, bodyB, jointA, jointB, ratio );
			world.addJoint( gearJoint );
			return gearJoint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs

示例11: CreateFrictionJoint

		public static FrictionJoint CreateFrictionJoint( World world, Body bodyA, Body bodyB, Vector2 anchor, bool useWorldCoordinates = false )
		{
			var frictionJoint = new FrictionJoint( bodyA, bodyB, anchor, useWorldCoordinates );
			world.addJoint( frictionJoint );
			return frictionJoint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs

示例12: CreateDistanceJoint

		public static DistanceJoint CreateDistanceJoint( World world, Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false )
		{
			var distanceJoint = new DistanceJoint( bodyA, bodyB, anchorA, anchorB, useWorldCoordinates );
			world.addJoint( distanceJoint );
			return distanceJoint;
		}
开发者ID:prime31,项目名称:Nez,代码行数:6,代码来源:JointFactory.cs


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