本文整理汇总了C#中Finger类的典型用法代码示例。如果您正苦于以下问题:C# Finger类的具体用法?C# Finger怎么用?C# Finger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Finger类属于命名空间,在下文中一共展示了Finger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPhase
protected override FingerGestures.FingerPhase GetPhase( Finger finger )
{
int button = finger.Index;
// did we just press it?
if( Input.GetMouseButtonDown( button ) )
return FingerPhase.Began;
// mouse button down?
if( Input.GetMouseButton( button ) )
{
// find out if the mouse has moved since last update
Vector3 delta = GetPosition( finger ) - finger.Position;
if( delta.sqrMagnitude < 1.0f )
return FingerPhase.Stationary;
return FingerPhase.Moved;
}
// did we just release the button?
if( Input.GetMouseButtonUp( button ) )
return FingerPhase.Ended;
return FingerPhase.None;
}
示例2: GetBoneDirection
// Returns the direction the given bone is facing on the finger.
protected Vector3 GetBoneDirection(Finger finger, int bone)
{
Vector3 difference = finger.JointPosition((Finger.FingerJoint)(bone + 1)).ToUnity() -
finger.JointPosition((Finger.FingerJoint)(bone)).ToUnity();
difference.Normalize();
return difference;
}
示例3: ConvertType
public static PointerType ConvertType(Hand hand, Finger.FingerType fingerType)
{
if (hand.IsRight) {
switch (fingerType) {
case Finger.FingerType.TYPE_THUMB:
return PointerType.RightThumb;
case Finger.FingerType.TYPE_INDEX:
return PointerType.RightIndex;
case Finger.FingerType.TYPE_MIDDLE:
return PointerType.RightMiddle;
case Finger.FingerType.TYPE_RING:
return PointerType.RightRing;
case Finger.FingerType.TYPE_PINKY:
return PointerType.RightPinky;
}
} else if (hand.IsLeft) {
switch (fingerType) {
case Finger.FingerType.TYPE_THUMB:
return PointerType.LeftThumb;
case Finger.FingerType.TYPE_INDEX:
return PointerType.LeftIndex;
case Finger.FingerType.TYPE_MIDDLE:
return PointerType.LeftMiddle;
case Finger.FingerType.TYPE_RING:
return PointerType.LeftRing;
case Finger.FingerType.TYPE_PINKY:
return PointerType.LeftPinky;
}
}
return PointerType.NULL;
}
示例4: TrackIndex
private void TrackIndex(Finger finger, PXCMHandData.IHand handInfo) {
SetJointdata(handInfo, PXCMHandData.JointType.JOINT_INDEX_BASE, finger.BaseJoint);
SetJointdata(handInfo, PXCMHandData.JointType.JOINT_INDEX_JT1, finger.FirstJoint);
SetJointdata(handInfo, PXCMHandData.JointType.JOINT_INDEX_JT2, finger.SecondJoint);
SetJointdata(handInfo, PXCMHandData.JointType.JOINT_INDEX_TIP, finger);
SetFingerOpenness(finger, PXCMHandData.FingerType.FINGER_INDEX, handInfo);
}
示例5: UpdateFinger
public override void UpdateFinger(Finger finger, Transform deviceTransform,
Vector3 palm_normal, Vector3 palm_direction)
{
Vector3 last_bone_normal = palm_normal;
Vector3 last_bone_direction = palm_direction;
for (int i = 0; i < NUM_BONES; ++i) {
// Set velocity.
Vector3 next_bone_position = deviceTransform.TransformPoint(GetBonePosition(finger, i));
bones[i].rigidbody.velocity = (next_bone_position - bones[i].transform.position) *
((1 - easing) / Time.fixedDeltaTime);
// Set angular velocity.
Vector3 bone_direction = deviceTransform.rotation * GetBoneDirection(finger, i);
Vector3 bone_normal = Quaternion.FromToRotation(last_bone_direction, bone_direction) * last_bone_normal;
Quaternion delta_rotation = Quaternion.LookRotation(bone_direction, -bone_normal) *
Quaternion.Inverse(bones[i].transform.rotation);
float angle = 0.0f;
Vector3 axis = Vector3.zero;
delta_rotation.ToAngleAxis(out angle, out axis);
if (angle >= 180) {
angle = 360 - angle;
axis = -axis;
}
if (angle != 0)
bones[i].rigidbody.angularVelocity = (1 - easing) * angle * axis;
last_bone_direction = bone_direction;
last_bone_normal = bone_normal;
}
}
示例6: OnTriggerEnter
void OnTriggerEnter(Collider collider)
{
if (IsFinger(collider) && gm.getColorChoserActive()) {
if (!hasSphere)
{
fingerModel = collider.gameObject.GetComponentInParent<FingerModel>();
f = fingerModel.GetLeapFinger();
// Debug.Log(f);
if(fingerModel.fingerType.ToString().Equals("TYPE_INDEX"))
{
col = collider;
// Neue Sphere erstellen mit der Farbe vom Bucket
QuizManager.setHasColor(true);
Destroy(drop);
Colors.drop = Instantiate(Resources.Load("Drop")) as GameObject;
Colors.drop.transform.position = new Vector3(0, 1.5F, 0);
Colors.drop.transform.localScale = new Vector3(0.5F,0.5F,0.5F);
Renderer m = Colors.drop.GetComponent<Renderer>();
QuizManager.shaderName = bucketMat.name;
m.material = bucketMat;
Colors.drop.transform.position = fingerModel.GetTipPosition();
hasSphere = true;
QuizManager.setHasColor(true);
}
}
}
if (IsHand(collider))
{
// print("Hand berührt");
}
}
示例7: Hand
public Hand(Side side) {
Thumb = new Finger();
Index = new Finger();
Middle = new Finger();
Ring = new Finger();
Pinky = new Finger();
Side = side;
}
示例8: Finger2C_Reflect
public GeneInfo.GeneInfoC_Reflect Finger2C_Reflect(Finger finger)
{
Vector3 point = Camera.main.ScreenToWorldPoint (finger.Positions [0]);
point.z = 0;
Debug.LogFormat ("Reflet:ScreenPoint {0},{1}", finger.Positions [0].x, finger.Positions [0].y);
Debug.LogFormat ("Reflet:WorldPoint {0},{1}", point.x, point.y);
return new GeneInfo.GeneInfoC_Reflect (point);
}
示例9: makeFinger
private IKSegment[] makeFinger(Finger finger)
{
List<IKSegment> chain = new List<IKSegment>();
addToChain(ref chain, finger.Base);
addToChain(ref chain, finger.Mid);
addToChain(ref chain, finger.End);
return chain.ToArray();
}
示例10: GetTouch
UnityEngine.Touch GetTouch( Finger finger )
{
int touchIndex = finger2touchMap[finger.Index];
if( touchIndex == -1 )
return nullTouch;
return Input.touches[touchIndex];
}
示例11: Finger2C_Curbe
public GeneInfo.GeneInfoC_Curve Finger2C_Curbe(Finger finger)
{
List<Vector3> pts = new List<Vector3> ();
for (int i = 0; i < finger.Positions.Count; i++) {
Vector3 pt = Camera.main.ScreenToWorldPoint(finger.Positions[i]);
pt.z = 0;
pts.Add(pt);
}
return new GeneInfo.GeneInfoC_Curve (pts);
}
示例12: Finger2C_Borard
public GeneInfo.GeneInfoC_Board Finger2C_Borard(Finger finger0, Finger finger1)
{
Vector3 p1 = Camera.main.ScreenToWorldPoint (finger0.Positions [0]);
Vector3 p2 = Camera.main.ScreenToWorldPoint (finger1.Positions [0]);
p1.z = 0f;
p2.z = 0f;
Debug.LogFormat ("Board:ScreenPoint {0},{1},{2},{3}", finger0.Positions [0].x, finger0.Positions [0].y, finger1.Positions [0].x, finger1.Positions [0].y);
Debug.LogFormat ("Board:WorldPoint {0},{1},{2},{3}", p1.x, p1.y, p2.x, p2.y);
return new GeneInfo.GeneInfoC_Board (p1, p2);
}
示例13: UpdatePosition
void UpdatePosition()
{
#if UNITY_EDITOR
Finger f = new Finger();
f.x = Input.mousePosition.x;
f.y = Input.mousePosition.y;
Vector3 mousePosition = Camera.main.ScreenToWorldPoint(new Vector3(f.x, f.y));
transform.position=mousePosition;
#endif
}
示例14: CreateDigit
public static LEAP_DIGIT CreateDigit(Finger finger) {
LEAP_DIGIT digit = new LEAP_DIGIT();
digit.finger_id = finger.Id;
digit.metacarpal = CreateBone(finger.Bone(Bone.BoneType.TYPE_METACARPAL));
digit.proximal = CreateBone(finger.Bone(Bone.BoneType.TYPE_PROXIMAL));
digit.intermediate = CreateBone(finger.Bone(Bone.BoneType.TYPE_INTERMEDIATE));
digit.distal = CreateBone(finger.Bone(Bone.BoneType.TYPE_DISTAL));
digit.tip_velocity = new LEAP_VECTOR(finger.TipVelocity);
digit.stabilized_tip_position = Vector3.zero.ToCVector(); //HACK: stabilized position is sometimes NaN, ignore it
digit.is_extended = finger.IsExtended ? 1 : 0;
return digit;
}
示例15: TestOSC
public TestOSC(IEnumerable<string> args)
{
allPixels = new VirtualPixel1D("All Pixels", 28 + 50);
loopSeq = new Controller.Sequence("Loop Seq");
fingers = new Finger[10];
for (int i = 0; i < 10; i++)
fingers[i] = new Finger();
testDimmer = new Dimmer("Test");
this.oscServer = new Expander.OscServer(5555);
}