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


C# HandModel.GetPalmNormal方法代码示例

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


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

示例1: GetFireBallSpawnPosition

	Vector3 GetFireBallSpawnPosition(HandModel hand, float distance){

		Vector3 palmPos = hand.GetPalmPosition ();

		Vector3 palmDir = hand.GetPalmNormal ();

		return palmPos + Vector3.Scale(palmDir,new Vector3(distance,distance,distance));
	}
开发者ID:xzs424,项目名称:Mage-Simulator-Wizard-Adventure,代码行数:8,代码来源:MageFireHandController.cs

示例2: IsPalmFacingDownwards

	public static bool IsPalmFacingDownwards(HandModel hand, float theta){
		Vector3 dir = hand.GetPalmNormal ();

		float angle = Vector3.Angle (dir, -1* hand.transform.up);

		if (Math.Abs (angle) <= theta)
			return true;

		return false;

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

示例3: Fire

    IEnumerator Fire(HandModel currentHand)
    {
        canFire = false;
        //Debug.Log (canFire);

        GameObject justFired = Instantiate (ammo, currentHand.transform.position + currentHand.GetPalmNormal() * offset , currentHand.GetPalmRotation()) as GameObject;
        justFired.GetComponent<moveProjectile> ().target = target;
        //justFired.GetComponent<moveProjectile> ().force = Quaternion.LookRotation( handController.transform.forward, Vector3.down).eulerAngles;
        yield return new WaitForSeconds (delay);
            canFire = true;
    }
开发者ID:VRWizards,项目名称:VRWizards,代码行数:11,代码来源:Shoot.cs

示例4: AngleBetweenPalmsNormals

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

		Vector3 leftPalmNorm = leftHand.GetPalmNormal ();
		Vector3 rightPalmNorm = rightHand.GetPalmNormal ();

		Vector3 leftPalmNormProj = Math3d.ProjectVectorOnPlane (projectPlane,leftPalmNorm).normalized;
		Vector3 rightPalmNormProj = Math3d.ProjectVectorOnPlane (projectPlane,rightPalmNorm).normalized;

		float angle = Math3d.SignedVectorAngle (leftPalmNorm, rightPalmNorm,projectPlane);

		return angle;

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

示例5: IsPalmFacingUpwards

//	//Detect if index finger, middle finger, ring finger and little finger are straight (not bent).
//	public static bool FourFingersStraight(HandModel hand){
//
//		return !IsIndexFingerBent (hand, 3) && !IsMiddleFingerBent (hand, 3) && !IsRingFingerBent (hand, 3)
//			&& !IsLittleFingerBent (hand, 3);
//
//	}
//
	public static bool IsPalmFacingUpwards(HandModel hand, float theta ){

		Vector3 dir = hand.GetPalmNormal ();

		//Vector3 worldUp = hand.transform.TransformDirection(hand.transform.up);

		float angle = Vector3.Angle (dir, hand.transform.up);

		//Debug.Log (angle);

		if (Math.Abs (angle) <= theta)
			return true;

		return false;

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

示例6: 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

示例7: 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

示例8: AngleBetweenFingerTipsHorizontal

	public static float AngleBetweenFingerTipsHorizontal(HandModel hand, int fingerIndexOne, int fingerIndexTwo){


		float angle = AngleBetweenFingerTips(hand,fingerIndexOne, fingerIndexTwo,hand.GetPalmNormal());

		if (hand.GetLeapHand ().IsRight)
			return -angle;

		return angle;

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

示例9: 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


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