Exemplo n.º 1
0
        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;

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

            return joint;
        }