Beispiel #1
0
        public MySmartGoal(IMyDestinationShape goal, MyEntity entity = null)
        {
            m_destination       = goal;
            m_destinationCenter = goal.GetCenter();
            m_endEntity         = entity;
            if (m_endEntity != null)
            {
                m_destination.SetRelativeTransform(m_endEntity.PositionComp.WorldMatrixNormalizedInv);
                m_endEntity.OnClosing += m_endEntity_OnClosing;
            }

            m_pathfindingHeuristic = this.Heuristic;
            m_terminationCriterion = this.Criterion;

            m_ignoredPrimitives = new HashSet <MyHighLevelPrimitive>();
            IsValid             = true;
        }
Beispiel #2
0
        public MySmartGoal(IMyDestinationShape goal, MyEntity entity = null)
        {
            m_destination = goal;
            m_destinationCenter = goal.GetCenter();
            m_endEntity = entity;
            if (m_endEntity != null)
            {
                m_destination.SetRelativeTransform(m_endEntity.PositionComp.WorldMatrixNormalizedInv);
                m_endEntity.OnClosing += m_endEntity_OnClosing;
            }

            m_pathfindingHeuristic = this.Heuristic;
            m_terminationCriterion = this.Criterion;

            m_ignoredPrimitives = new HashSet<MyHighLevelPrimitive>();
            IsValid = true;
        }
Beispiel #3
0
 private bool TargetMoved()
 {
     return(Vector3D.DistanceSquared(m_destinationCenter, m_destination.GetCenter()) > 4.0f);
 }