Kinect.BoneOrientationsConstraint.AxisOrientationConstraint.AxisOrientationConstraint C# (CSharp) Method

AxisOrientationConstraint() public method

public AxisOrientationConstraint ( ConstraintAxis axis, float angleMin, float angleMax ) : System
axis ConstraintAxis
angleMin float
angleMax float
return System
            public AxisOrientationConstraint(ConstraintAxis axis, float angleMin, float angleMax)
            {
                // Set the axis that we will rotate around
                this.axis = (int)axis;

                switch (axis)
                {
                    case ConstraintAxis.X:
                        this.rotateAround = Vector3.right;
                        break;

                    case ConstraintAxis.Y:
                        this.rotateAround = Vector3.up;
                        break;

                    case ConstraintAxis.Z:
                        this.rotateAround = Vector3.forward;
                        break;

                    default:
                        this.rotateAround = Vector3.zero;
                        break;
                }

                // Set the min and max rotations in degrees
                this.angleMin = angleMin;
                this.angleMax = angleMax;

                // Set the min and max rotations in quaternion space
                this.minQuaternion = Quaternion.AngleAxis(angleMin, this.rotateAround);
                this.maxQuaternion = Quaternion.AngleAxis(angleMax, this.rotateAround);
                this.angleRange = angleMax - angleMin;
            }
BoneOrientationsConstraint.AxisOrientationConstraint