本文整理汇总了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;
}
示例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;
}