本文整理汇总了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;
}
示例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 ();
}
}
示例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;
}
示例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;
}
示例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;
// }
//
}
示例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);
}
示例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;
}
}