本文整理汇总了C#中Position.GetVirtualPointD方法的典型用法代码示例。如果您正苦于以下问题:C# Position.GetVirtualPointD方法的具体用法?C# Position.GetVirtualPointD怎么用?C# Position.GetVirtualPointD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Position
的用法示例。
在下文中一共展示了Position.GetVirtualPointD方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParameterizedMousePosition
/*
public ParameterizedMousePosition(Position.IVirtualMousePosition mousePos, PointD newVirtualPosition, PointD newVelocity, PointD newAcceleration)
{
m_mouse = mousePos;
m_newPosition = newVirtualPosition;
m_newAcceleration = newAcceleration;
m_newVelocity = newVelocity;
* m_newDisplacement = m_mouse.GetDisplacement();
m_fakeTime = mousePos.GetTimeInterval();
}*/
public ParameterizedMousePosition(Position.IVirtualMousePosition mousePos, PointD newVelocity, PointD newAcceleration)
{
m_mouse = mousePos;
m_newPosition = mousePos.GetVirtualPointD();
m_newAcceleration = newAcceleration;
m_newVelocity = newVelocity;
m_newDisplacement = m_mouse.GetDisplacement();
m_fakeTime = mousePos.GetTimeInterval();
}
示例2: GetVelocity
public override PointD GetVelocity(Position.IVirtualMousePosition m)
{
PointD normalVector;
PointD nearPt;
double radius;
ExtendedNormalOfPoint(m.GetVirtualPointD(), out normalVector, out nearPt, out radius);
PointD dir = PointD.Orthogonal(normalVector);
PointD normalComponent = PointD.DotProduct(dir, m.GetVelocity()) * dir;
PointD tangentComponent = m.GetVelocity() - normalComponent;
return -1 * tangentComponent * m_Param.C;
}
示例3: GetVelocity
public override PointD GetVelocity(Position.IVirtualMousePosition m)
{
// velocity restriction
double speed = m.GetSpeed();
double speedLimit = m_Param.C * 10 * GetStrength(m.GetVirtualPointD());
if (speed > speedLimit)
{
PointD maxParts = new PointD(speedLimit * m.GetUnitDirection().X, speedLimit * m.GetUnitDirection().Y);
return -1 * m.GetVelocity() + maxParts;
}
else
{
return PointD.Empty;
}
}
示例4: MouseMoved
// called very frequently
public void MouseMoved(Position.VirtualMousePosition mouseMove)
{
m_virtualDelta.Add(mouseMove.GetVirtualPointD() - mouseMove.GetLastVirtualPointD());
m_realDelta.Add(new PointD (mouseMove.GetPhysicalPoint().X - mouseMove.GetLastPhysicalPoint().X,
mouseMove.GetPhysicalPoint().Y - mouseMove.GetLastPhysicalPoint().Y));
if (m_virtualDelta.Count > MouseLogger.TAIL_LENGTH)
{
// BUG: sometimes mouseMoved gets fired with no movement of the mouse,
// flooding the event queue with many points of data estimated to be
// > 40,000 points. Remove first half of the point data when such a
// condition may occur.
m_virtualDelta.RemoveRange(0, MouseLogger.TAIL_LENGTH / 2);
m_realDelta.RemoveRange(0, MouseLogger.TAIL_LENGTH / 2);
}
}
示例5: GetVelocity
public override PointD GetVelocity(Position.IVirtualMousePosition m)
{
PointD orig = m.GetVelocity();
return orig * (1 + m_Param.C) * GetStrength(m.GetVirtualPointD());
}
示例6: 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;
}