本文整理汇总了C#中HandModel.GetPalmPosition方法的典型用法代码示例。如果您正苦于以下问题:C# HandModel.GetPalmPosition方法的具体用法?C# HandModel.GetPalmPosition怎么用?C# HandModel.GetPalmPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HandModel
的用法示例。
在下文中一共展示了HandModel.GetPalmPosition方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Start
void Start()
{
handmodel = GetComponent<HandModel>();
_grabedObj = null;
palmPostion = handmodel.GetPalmPosition();
velocity = Vector3.zero;
}
示例3: DirectionBetweenPalm
public static Vector3 DirectionBetweenPalm(HandModel fromHand, HandModel toHand){
Vector3 fromHandPalmPos = fromHand.GetPalmPosition ();
Vector3 toHandPalmPos = toHand.GetPalmPosition ();
return Math3dExt.Direction (fromHandPalmPos, toHandPalmPos);
}
示例4: DistanceBetweenPalms
public static float DistanceBetweenPalms(HandModel handOne, HandModel handTwo){
Vector3 handOnePalmPos = handOne.GetPalmPosition();
Vector3 handTwoPalmPos = handTwo.GetPalmPosition ();
return Math3dExt.Distance (handOnePalmPos, handTwoPalmPos);
}
示例5: 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));
}
示例6: CastBolts
void CastBolts(HandModel leftHand, HandModel rightHand ){
if (!IsCastingStarted && !spellControl.SpellCasting()) {
Vector3 middle = leftHand.GetPalmPosition () + rightHand.GetPalmPosition ();
currentThunderBolt = GameObject.Instantiate (thunderBoltPrefab, middle, gameObject.transform.rotation) as ThunderBolt;
currentThunderBolt.SetPosition (leftHand.GetPalmPosition (), rightHand.GetPalmPosition ());
IsCastingStarted = true;
spellControl.GrabCastingControl ();
}
}
示例7: HorizonCheck
public bool HorizonCheck(HandModel hand)
{
Ray ray = new Ray(m_rayRoot.position, (hand.GetPalmPosition() - m_rayRoot.position).normalized);
Debug.DrawRay(m_rayRoot.position, ray.direction * 10000.0f, new Color(1.0f, 0.0f,0.0f));
RaycastHit hitInfo;
LayerMask mask = LayerMask.GetMask("Earth");
bool hit = Physics.Raycast(ray, out hitInfo, 10000.0f, mask);
if ( hit ) {
return true;
}
else {
return false;
}
}
示例8: MiddleBetweenPalms
public Vector3 MiddleBetweenPalms(HandModel handOne, HandModel handTwo){
return Math3dExt.MidPosition (handOne.GetPalmPosition (), handTwo.GetPalmPosition ());
}
示例9: UpdateBolts
void UpdateBolts(HandModel leftHand, HandModel rightHand){
if (currentThunderBolt && IsCastingStarted)
currentThunderBolt.SetPosition (leftHand.GetPalmPosition (), rightHand.GetPalmPosition ());
}