本文整理汇总了C#中System.Line.PointInCylinder方法的典型用法代码示例。如果您正苦于以下问题:C# Line.PointInCylinder方法的具体用法?C# Line.PointInCylinder怎么用?C# Line.PointInCylinder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Line
的用法示例。
在下文中一共展示了Line.PointInCylinder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Move
public override void Move()
{
if (m_navGrind.FunctionalBlocks == 0)
{
m_logger.debugLog("No functional grinders remaining", "Move()", Logger.severity.INFO);
m_navSet.OnTaskComplete_NavRot();
EnableGrinders(false);
return;
}
if (Globals.UpdateCount >= m_next_grinderCheck)
EnableGrinders(m_enableGrinders);
if (GrinderFull())
{
m_logger.debugLog("Grinders are full", "Move()", Logger.severity.INFO);
m_navSet.OnTaskComplete_NavRot();
EnableGrinders(false);
return;
}
m_finder.Update();
if (!set_enemy(m_finder.Grid != null ? m_finder.Grid.Entity as IMyCubeGrid : null) || m_enemy == null)
{
m_mover.StopMove();
if (DateTime.UtcNow >= m_timeoutAt)
{
m_logger.debugLog("Search timed out", "Move()");
m_navSet.OnTaskComplete_NavRot();
EnableGrinders(false);
}
return;
}
m_timeoutAt = DateTime.UtcNow + SearchTimeout;
Vector3 targetCentre = m_enemy.GetCentre();
Vector3 enemyVelocity = m_enemy.GetLinearVelocity();
if (enemyVelocity.LengthSquared() > 10f)
{
float targetLongest = m_enemy.LocalAABB.GetLongestDim();
Vector3 furthest = targetCentre + enemyVelocity * 1000000f;
Line approachTo = new Line(targetCentre, furthest, false);
float multi = m_stage == Stage.Intercept ? 0.5f : 1f;
if (!approachTo.PointInCylinder(targetLongest * multi, m_navGrind.WorldPosition))
{
m_targetPosition = targetCentre;
Vector3 direction = furthest - targetCentre;
direction.Normalize();
Move_Intercept(targetCentre + direction * (targetLongest + m_longestDimension));
return;
}
}
Move_Grind();
}