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


C# Position.GetAcceleration方法代码示例

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


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

示例1: ParameterizedMousePosition

 public ParameterizedMousePosition(Position.IVirtualMousePosition mousePos, int fakeTime)
 {
     m_mouse = mousePos;
     m_newPosition = mousePos.GetVirtualPointD();
     m_newAcceleration = mousePos.GetAcceleration();
     m_newVelocity = mousePos.GetVelocity();
     m_newDisplacement = m_mouse.GetDisplacement();
     m_fakeTime = fakeTime;
 }
开发者ID:rhfung,项目名称:KinematicTemplates,代码行数:9,代码来源:ParameterizedMousePosition.cs

示例2: Compute

        public void Compute(Position.IVirtualMousePosition mousePosition, out bool filtersChanged)
        {
            int i = 0;
            PointD sumVel = mousePosition.GetVelocity();
            PointD sumAccel = mousePosition.GetAcceleration();

            PointD displ = mousePosition.GetDisplacement();
            Position.ParameterizedMousePosition mp = new Position.ParameterizedMousePosition(mousePosition);

            int numInUse = 0;// instrumentation
            filtersChanged = false; // flag out if filter state changes

            for (i = 0; i < m_Filters.Count; i++)
            {
                if (m_Filters[i].Parameters.FilterEnabled )
                {
                    if (m_Filters[i].HitTest(mousePosition.GetVirtualPointD()))
                    {
                        if (!m_Filters[i].Parameters.InUse)
                            m_Filters[i].Parameters.UseCounter++;

                        if (!m_Filters[i].Parameters.InUse)
                            filtersChanged = true;

                        m_Filters[i].Parameters.InUse = true;
                        numInUse++;// instrumentation

                        PointD vel = m_Filters[i].GetVelocity(mp);
                        if (!(double.IsNaN(vel.X) || double.IsInfinity(vel.X)
                            || double.IsNaN(vel.Y) || double.IsNaN(vel.Y)))
                        {
                            sumVel += vel;
                            mp.SetVelocity(sumVel);
                        }

                    }
                    else
                    {
                        if (m_Filters[i].Parameters.InUse)
                            filtersChanged = true;

                        m_Filters[i].Parameters.InUse = false;
                    }
                }
            }
            m_maxNumInUse = Math.Max(numInUse, m_maxNumInUse); // instrumentation
            m_computedAcceleration = sumAccel;
            m_computedVelocity = sumVel;
        }
开发者ID:rhfung,项目名称:KinematicTemplates,代码行数:49,代码来源:FilterManager.cs


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