示例#1
0
        /// <summary>
        /// Registers the set of constraints that are packaged in the engine.
        /// </summary>
        public static void RegisterDefaults(Solver solver, NarrowPhase narrowPhase)
        {
            solver.Register <BallSocket>();
            solver.Register <Contact1OneBody>();
            solver.Register <Contact2OneBody>();
            solver.Register <Contact3OneBody>();
            solver.Register <Contact4OneBody>();
            solver.Register <Contact1>();
            solver.Register <Contact2>();
            solver.Register <Contact3>();
            solver.Register <Contact4>();

            narrowPhase.RegisterContactConstraintAccessor(new Contact4Accessor());
            narrowPhase.RegisterContactConstraintAccessor(new Contact3Accessor());
            narrowPhase.RegisterContactConstraintAccessor(new Contact2Accessor());
            narrowPhase.RegisterContactConstraintAccessor(new Contact1Accessor());
            narrowPhase.RegisterContactConstraintAccessor(new Contact4OneBodyAccessor());
            narrowPhase.RegisterContactConstraintAccessor(new Contact3OneBodyAccessor());
            narrowPhase.RegisterContactConstraintAccessor(new Contact2OneBodyAccessor());
            narrowPhase.RegisterContactConstraintAccessor(new Contact1OneBodyAccessor());
        }
示例#2
0
        /// <summary>
        /// Registers the set of constraints that are packaged in the engine.
        /// </summary>
        public static void RegisterDefaults(Solver solver, NarrowPhase narrowPhase)
        {
            solver.Register <BallSocket>();
            solver.Register <AngularHinge>();
            solver.Register <AngularSwivelHinge>();
            solver.Register <SwingLimit>();
            solver.Register <TwistServo>();
            solver.Register <TwistLimit>();
            solver.Register <TwistMotor>();
            solver.Register <AngularServo>();
            solver.Register <AngularMotor>();
            solver.Register <Weld>();
            solver.Register <VolumeConstraint>();
            solver.Register <DistanceServo>();
            solver.Register <DistanceLimit>();
            solver.Register <CenterDistanceConstraint>();
            solver.Register <AreaConstraint>();
            solver.Register <PointOnLineServo>();
            solver.Register <LinearAxisServo>();
            solver.Register <LinearAxisMotor>();
            solver.Register <LinearAxisLimit>();
            solver.Register <AngularAxisMotor>();
            solver.Register <OneBodyAngularServo>();
            solver.Register <OneBodyAngularMotor>();
            solver.Register <OneBodyLinearServo>();
            solver.Register <OneBodyLinearMotor>();
            solver.Register <SwivelHinge>();
            solver.Register <Hinge>();

            solver.Register <Contact1OneBody>();
            solver.Register <Contact2OneBody>();
            solver.Register <Contact3OneBody>();
            solver.Register <Contact4OneBody>();
            solver.Register <Contact1>();
            solver.Register <Contact2>();
            solver.Register <Contact3>();
            solver.Register <Contact4>();
            solver.Register <Contact2NonconvexOneBody>();
            solver.Register <Contact3NonconvexOneBody>();
            solver.Register <Contact4NonconvexOneBody>();
            //We may later use more contacts in the nonconvex manifold; for now we clamped it to 4.
            solver.Register <Contact2Nonconvex>();
            solver.Register <Contact3Nonconvex>();
            solver.Register <Contact4Nonconvex>();

            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact4Nonconvex, Contact4NonconvexPrestepData, Contact4NonconvexAccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact3Nonconvex, Contact3NonconvexPrestepData, Contact3NonconvexAccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact2Nonconvex, Contact2NonconvexPrestepData, Contact2NonconvexAccumulatedImpulses, ContactImpulses2, ConstraintCache2>());

            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact4NonconvexOneBody, Contact4NonconvexOneBodyPrestepData, Contact4NonconvexAccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact3NonconvexOneBody, Contact3NonconvexOneBodyPrestepData, Contact3NonconvexAccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact2NonconvexOneBody, Contact2NonconvexOneBodyPrestepData, Contact2NonconvexAccumulatedImpulses, ContactImpulses2, ConstraintCache2>());

            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor <Contact4, Contact4PrestepData, Contact4AccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor <Contact3, Contact3PrestepData, Contact3AccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor <Contact2, Contact2PrestepData, Contact2AccumulatedImpulses, ContactImpulses2, ConstraintCache2>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor <Contact1, Contact1PrestepData, Contact1AccumulatedImpulses, ContactImpulses1, ConstraintCache1>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor <Contact4OneBody, Contact4OneBodyPrestepData, Contact4AccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor <Contact3OneBody, Contact3OneBodyPrestepData, Contact3AccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor <Contact2OneBody, Contact2OneBodyPrestepData, Contact2AccumulatedImpulses, ContactImpulses2, ConstraintCache2>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor <Contact1OneBody, Contact1OneBodyPrestepData, Contact1AccumulatedImpulses, ContactImpulses1, ConstraintCache1>());
        }
示例#3
0
        /// <summary>
        /// Registers the set of constraints that are packaged in the engine.
        /// </summary>
        public static void RegisterDefaults(Solver solver, NarrowPhase narrowPhase)
        {
            solver.Register<BallSocket>();
            solver.Register<AngularHinge>();
            solver.Register<AngularSwivelHinge>();
            solver.Register<SwingLimit>();
            solver.Register<TwistServo>();
            solver.Register<TwistLimit>();
            solver.Register<TwistMotor>();
            solver.Register<AngularServo>();
            solver.Register<AngularMotor>();
            solver.Register<Weld>();
            solver.Register<VolumeConstraint>();
            solver.Register<DistanceServo>();
            solver.Register<DistanceLimit>();
            solver.Register<CenterDistanceConstraint>();
            solver.Register<AreaConstraint>();
            solver.Register<PointOnLineServo>();
            solver.Register<LinearAxisServo>();
            solver.Register<LinearAxisMotor>();
            solver.Register<LinearAxisLimit>();
            solver.Register<AngularAxisMotor>();
            solver.Register<OneBodyAngularServo>();
            solver.Register<OneBodyAngularMotor>();
            solver.Register<OneBodyLinearServo>();
            solver.Register<OneBodyLinearMotor>();
            solver.Register<SwivelHinge>();
            solver.Register<Hinge>();

            solver.Register<Contact1OneBody>();
            solver.Register<Contact2OneBody>();
            solver.Register<Contact3OneBody>();
            solver.Register<Contact4OneBody>();
            solver.Register<Contact1>();
            solver.Register<Contact2>();
            solver.Register<Contact3>();
            solver.Register<Contact4>();
            solver.Register<Contact2NonconvexOneBody>();
            solver.Register<Contact3NonconvexOneBody>();
            solver.Register<Contact4NonconvexOneBody>();
            solver.Register<Contact5NonconvexOneBody>();
            solver.Register<Contact6NonconvexOneBody>();
            solver.Register<Contact7NonconvexOneBody>();
            solver.Register<Contact8NonconvexOneBody>();
            solver.Register<Contact2Nonconvex>();
            solver.Register<Contact3Nonconvex>();
            solver.Register<Contact4Nonconvex>();
            solver.Register<Contact5Nonconvex>();
            solver.Register<Contact6Nonconvex>();
            solver.Register<Contact7Nonconvex>();
            solver.Register<Contact8Nonconvex>();

            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor<Contact8Nonconvex, Contact8NonconvexAccumulatedImpulses, ContactImpulses8, ConstraintCache8>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor<Contact7Nonconvex, Contact7NonconvexAccumulatedImpulses, ContactImpulses7, ConstraintCache7>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor<Contact6Nonconvex, Contact6NonconvexAccumulatedImpulses, ContactImpulses6, ConstraintCache6>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor<Contact5Nonconvex, Contact5NonconvexAccumulatedImpulses, ContactImpulses5, ConstraintCache5>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor<Contact4Nonconvex, Contact4NonconvexAccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor<Contact3Nonconvex, Contact3NonconvexAccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor<Contact2Nonconvex, Contact2NonconvexAccumulatedImpulses, ContactImpulses2, ConstraintCache2>());

            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor<Contact8NonconvexOneBody, Contact8NonconvexAccumulatedImpulses, ContactImpulses8, ConstraintCache8>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor<Contact7NonconvexOneBody, Contact7NonconvexAccumulatedImpulses, ContactImpulses7, ConstraintCache7>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor<Contact6NonconvexOneBody, Contact6NonconvexAccumulatedImpulses, ContactImpulses6, ConstraintCache6>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor<Contact5NonconvexOneBody, Contact5NonconvexAccumulatedImpulses, ContactImpulses5, ConstraintCache5>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor<Contact4NonconvexOneBody, Contact4NonconvexAccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor<Contact3NonconvexOneBody, Contact3NonconvexAccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor<Contact2NonconvexOneBody, Contact2NonconvexAccumulatedImpulses, ContactImpulses2, ConstraintCache2>());

            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor<Contact4, Contact4AccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor<Contact3, Contact3AccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor<Contact2, Contact2AccumulatedImpulses, ContactImpulses2, ConstraintCache2>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor<Contact1, Contact1AccumulatedImpulses, ContactImpulses1, ConstraintCache1>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor<Contact4OneBody, Contact4AccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor<Contact3OneBody, Contact3AccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor<Contact2OneBody, Contact2AccumulatedImpulses, ContactImpulses2, ConstraintCache2>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor<Contact1OneBody, Contact1AccumulatedImpulses, ContactImpulses1, ConstraintCache1>());
        }
示例#4
0
        /// <summary>
        /// Registers the set of constraints that are packaged in the engine.
        /// </summary>
        public static void RegisterDefaults(Solver solver, NarrowPhase narrowPhase)
        {
            solver.Register <BallSocket>();
            solver.Register <AngularHinge>();
            solver.Register <AngularSwivelHinge>();
            solver.Register <SwingLimit>();
            solver.Register <GrabMotor>();
            solver.Register <Contact1OneBody>();
            solver.Register <Contact2OneBody>();
            solver.Register <Contact3OneBody>();
            solver.Register <Contact4OneBody>();
            solver.Register <Contact1>();
            solver.Register <Contact2>();
            solver.Register <Contact3>();
            solver.Register <Contact4>();
            solver.Register <Contact2NonconvexOneBody>();
            solver.Register <Contact3NonconvexOneBody>();
            solver.Register <Contact4NonconvexOneBody>();
            solver.Register <Contact5NonconvexOneBody>();
            solver.Register <Contact6NonconvexOneBody>();
            solver.Register <Contact7NonconvexOneBody>();
            solver.Register <Contact8NonconvexOneBody>();
            solver.Register <Contact2Nonconvex>();
            solver.Register <Contact3Nonconvex>();
            solver.Register <Contact4Nonconvex>();
            solver.Register <Contact5Nonconvex>();
            solver.Register <Contact6Nonconvex>();
            solver.Register <Contact7Nonconvex>();
            solver.Register <Contact8Nonconvex>();

            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact8Nonconvex, Contact8NonconvexAccumulatedImpulses, ContactImpulses8, ConstraintCache8>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact7Nonconvex, Contact7NonconvexAccumulatedImpulses, ContactImpulses7, ConstraintCache7>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact6Nonconvex, Contact6NonconvexAccumulatedImpulses, ContactImpulses6, ConstraintCache6>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact5Nonconvex, Contact5NonconvexAccumulatedImpulses, ContactImpulses5, ConstraintCache5>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact4Nonconvex, Contact4NonconvexAccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact3Nonconvex, Contact3NonconvexAccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexTwoBodyAccessor <Contact2Nonconvex, Contact2NonconvexAccumulatedImpulses, ContactImpulses2, ConstraintCache2>());

            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact8NonconvexOneBody, Contact8NonconvexAccumulatedImpulses, ContactImpulses8, ConstraintCache8>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact7NonconvexOneBody, Contact7NonconvexAccumulatedImpulses, ContactImpulses7, ConstraintCache7>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact6NonconvexOneBody, Contact6NonconvexAccumulatedImpulses, ContactImpulses6, ConstraintCache6>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact5NonconvexOneBody, Contact5NonconvexAccumulatedImpulses, ContactImpulses5, ConstraintCache5>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact4NonconvexOneBody, Contact4NonconvexAccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact3NonconvexOneBody, Contact3NonconvexAccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new NonconvexOneBodyAccessor <Contact2NonconvexOneBody, Contact2NonconvexAccumulatedImpulses, ContactImpulses2, ConstraintCache2>());

            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor <Contact4, Contact4AccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor <Contact3, Contact3AccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor <Contact2, Contact2AccumulatedImpulses, ContactImpulses2, ConstraintCache2>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexTwoBodyAccessor <Contact1, Contact1AccumulatedImpulses, ContactImpulses1, ConstraintCache1>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor <Contact4OneBody, Contact4AccumulatedImpulses, ContactImpulses4, ConstraintCache4>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor <Contact3OneBody, Contact3AccumulatedImpulses, ContactImpulses3, ConstraintCache3>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor <Contact2OneBody, Contact2AccumulatedImpulses, ContactImpulses2, ConstraintCache2>());
            narrowPhase.RegisterContactConstraintAccessor(new ConvexOneBodyAccessor <Contact1OneBody, Contact1AccumulatedImpulses, ContactImpulses1, ConstraintCache1>());
        }