addJoint() 공개 메소드

Create a joint to constrain bodies together. This may cause the connected bodies to cease colliding.
public addJoint ( Joint joint ) : void
joint FarseerPhysics.Dynamics.Joints.Joint The joint.
리턴 void
예제 #1
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		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;
		}
예제 #2
0
파일: PathManager.cs 프로젝트: prime31/Nez
		/// <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;
		}
예제 #3
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		public static AngleJoint CreateAngleJoint( World world, Body bodyA, Body bodyB )
		{
			var angleJoint = new AngleJoint( bodyA, bodyB );
			world.addJoint( angleJoint );
			return angleJoint;
		}
예제 #4
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		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;
		}
예제 #5
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		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;
		}
예제 #6
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		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;
		}
예제 #7
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		public static FixedMouseJoint CreateFixedMouseJoint( World world, Body body, Vector2 worldAnchor )
		{
			var joint = new FixedMouseJoint( body, worldAnchor );
			world.addJoint( joint );
			return joint;
		}
예제 #8
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		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;
		}
예제 #9
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		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;
		}
예제 #10
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		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;
		}
예제 #11
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		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;
		}
예제 #12
0
파일: JointFactory.cs 프로젝트: prime31/Nez
		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;
		}