示例#1
0
 public IObservable <JointFeedback> Process(IObservable <Joint> source)
 {
     return(source.Select(joint =>
     {
         var feedback = new JointFeedback();
         joint.Feedback = feedback;
         return feedback;
     }));
 }
示例#2
0
        public void JointFeedback_ApplyBodyForce_ReadNonZeroFeedback()
        {
            const dReal StepSize = (dReal)0.1;

            using (var body1 = new Body(world))
                using (var body2 = new Body(world))
                    using (var joint = new Ball(world))
                    {
                        body1.Position = new Vector3(1, 0, 0);
                        body2.Position = new Vector3(0, 1, 0);
                        joint.Attach(body1, body2);

                        var feedback = new JointFeedback();
                        joint.Feedback = feedback;

                        world.QuickStep(StepSize);
                        Assert.AreEqual(Vector3.Zero, joint.Feedback.ForceOnBody1);
                        body1.AddForce(new Vector3(0, 0, 1));
                        world.QuickStep(StepSize);
                        Assert.AreNotEqual(Vector3.Zero, joint.Feedback.ForceOnBody1);
                    }
        }
示例#3
0
 public static extern void JointSetFeedback(IntPtr j, out JointFeedback feedback);