UpdateJoint() public méthode

public UpdateJoint ( SkeletonJoint joint, SkeletonJointTransformation skelTrans ) : void
joint SkeletonJoint
skelTrans OpenNI.SkeletonJointTransformation
Résultat void
    public void UpdateSkeleton(int userId, OpenNISkeleton skeleton)
    {
        // make sure we have skeleton data for this user
        if (!skeletonCapbility.IsTracking(userId))
        {
            return;
        }

        // Use torso as root
        SkeletonJointTransformation skelTrans = new SkeletonJointTransformation();

        skelTrans = skeletonCapbility.GetSkeletonJoint(userId, SkeletonJoint.Torso);
        if (skeleton.absolute)
        {
            Point3D pos = skelTrans.Position.Position;
            skeleton.UpdateRoot(new Vector3(pos.X, pos.Y, pos.Z));
        }
        else
        {
            Point3D pos    = skelTrans.Position.Position;
            Vector3 v3dpos = new Vector3(pos.X, pos.Y, -pos.Z);
            Vector3 calPos = userCalibrationPosition[userId];
            skeleton.UpdateRoot(calPos - v3dpos);
        }

        // update each joint with data from OpenNI
        foreach (SkeletonJoint joint in Enum.GetValues(typeof(SkeletonJoint)))
        {
            if (skeletonCapbility.IsJointAvailable(joint))
            {
                skelTrans = skeletonCapbility.GetSkeletonJoint(userId, joint);
                skeleton.UpdateJoint(joint, skelTrans);
            }
        }
    }
    public void UpdateSkeleton(int userId, OpenNISkeleton skeleton)
    {
        // make sure we have skeleton data for this user
        if (!skeletonCapbility.IsTracking(userId))
        {
            return;
        }

        // Use torso as root
        SkeletonJointTransformation skelTrans = new SkeletonJointTransformation();
        skelTrans = skeletonCapbility.GetSkeletonJoint(userId, SkeletonJoint.Torso);
        skeleton.UpdateRoot(skelTrans.Position.Position);

        // update each joint with data from OpenNI
        foreach (SkeletonJoint joint in Enum.GetValues(typeof(SkeletonJoint)))
        {
            if (skeletonCapbility.IsJointAvailable(joint))
            {
                skelTrans = skeletonCapbility.GetSkeletonJoint(userId, joint);
                skeleton.UpdateJoint(joint, skelTrans);
            }
        }
    }
Exemple #3
0
    public void UpdateSkeleton(int userId, OpenNISkeleton skeleton)
    {
        // make sure we have skeleton data for this user
        if (!skeletonCapbility.IsTracking(userId))
        {
            return;
        }

        // Use torso as root
        SkeletonJointTransformation skelTrans = new SkeletonJointTransformation();

        skelTrans = skeletonCapbility.GetSkeletonJoint(userId, SkeletonJoint.Torso);
        skeleton.UpdateRoot(skelTrans.Position.Position);

        // update each joint with data from OpenNI
        foreach (SkeletonJoint joint in Enum.GetValues(typeof(SkeletonJoint)))
        {
            if (skeletonCapbility.IsJointAvailable(joint))
            {
                skelTrans = skeletonCapbility.GetSkeletonJoint(userId, joint);
                skeleton.UpdateJoint(joint, skelTrans);
            }
        }
    }
	public void UpdateSkeleton(int userId, OpenNISkeleton skeleton)
	{
		// make sure we have skeleton data for this user
		if (!skeletonCapbility.IsTracking(userId))
		{
			return;
		}
		
		// Use torso as root
		SkeletonJointTransformation skelTrans = new SkeletonJointTransformation();
		skelTrans = skeletonCapbility.GetSkeletonJoint(userId, SkeletonJoint.Torso);
		if (skeleton.absolute)
		{		
			Point3D pos = skelTrans.Position.Position;
			skeleton.UpdateRoot(new Vector3(pos.X,pos.Y,pos.Z));
		}
		else
		{
			Point3D pos = skelTrans.Position.Position;
			Vector3 v3dpos = new Vector3(pos.X, pos.Y, -pos.Z);
			Vector3 calPos = userCalibrationPosition[userId];
			skeleton.UpdateRoot(calPos - v3dpos); 
		}
		
		// update each joint with data from OpenNI
		foreach (SkeletonJoint joint in Enum.GetValues(typeof(SkeletonJoint)))
		{
			if (skeletonCapbility.IsJointAvailable(joint))
			{
				skelTrans = skeletonCapbility.GetSkeletonJoint(userId, joint);
				skeleton.UpdateJoint(joint, skelTrans);
			}
		}
	}