当前位置: 首页>>代码示例>>C#>>正文


C# Frame.Pointable方法代码示例

本文整理汇总了C#中Frame.Pointable方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.Pointable方法的具体用法?C# Frame.Pointable怎么用?C# Frame.Pointable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Frame的用法示例。


在下文中一共展示了Frame.Pointable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DispatchLostEvents

	private static void DispatchLostEvents(Frame newFrame, Frame oldFrame)
	{
		foreach( Hand h in oldFrame.Hands )
		{
			if( !h.IsValid )
				continue;
			if( !newFrame.Hand(h.Id).IsValid && HandLost != null )
				HandLost(h.Id);
		}
		foreach( Pointable p in oldFrame.Pointables )
		{
			if( !p.IsValid )
				continue;
			if( !newFrame.Pointable(p.Id).IsValid && PointableLost != null )
				PointableLost(p.Id);
		}
	}
开发者ID:VentorLee,项目名称:unity,代码行数:17,代码来源:LeapInput.cs

示例2: DispatchFoundEvents

	private static void DispatchFoundEvents(Frame newFrame, Frame oldFrame)
	{
		foreach( Hand h in newFrame.Hands )
		{
			if( !h.IsValid )
				continue;
			if( !oldFrame.Hand(h.Id).IsValid && HandFound != null)
				HandFound(h);
		}
		foreach( Pointable p in newFrame.Pointables )
		{
			if( !p.IsValid )
				continue;
			if( !oldFrame.Pointable(p.Id).IsValid && PointableFound != null )
				PointableFound(p);
		}
	}
开发者ID:VentorLee,项目名称:unity,代码行数:17,代码来源:LeapInput.cs

示例3: DispatchUpdatedEvents

	private static void DispatchUpdatedEvents(Frame newFrame, Frame oldFrame)
	{
		foreach( Hand h in newFrame.Hands )
		{
			if( !h.IsValid )
				continue;
			if( oldFrame.Hand(h.Id).IsValid)
				HandUpdated(h);
		}
		foreach( Pointable p in newFrame.Pointables )
		{
			if( !p.IsValid )
				continue;
			if( oldFrame.Pointable(p.Id).IsValid)
				PointableUpdated(p);
		}
	}	
开发者ID:KevinWhalen,项目名称:motion-game,代码行数:17,代码来源:LeapInputEx.cs

示例4: DispatchUpdatedEvents

 private static void DispatchUpdatedEvents(Frame newFrame, Frame oldFrame)
 {
     // For each Hand in the new Frame
     foreach( Hand h in newFrame.Hands )
     {
         // Do nothing if the hand is invalid (fire no events)
         if( !h.IsValid )
             continue;
         // If the hand was valid in the previous Frame and is _still_
         // valid, and the HandUpdated event has a handler
         if( oldFrame.Hand(h.Id).IsValid && HandUpdated != null)
             // Fire the HandUpdated event for this Hand
             HandUpdated(h);
     }
     // Do the same as above for pointables (Fingers and Tools)
     // (Note that Hands are not Pointables)
     foreach( Pointable p in newFrame.Pointables )
     {
         if( !p.IsValid )
             continue;
         if( oldFrame.Pointable(p.Id).IsValid && PointableUpdated != null)
             PointableUpdated(p);
     }
 }
开发者ID:brennon,项目名称:lightitup,代码行数:24,代码来源:LeapInput.cs

示例5: DispatchLostEvents

 private static void DispatchLostEvents(Frame newFrame, Frame oldFrame)
 {
     // Iterate over hands in the previous frame
     foreach( Hand h in oldFrame.Hands )
     {
         // If this hand in the previous frame was invalid, continue
         // (A valid hand is one that contains valid tracking data)
         if( !h.IsValid )
             continue;
         // If this hand in the previous frame was valid, but is now
         // invalid, and if the HandLost event has a handler
         if( !newFrame.Hand(h.Id).IsValid && HandLost != null )
             // Fire the HandLost event for this hand
             HandLost(h.Id);
     }
     // Do the same as above for pointables (Fingers and Tools)
     // (Note that Hands are not Pointables)
     foreach( Pointable p in oldFrame.Pointables )
     {
         if( !p.IsValid )
             continue;
         if( !newFrame.Pointable(p.Id).IsValid && PointableLost != null )
             PointableLost(p.Id);
     }
 }
开发者ID:brennon,项目名称:lightitup,代码行数:25,代码来源:LeapInput.cs

示例6: DispatchFoundEvents

 private static void DispatchFoundEvents(Frame newFrame, Frame oldFrame)
 {
     // Iterate over hands in the new frame
     foreach( Hand h in newFrame.Hands )
     {
         // If the current hand is not valid, continue (fire no events)
         if( !h.IsValid )
             continue;
         // If the current hand was not valid in the previous frame
         // and if the HandLost event has a handler
         if( !oldFrame.Hand(h.Id).IsValid && HandFound != null)
             // Fire the HandFound event for this hand
             HandFound(h);
     }
     // Do the same as above for pointables (Fingers and Tools)
     // (Note that Hands are not Pointables)
     foreach( Pointable p in newFrame.Pointables )
     {
         if( !p.IsValid )
             continue;
         if( !oldFrame.Pointable(p.Id).IsValid && PointableFound != null )
             PointableFound(p);
     }
 }
开发者ID:brennon,项目名称:lightitup,代码行数:24,代码来源:LeapInput.cs

示例7: DispatchUpdatedEvents

 private static void DispatchUpdatedEvents(Frame newFrame, Frame oldFrame)
 {
     foreach( Hand h in newFrame.Hands )
     {
         if( !h.IsValid )
             continue;
         if( oldFrame.Hand(h.Id).IsValid && HandUpdated != null)
             HandUpdated(h, !HandCloseToBoundary(h));
     }
     foreach( Pointable p in newFrame.Pointables )
     {
         if( !p.IsValid )
             continue;
         if( oldFrame.Pointable(p.Id).IsValid && PointableUpdated != null)
             PointableUpdated(p, !FingerCloseToBoundary(p) && !DraggingMode);
     }
 }
开发者ID:lzljzys,项目名称:VRAIDS,代码行数:17,代码来源:LeapInput.cs


注:本文中的Frame.Pointable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。