GetSkeletonTransform() private method

private GetSkeletonTransform ( int player, int joint, SkeletonTransform &trans ) : void
player int
joint int
trans SkeletonTransform
return void
/********************************************************************************
*           USER METHODS -> Call these methods from your scripts
* ******************************************************************************/

    /// <summary>
    /// main joint position get function
    /// </summary>
    /// <param name="player">player number (1,2)</param>
    /// <param name="joint">KinectWrapper.Joints enum</param>
    /// <returns>position of given joint for given player</returns>
    public Vector3 GetJointPos(int player, KinectWrapper.Joints joint)
    {
        KinectWrapper.SkeletonTransform trans = new KinectWrapper.SkeletonTransform();
        if (NUIisReady)
        {
            KinectWrapper.GetSkeletonTransform(player, (int)joint, ref trans);
            return(new Vector3(trans.x * scaleFactor, trans.y * scaleFactor, trans.z * scaleFactor));
        }
        else
        {
            return(Vector3.zero);
        }
    }
Beispiel #2
0
 public Vector3 GetJointPos(KinectWrapper.Joints joint)
 {
     KinectWrapper.SkeletonTransform trans = new KinectWrapper.SkeletonTransform();
     KinectWrapper.GetSkeletonTransform((int)joint, ref trans);
     return(new Vector3(trans.x * scaleFactor, trans.y * scaleFactor, trans.z * scaleFactor));
 }