Ejemplo n.º 1
0
        /// <summary>
        /// This requires a world target point,
        /// tuning parameters, and the time step.
        /// </summary>
        /// <param name="body">The body.</param>
        /// <param name="anchor">The target.</param>
        public FixedMouseJoint(Body body, Vector2 anchor)
            : base(body)
        {
            JointType = JointType.FixedMouse;
            Frequency = 5.0f;
            DampingRatio = 0.7f;
            MaxForce = 1000 * body.Mass;

            Debug.Assert(anchor.IsValid());

            _target = anchor;
            LocalAnchorA = MathUtils.MulT(BodyA._xf, anchor);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This requires a world target point,
        /// tuning parameters, and the time step.
        /// </summary>
        /// <param name="body">The body.</param>
        /// <param name="worldAnchor">The target.</param>
        public FixedMouseJoint(Body body, Vector2 worldAnchor)
            : base(body)
        {
            JointType = JointType.FixedMouse;
            Frequency = 5.0f;
            DampingRatio = 0.7f;

            Debug.Assert(worldAnchor.IsValid());

            Transform xf1;
            BodyA.GetTransform(out xf1);

            _worldAnchor = worldAnchor;
            LocalAnchorA = BodyA.GetLocalPoint(worldAnchor);
        }
        private Mat22 _mass; // effective mass for point-to-point constraint.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// This requires a world target point,
        /// tuning parameters, and the time step.
        /// </summary>
        /// <param name="body">The body.</param>
        /// <param name="target">The target.</param>
        public FixedMouseJoint(Body body, Vector2 target)
            : base(body)
        {
            JointType = JointType.FixedMouse;
            Frequency = 5.0f;
            DampingRatio = 0.7f;

            Debug.Assert(target.IsValid());

            Transform xf1;
            BodyA.GetTransform(out xf1);

            LocalAnchorB = target;
            LocalAnchorA = MathUtils.MultiplyT(ref xf1, LocalAnchorB);
        }
 /// <summary>
 /// This requires a world target point,
 /// tuning parameters, and the time step.
 /// </summary>
 /// <param name="body">The body.</param>
 /// <param name="worldAnchor">The target.</param>
 public FixedMouseJoint(Body body, Vector2 worldAnchor)
     : base(body)
 {
     JointType = JointType.FixedMouse;
     Frequency = 5.0f;
     DampingRatio = 0.7f;
     MaxForce = 1000 * body.Mass;
     #if PSS
     //TODO
     #else
     Debug.Assert(worldAnchor.IsValid());
     #endif
     _targetA = worldAnchor;
     LocalAnchorB = MathUtils.MulT(BodyA.Xf, worldAnchor);
 }