本文整理汇总了C#中HandModel.GetLeapHand方法的典型用法代码示例。如果您正苦于以下问题:C# HandModel.GetLeapHand方法的具体用法?C# HandModel.GetLeapHand怎么用?C# HandModel.GetLeapHand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HandModel
的用法示例。
在下文中一共展示了HandModel.GetLeapHand方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: CastFireBall
void CastFireBall(HandModel hand){
if (!IsCastingStarted && hand.GetLeapHand().Confidence >= confidenceLevel && !spellControl.SpellCasting()) {
spellControl.SpellCasting ();
IsCastingStarted = true;
currentFireBall = GameObject.Instantiate (fireBallPrefab, GetFireBallSpawnPosition (hand, fireBallSpawnLocation), hand.gameObject.transform.rotation) as FireBall;
//currentFireBall.transform.SetParent (handController.transform);
}
}
示例4: Start
void Start()
{
active = false;
hand_model = GetComponent<HandModel>();
leap_hand = hand_model.GetLeapHand();
if (leap_hand == null) Debug.LogError("No leap_hand founded");
if(isRight)
{
if(!lControl.rightHanded)
{
isRight = false;
}
}
else
{
if(lControl.leftHanded)
{
isRight = true;
}
}
}
示例5: 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;
}
示例6: DestroyHand
/**
* Destroys a HandModel instance if HandController.destroyHands is true (the default).
* If you set destroyHands to false, you must destroy the hand instances elsewhere in your code.
* EDIT BV : put back the hands in the initial position
*/
protected void DestroyHand(HandModel hand_model)
{
if (hand_model.GetLeapHand().IsLeft) {
lefthand = null;
//Debug.Log("DestroyHand: minus left hand");
} else {
righthand = null;
//Debug.Log("DestroyHand: minus right hand");
}
if (destroyHands)
Destroy(hand_model.gameObject);
else
hand_model.SetLeapHand(null);
//Debug.Log("DestroyHand " + hand_model);
}
示例7: GetHandInfo
private void GetHandInfo()
{
//Get hand info and if there's no hand in the scene, don't run the rest of the update
handModel = GetComponent<HandModel>();
leapHand = handModel.GetLeapHand();
if (leapHand == null)
return;
}
示例8: IsReadyToCastFireBall
bool IsReadyToCastFireBall(HandModel hand){
return HandRecog.IsPalmFacingUpwards (hand, palmFacingUpAngle) && HandRecog.IsHandClenchingStrict (hand, clenchingAngle) && hand.GetLeapHand().Confidence >= confidenceLevel;
}