本文整理汇总了C#中HandState类的典型用法代码示例。如果您正苦于以下问题:C# HandState类的具体用法?C# HandState怎么用?C# HandState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HandState类属于命名空间,在下文中一共展示了HandState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RaiseHandStateChanged
private void RaiseHandStateChanged(KinectBody body, HandType handType, HandState previousState)
{
if (this.HandStateChanged != null)
{
this.HandStateChanged(this, new KinectHandStateEventArgs(body, handType, previousState));
}
}
开发者ID:semihguresci,项目名称:kgp,代码行数:7,代码来源:HandStateTrackingProcessor.cs
示例2: structRectangle
public structRectangle() {
rect = new Rectangle();
beginTime = new TimeSpan();
handState = new HandState();
position = "";
gestureTried = false;
}
开发者ID:ylegatParticulate,项目名称:NPI---Kinect-2.0,代码行数:7,代码来源:MainWindow.xaml.cs
示例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;
}
}
开发者ID:space150,项目名称:s150-venice-halloween-2015,代码行数:30,代码来源:BodyState.cs
示例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);
}
}
开发者ID:ly774508966,项目名称:leapMotion8Ball,代码行数:34,代码来源:Game.cs
示例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;
}
开发者ID:douglaswinstonr,项目名称:KinectDL,代码行数:30,代码来源:CustomBody.cs
示例6: HandSliderControl
public HandSliderControl(HandDetectionType handDetectionType, HandState requirredHandState,
Directions direction, CoordinateMapper mapper)
: base(handDetectionType, requirredHandState)
{
SmoothLevel = 0;
Direction = direction;
_mapper = mapper;
}
开发者ID:Aniel,项目名称:SimpleKinectGesture,代码行数:8,代码来源:HandSliderControl.cs
示例7: RangeTrigger
public RangeTrigger(string name, HandState<int> state)
: base(name)
{
Hand = state.Hand;
state.ValueChanged += OnStateValueChanged;
ResistanceTime = 1000000;
StickinessTime = 1000000;
}
开发者ID:RossDay,项目名称:Leap,代码行数:8,代码来源:RangeTrigger.cs
示例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;
}
开发者ID:Aniel,项目名称:SimpleKinectGesture,代码行数:8,代码来源:HandOverHeadDetector.cs
示例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;
}
开发者ID:semihguresci,项目名称:kgp,代码行数:15,代码来源:KinectHandStateEventArgs.cs
示例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;
}
开发者ID:ThisIsLeoZhao,项目名称:Graduation-Project,代码行数:9,代码来源:TrackerArgs.cs
示例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;
}
开发者ID:ThisIsLeoZhao,项目名称:Graduation-Project,代码行数:10,代码来源:EngagementManager.cs
示例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];
}
开发者ID:uagnd,项目名称:S-BPM_VR,代码行数:11,代码来源:Person.cs
示例13: Add
public void Add(HandState aNext)
{
if (State == aNext)
{
Count++;
}
else
{
State = aNext;
Count = 1;
}
}
开发者ID:Dig-Doug,项目名称:BU_KinectShowcase,代码行数:12,代码来源:HandStateCounter.cs
示例14: Cursor
public Cursor()
{
//
deltaPosition = Vector2.zero;
//
deltaTime = 0;
personId = 0;
leftHand = false;
rightHand = false;
cursorId = -1;
handState = HandState.Open;
position = Vector2.zero;
}
开发者ID:ShipuW,项目名称:unity-study,代码行数:13,代码来源:Cursor.cs
示例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;
}
开发者ID:davidboyd96,项目名称:Bits-Please--FINAL,代码行数:17,代码来源:HandleObject.cs
示例16: DrawHand
private void DrawHand(HandState handState, Point handPosition)
{
switch (handState)
{
case HandState.Closed:
drawingContext.DrawEllipse(this.handClosedBrush, null, handPosition, HandSize, HandSize);
break;
case HandState.Open:
drawingContext.DrawEllipse(this.handOpenBrush, null, handPosition, HandSize, HandSize);
break;
case HandState.Lasso:
drawingContext.DrawEllipse(this.handLassoBrush, null, handPosition, HandSize, HandSize);
break;
}
}
开发者ID:greenbaum,项目名称:KinectV2-OSC,代码行数:17,代码来源:HandsRenderer.cs
示例17: BodyWithRightHandState
public static KinectBodyInternal BodyWithRightHandState(ulong id, TrackingConfidence confidence, HandState state)
{
var result = new KinectBodyInternal()
{
ClippedEdges = FrameEdges.None,
HandLeftConfidence = TrackingConfidence.High,
HandLeftState = HandState.NotTracked,
HandRightConfidence = confidence,
HandRightState = state,
IsRestricted = false,
IsTracked = true,
JointOrientations = new JointOrientation[Microsoft.Kinect.Body.JointCount],
Joints = FakeJoints.ValidRandomJoints(),
LeanTrackingState = TrackingState.NotTracked,
TrackingId = id
};
return result;
}
开发者ID:semihguresci,项目名称:kgp,代码行数:18,代码来源:FakeInternalBodies.cs
示例18: Start
// Use this for initialization
void Start () {
spells.Add(new VoidSpear(this.transform.position));
leftHandState = HandState.idle;
rightHandState = HandState.idle;
chargeProgressIndicator = ChargeIndicator.GetComponent<ProgressBar>();
chargeProgressIndicator.Min = 0;
chargeProgressIndicator.Max = 100;
chargeProgressIndicator.Value = 0;
chargeProgressIndicator.DecimalPlaces = 0;
chargeProgressIndicator.valueType = ProgressBar.ValueType.Percentage;
cooldownProgressIndicator = CooldownIndicator.GetComponent<ProgressBar>();
cooldownProgressIndicator.Value = 0;
cooldownProgressIndicator.DecimalPlaces = 1;
cooldownProgressIndicator.valueType = ProgressBar.ValueType.Float;
cooldownProgressIndicator.color = Color.red;
}
开发者ID:VGuerreiro,项目名称:steadfast,代码行数:20,代码来源:WizardController.cs
示例19: Person
public Person(string ID, Point3D location, string gesture, trackingStates trackState,Joint leftHand, Joint rightHand, HandState leftHandState, HandState rightHandState, TrackingConfidence leftHandConfidence, TrackingConfidence rightHandConfidence)
{
this.ID = ID;
this.location = location;
this.gesture = gesture;
this.trackingState = (int)trackState;
this.leftHandLocation = null;
this.rightHandLocation = null;
if (leftHand.TrackingState == TrackingState.Tracked) {
this.leftHandLocation = new Point3D((double)leftHand.Position.X, (double)leftHand.Position.Y, (double)leftHand.Position.Z);
this.leftHandState = leftHandState.ToString();
this.leftHandConfidence = leftHandConfidence.ToString();
this.rightHandConfidence = rightHandConfidence.ToString();
}
if (rightHand.TrackingState == TrackingState.Tracked)
{
this.rightHandLocation = new Point3D((double)rightHand.Position.X, (double)rightHand.Position.Y, (double)rightHand.Position.Z);
this.rightHandState = rightHandState.ToString();
}
}
开发者ID:ase-lab,项目名称:SoD_Sensor_v2,代码行数:21,代码来源:Person.cs
示例20: Hand
internal Hand(ulong trackingID, HandState state, IList<DepthPointEx> contour, IList<DepthPointEx> fingers, CoordinateMapper coordinateMapper)
{
TrackingId = trackingID;
if (state == HandState.Open)
{
Fingers = fingers.Select(f => new Finger(f, coordinateMapper)).ToList();
}
else
{
Fingers = new List<Finger>();
}
ushort[] depths = contour.Select(d => (ushort)d.Z).ToArray();
ContourDepth = contour.Select(p => new DepthSpacePoint { X = p.X, Y = p.Y }).ToArray();
ContourCamera = new CameraSpacePoint[ContourDepth.Count];
coordinateMapper.MapDepthPointsToCameraSpace((DepthSpacePoint[])ContourDepth, depths, (CameraSpacePoint[])ContourCamera);
ContourColor = new ColorSpacePoint[ContourDepth.Count];
coordinateMapper.MapDepthPointsToColorSpace((DepthSpacePoint[])ContourDepth, depths, (ColorSpacePoint[])ContourColor);
}
开发者ID:guozanhua,项目名称:Kinect-Finger-Tracking,代码行数:23,代码来源:Hand.cs
注:本文中的HandState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论