コード例 #1
0
ファイル: Joint.cs プロジェクト: CloneDeath/Box2D.Net
		internal static Joint Create(JointDef def){
			Joint joint = null;

			switch (def.type)
			{
			case JointType.e_distanceJoint:
			    {
					joint = new DistanceJoint((DistanceJointDef)def);
			    }
			    break;

			case JointType.e_mouseJoint:
			    {
			        joint = new MouseJoint((MouseJointDef)def);
			    }
			    break;

			case JointType.e_prismaticJoint:
			    {
			        joint = new PrismaticJoint((PrismaticJointDef)def);
			    }
			    break;

			case JointType.e_revoluteJoint:
			    {
					joint = new RevoluteJoint((RevoluteJointDef)def);
			    }
			    break;

			case JointType.e_pulleyJoint:
			    {
					joint = new PulleyJoint((PulleyJointDef)def);
			    }
			    break;

			case JointType.e_gearJoint:
			    {
					joint = new GearJoint((GearJointDef)def);
			    }
			    break;

			case JointType.e_wheelJoint:
			    {
					joint = new WheelJoint((WheelJointDef)def);
			    }
			    break;

			case JointType.e_weldJoint:
			    {
					joint = new WeldJoint((WeldJointDef)def);
			    }
			    break;
        
			case JointType.e_frictionJoint:
			    {
			        joint = new FrictionJoint((FrictionJointDef)def);
			    }
			    break;

			case JointType.e_ropeJoint:
			    {
					throw new NotImplementedException();
					//joint = new RopeJoint((RopeJointDef)def);
			    }
			    break;

			case JointType.e_motorJoint:
			    {
			        joint = new MotorJoint((MotorJointDef)def);
			    }
			    break;

			default:
			    Utilities.Assert(false);
			    break;
			}

			return joint;
		}
コード例 #2
0
ファイル: Joint.cs プロジェクト: quinsmpang/box2d4unity
        internal static Joint Create(JointDef def)
        {
            Joint joint = null;

            switch (def.type)
            {
            case JointType.Distance:
            {
                joint = new DistanceJoint((DistanceJointDef)def);
            }
            break;

            case JointType.Mouse:
            {
                joint = new MouseJoint((MouseJointDef)def);
            }
            break;

            case JointType.Prismatic:
            {
                joint = new PrismaticJoint((PrismaticJointDef)def);
            }
            break;

            case JointType.Revolute:
            {
                joint = new RevoluteJoint((RevoluteJointDef)def);
            }
            break;

            case JointType.Pulley:
            {
                joint = new PulleyJoint((PulleyJointDef)def);
            }
            break;

            case JointType.Gear:
            {
                joint = new GearJoint((GearJointDef)def);
            }
            break;

            case JointType.Line:
            {
                joint = new LineJoint((LineJointDef)def);
            }
            break;

            case JointType.Weld:
            {
                joint = new WeldJoint((WeldJointDef)def);
            }
            break;

            case JointType.Friction:
            {
                joint = new FrictionJoint((FrictionJointDef)def);
            }
            break;

            case JointType.MaxDistance:
            {
                joint = new MaxDistanceJoint((MaxDistanceJointDef)def);
            }
            break;

            default:
                //Debug.Assert(false);
                break;
            }

            return(joint);
        }
コード例 #3
0
        internal static Joint Create(JointDef def)
        {
            Joint joint = null;

            switch (def.type)
            {
            case JointType.e_distanceJoint:
            {
                joint = new DistanceJoint((DistanceJointDef)def);
            }
            break;

            case JointType.e_mouseJoint:
            {
                joint = new MouseJoint((MouseJointDef)def);
            }
            break;

            case JointType.e_prismaticJoint:
            {
                joint = new PrismaticJoint((PrismaticJointDef)def);
            }
            break;

            case JointType.e_revoluteJoint:
            {
                joint = new RevoluteJoint((RevoluteJointDef)def);
            }
            break;

            case JointType.e_pulleyJoint:
            {
                joint = new PulleyJoint((PulleyJointDef)def);
            }
            break;

            case JointType.e_gearJoint:
            {
                joint = new GearJoint((GearJointDef)def);
            }
            break;

            case JointType.e_wheelJoint:
            {
                joint = new WheelJoint((WheelJointDef)def);
            }
            break;

            case JointType.e_weldJoint:
            {
                joint = new WeldJoint((WeldJointDef)def);
            }
            break;

            case JointType.e_frictionJoint:
            {
                joint = new FrictionJoint((FrictionJointDef)def);
            }
            break;

            case JointType.e_ropeJoint:
            {
                throw new NotImplementedException();
                //joint = new RopeJoint((RopeJointDef)def);
            }
            break;

            case JointType.e_motorJoint:
            {
                joint = new MotorJoint((MotorJointDef)def);
            }
            break;

            default:
                Utilities.Assert(false);
                break;
            }

            return(joint);
        }