コード例 #1
0
        /// <summary>
        /// Allows you to constrain motion of the specified axis. Be aware that when setting drives for a specific axis
        /// you must also take care not to constrain its motion in a conflicting way(for example you cannot add a drive
        /// that moves the joint on X axis, and then lock the X axis).
        ///
        /// Unlocking translations degrees of freedom allows the bodies to move along the subset of the unlocked axes.
        /// (for example unlocking just one translational axis is the equivalent of a slider joint.)
        ///
        /// Angular degrees of freedom are partitioned as twist(around X axis) and swing(around Y and Z axes). Different
        /// effects can be achieves by unlocking their various combinations:
        ///  - If a single degree of angular freedom is unlocked it should be the twist degree as it has extra options for
        ///    that case (for example for a hinge joint).
        ///  - If both swing degrees are unlocked but twist is locked the result is a zero-twist joint.
        ///  - If one swing and one twist degree of freedom are unlocked the result is a zero-swing joint (for example an
        ///    arm attached at the elbow)
        ///  - If all angular degrees of freedom are unlocked the result is the same as the spherical joint.
        /// </summary>
        /// <param name="axis">Axis to change the motion type for.</param>
        /// <param name="motion">Type of motion for the axis.</param>
        public void SetMotion(D6JointAxis axis, D6JointMotion motion)
        {
            if ([email protected][(int)axis] == motion)
            {
                return;
            }

            [email protected][(int)axis] = motion;

            if (Native != null)
            {
                Native.SetMotion(axis, motion);
            }
        }
コード例 #2
0
 /// <summary>
 /// Sets the motion type around the specified axis.
 /// </summary>
 /// <remarks>
 /// Each axis may independently specify that the degree of freedom is locked (blocking relative movement along or around this axis), limited by the corresponding limit, or free.
 /// </remarks>
 /// <param name="axis">The axis the degree of freedom around which the motion type is specified.</param>
 /// <param name="value">The value.</param>
 public void SetMotion(D6JointAxis axis, D6JointMotion value)
 {
     Internal_SetMotion(unmanagedPtr, axis, value);
 }
コード例 #3
0
ファイル: NativeD6Joint.cs プロジェクト: Ruu/BansheeEngine
 private static extern void Internal_SetMotion(IntPtr thisPtr, D6JointAxis axis, D6JointMotion motion);
コード例 #4
0
ファイル: NativeD6Joint.cs プロジェクト: Ruu/BansheeEngine
 public void SetMotion(D6JointAxis axis, D6JointMotion motion)
 {
     Internal_SetMotion(mCachedPtr, axis, motion);
 }