当前位置: 首页>>代码示例>>C#>>正文


C# HandModel.GetPalmDirection方法代码示例

本文整理汇总了C#中HandModel.GetPalmDirection方法的典型用法代码示例。如果您正苦于以下问题:C# HandModel.GetPalmDirection方法的具体用法?C# HandModel.GetPalmDirection怎么用?C# HandModel.GetPalmDirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HandModel的用法示例。


在下文中一共展示了HandModel.GetPalmDirection方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateTracker

    protected override void UpdateTracker()
    {
        previousPosition = Position;
        previousOrientation = Orientation;
        previousGrabbingStrength = currentGrabbingStrength;

        //get the rightmost hand in the frame
        if (handController.GetAllGraphicsHands().Length != 0)
        {
            handModel = handController.GetAllGraphicsHands()[0];
            handModel.transform.GetComponentInChildren<SkinnedMeshRenderer>().enabled = visibleHand;
            hand = handModel.GetLeapHand();
            currentGrabbingStrength = lowPassFilter(hand.GrabStrength, previousGrabbingStrength);

            Position = lowPassFilter(handModel.GetPalmPosition(), previousPosition);
            Orientation = lowPassFilter(handModel.GetPalmDirection(), previousOrientation);
        }

        //mask/display the graphical hand on key down
        if (Input.GetKeyDown(visibleHandKey))
        {
            var smr = handModel.transform.GetComponentInChildren<SkinnedMeshRenderer>();
            visibleHand = !visibleHand;
        }

        Translation = Position - previousPosition;
        Rotation = previousOrientation - Orientation;
    }
开发者ID:Shujin-IIE,项目名称:RVSI-InteractionsTechniques,代码行数:28,代码来源:Virtual3DTrackerLeap.cs

示例2: ReleaseFireBall

	void ReleaseFireBall(HandModel hand){


		if (currentFireBall && IsCastingStarted && !HandRecog.IsHandClenchingNonStrict (hand, clenchingAngle) && hand.GetLeapHand().Confidence > confidenceLevel) {

			currentFireBall.Release (hand.GetPalmDirection (), 5.0f);
			IsCastingStarted = false;
			currentFireBall = null;

			spellControl.ReleaseCastingControl ();
		}


	}
开发者ID:xzs424,项目名称:Mage-Simulator-Wizard-Adventure,代码行数:14,代码来源:MageFireHandController.cs

示例3: IsFingerBentWithinAngle

	public static bool IsFingerBentWithinAngle(HandModel hand, int fingerIndex, int boneIndex, float minAngle, float maxAngle){

		FingerModel finger = hand.fingers [fingerIndex];
		
		Vector3 fingerDir = finger.GetBoneDirection (boneIndex);
		
		Vector3 palmNormal = hand.GetPalmNormal ();
		
		Vector3 palmDir = hand.GetPalmDirection ();
		
		if (fingerIndex == 0) {
			
			float angle = Math3d.SignedVectorAngle (palmDir, fingerDir, palmNormal);
			
			//Debug.Log ("Finger: " + finger.fingerType + ", bone: " + boneIndex + ", angle to palm direction: " + angle);
			
			if (angle >= minAngle && angle <= maxAngle)
				return true;
				
			
		} else if (fingerIndex > 0) {
			
			Vector3 projPlane = Vector3.Cross(palmNormal, palmDir).normalized;
			Vector3 projVector = Math3d.ProjectVectorOnPlane(projPlane,fingerDir).normalized;
			
			
			float angle = Math3d.SignedVectorAngle(palmNormal,projVector,projPlane);
			
			//Debug.Log ("Finger: " + finger.fingerType + ", bone: " + boneIndex + ", angle to palm direction: " + angle);
			
			if (angle >= minAngle && angle <= maxAngle)
				return true;
		}
		
		
		return false;

	}
开发者ID:xzs424,项目名称:MageSimulator,代码行数:38,代码来源:HandRecog.cs

示例4: AngleBetweenPalmsDirections

	public static float AngleBetweenPalmsDirections(HandModel leftHand, HandModel rightHand, Vector3 projectPlane){

		Vector3 leftPalmDir = leftHand.GetPalmDirection ();
		Vector3 rightPalmDir = rightHand.GetPalmDirection ();

		Vector3 leftPalmDirProj = Math3d.ProjectVectorOnPlane (projectPlane, leftPalmDir).normalized;
		Vector3 rightPalmDirProj = Math3d.ProjectVectorOnPlane (projectPlane, rightPalmDir).normalized;

		float angle = Math3d.SignedVectorAngle (leftPalmDirProj, rightPalmDirProj, projectPlane);

		return angle;

	}
开发者ID:xzs424,项目名称:Mage-Simulator-Wizard-Adventure,代码行数:13,代码来源:HandRecog.cs

示例5: AngleBetweenFingerAndPalmDirection

	public static float AngleBetweenFingerAndPalmDirection(HandModel hand, int fingerIndex, int boneIndex){

		Vector3 palmVector = hand.GetPalmDirection ();
		Vector3 palmNormal = hand.GetPalmNormal ();
		Vector3 crossVect = Vector3.Cross (palmVector, palmNormal).normalized;
		//Debug.Log (crossVect.normalized);

		float angle =  AngleBetweenFingerAndVector (hand, fingerIndex, boneIndex, palmVector, crossVect);

		return angle;
//		if (fingerIndex == 0) {
//			
//			if (hand.GetLeapHand ().IsRight) {
//				return angle;
//			} else {
//				return -angle;
//			}
//
//		} else {
//			
//			return -angle;
//		}
//			
	}
开发者ID:xzs424,项目名称:Mage-Simulator-Wizard-Adventure,代码行数:24,代码来源:HandRecog.cs

示例6: AngleBetweenFingerTipsVertical

	public static float AngleBetweenFingerTipsVertical(HandModel hand, int fingerIndexOne, int fingerIndexTwo){
		Vector3 palmVector = hand.GetPalmDirection ();
		Vector3 palmNormal = hand.GetPalmNormal ();
		Vector3 crossVect = Vector3.Cross (palmVector, palmNormal).normalized;
		return AngleBetweenFingerTips (hand, fingerIndexOne, fingerIndexTwo, crossVect);

	}
开发者ID:xzs424,项目名称:Mage-Simulator-Wizard-Adventure,代码行数:7,代码来源:HandRecog.cs

示例7: ReleaseBolts

	void ReleaseBolts(HandModel leftHand, HandModel rightHand){

		if (currentThunderBolt ) {
			currentThunderBolt.Release ((leftHand.GetPalmDirection () + rightHand.GetPalmDirection ()).normalized, 5.0f);
			IsCastingStarted = false;
			spellControl.ReleaseCastingControl ();
			currentThunderBolt = null;
		}
	}
开发者ID:xzs424,项目名称:Mage-Simulator-Wizard-Adventure,代码行数:9,代码来源:MageThunderHandController.cs


注:本文中的HandModel.GetPalmDirection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。