本文整理汇总了C#中HandState类的典型用法代码示例。如果您正苦于以下问题:C# HandState类的具体用法?C# HandState怎么用?C# HandState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HandState类属于命名空间,在下文中一共展示了HandState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RaiseHandStateChanged
private void RaiseHandStateChanged(KinectBody body, HandType handType, HandState previousState)
{
if (this.HandStateChanged != null)
{
this.HandStateChanged(this, new KinectHandStateEventArgs(body, handType, previousState));
}
}
示例2: structRectangle
public structRectangle() {
rect = new Rectangle();
beginTime = new TimeSpan();
handState = new HandState();
position = "";
gestureTried = false;
}
示例3: Update
public void Update(TrackingConfidence leftConfidence, HandState leftHand, TrackingConfidence rightConfidence, HandState rightHand)
{
if ( leftConfidence == TrackingConfidence.High && leftHand == HandState.Closed )
{
if (!this.HasLeftHandWeapon)
{
this.LeftHandWeaponIndex = this.selectRandomWeapon();
this.HasLeftHandWeapon = true;
}
}
else
{
this.HasLeftHandWeapon = false;
this.LeftHandWeaponIndex = -1;
}
if (rightConfidence == TrackingConfidence.High && rightHand == HandState.Closed)
{
if (!this.HasRightHandWeapon)
{
this.RightHandWeaponIndex = this.selectRandomWeapon();
this.HasRightHandWeapon = true;
}
}
else
{
this.HasRightHandWeapon = false;
this.RightHandWeaponIndex = -1;
}
}
示例4: Awake
void Awake ()
{
handState = HandState.NoAction;
leapManager = (GameObject.Find ("LeapManager") as GameObject).GetComponent (typeof(LeapManager)) as LeapManager;
cueStickController = (GameObject.Find ("CueStickTip") as GameObject).GetComponent (typeof(CueStickController)) as CueStickController;
leapManager.leapController.EnableGesture (Gesture.GestureType.TYPE_SWIPE);
leapManager.leapController.Config.SetFloat ("Gesture.Swipe.MinLength", 200.0f);
leapManager.leapController.Config.SetFloat ("Gesture.Swipe.MinVelocity", 750f);
leapManager.leapController.Config.Save ();
gameStates.Add (GameState.CameraAutoAdjust);
gameStates.Add (GameState.CameraManualAdjust);
gameStates.Add (GameState.Aiming);
gameStates.Add (GameState.AfterShot);
gameStates.Add (GameState.TurnEnd);
viewAdjustmentStateIcon = (GameObject.Find ("ViewAdjustmentStateIcon") as GameObject).GetComponent (typeof(RawImage)) as RawImage;
aimingStateIcon = (GameObject.Find ("AimingStateIcon") as GameObject).GetComponent (typeof(RawImage)) as RawImage;
swipeActionIcon = (GameObject.Find ("SwipeActionIcon") as GameObject).GetComponent (typeof(RawImage)) as RawImage;
playerTurn = (GameObject.Find ("PlayerTurn") as GameObject).GetComponent (typeof(Text)) as Text;
cueBall = GameObject.FindGameObjectWithTag ("cueBall");
cueBall = GameObject.FindGameObjectWithTag ("cueBall");
camera = GameObject.FindGameObjectWithTag ("PlayerCamera");
ballsParent = GameObject.FindGameObjectWithTag ("balls");
foreach (Transform ball in ballsParent.transform) {
balls.Add (ball.gameObject);
}
}
示例5: CustomBody
/// <summary>
/// Initializes a new instance of the <see cref="CustomBody"/> class.
/// </summary>
public CustomBody()
{
_clippedEdges = FrameEdges.None;
_handLeftConfidence = TrackingConfidence.Low;
_handLeftState = HandState.Unknown;
_handRightConfidence = TrackingConfidence.Low;
_handRightState = HandState.Unknown;
_isDisposed = false;
_isRestricted = false;
_isTracked = false;
_joints = new Dictionary<JointType, IJoint>();
_jointOrientations = new Dictionary<JointType, IJointOrientation>();
foreach (var jointType in CustomJointType.AllJoints)
{
_joints.Add(jointType, new CustomJoint(jointType));
_jointOrientations.Add(jointType, new CustomJointOrientation(jointType));
}
_lean = new PointF();
_leanTrackingState = TrackingState.NotTracked;
_trackingId = ulong.MaxValue;
_hasMappedDepthPositions = false;
_hasMappedColorPositions = false;
}
示例6: HandSliderControl
public HandSliderControl(HandDetectionType handDetectionType, HandState requirredHandState,
Directions direction, CoordinateMapper mapper)
: base(handDetectionType, requirredHandState)
{
SmoothLevel = 0;
Direction = direction;
_mapper = mapper;
}
示例7: RangeTrigger
public RangeTrigger(string name, HandState<int> state)
: base(name)
{
Hand = state.Hand;
state.ValueChanged += OnStateValueChanged;
ResistanceTime = 1000000;
StickinessTime = 1000000;
}
示例8: HandOverHeadDetector
public HandOverHeadDetector(HandDetectionType handDetectionType, HandState state, int framesToRegister = 10,
double headOffset = 0, bool headOffsetAutomatic = true)
: base(handDetectionType, state)
{
FramesToRegister = framesToRegister;
HeadOffset = headOffset;
HeadOffsetAutomatic = headOffsetAutomatic;
}
示例9: KinectHandStateEventArgs
/// <summary>
/// Constructor
/// </summary>
/// <param name="body">Kinect body</param>
/// <param name="handType">Hand type</param>
/// <param name="previousHandState">Previous hand state</param>
public KinectHandStateEventArgs(KinectBody body, HandType handType, HandState previousHandState)
{
if (body == null)
throw new ArgumentNullException("body");
this.body = body;
this.handType = handType;
this.previousHandState = previousHandState;
}
示例10: TrackerArgs
public TrackerArgs(Body body, HandState left, HandState right, int yaw, int pitch, int roll)
{
this.body = body;
LeftState = left;
RightState = right;
Yaw = yaw;
Pitch = pitch;
Roll = roll;
}
示例11: getTrackerInfo
public void getTrackerInfo(out Body body, out HandState left, out HandState right, out int yaw, out int pitch,
out int roll)
{
body = eTracker.Engager;
left = eTracker.LeftState;
right = eTracker.RightState;
yaw = eTracker.Yaw;
pitch = eTracker.Pitch;
roll = eTracker.Roll;
}
示例12: Person
public Person(int id)
{
this.id = id;
this.instance = Send.getInstance ();
if (instance == null) {
Console.WriteLine ("Die Instanz ist null");
}
leftHandState = HandState.NotTracked;
rightHandState = HandState.NotTracked;
message = new string[2];
}
示例13: Add
public void Add(HandState aNext)
{
if (State == aNext)
{
Count++;
}
else
{
State = aNext;
Count = 1;
}
}
示例14: Cursor
public Cursor()
{
//
deltaPosition = Vector2.zero;
//
deltaTime = 0;
personId = 0;
leftHand = false;
rightHand = false;
cursorId = -1;
handState = HandState.Open;
position = Vector2.zero;
}
示例15: HandleObject
//constructors
public HandleObject()
{
pos = new Point(200, 200);
vel = new Point(0, 0);
this.radius = 20;
inactiveBrush = Brushes.Red;
activeBrush = Brushes.Green;
pen = new Pen();
prevHandState = HandState.Unknown;
isLeftHandOnObject = false;
isRightHandOnObject = false;
isBoundToHand = false;
currentBrush = inactiveBrush;
maxRadiusFactor = 1.5;
minRadiusFactor = 0.75;
}