private static void OnCreatedEntityPositionChanged(MyPositionComponentBase obj)
 {
     if (obj.Container.Entity.Save == false)
     {
         MyEncounterId id;
         if (m_entityToEncounterConversion.TryGetValue(obj.Container.Entity, out id))
         {
             Vector3D newPosition = obj.GetPosition();
             if (Vector3D.Distance(id.PlacePosition, newPosition) > m_minDistanceToRecognizeMovement)
             {
                 m_movedOnlyEncounters[id] = obj.GetPosition();
             }
         }
     }
 }
Esempio n. 2
0
        private void OnModelPositionChanged(MyPositionComponentBase pos)
        {
            // save turret position
            GetTurretOrientation();
            //Logger.Instance.LogMessage("Forward:" + pos.GetOrientation().Forward.ToString());
            // update light
            m_light_emmitter.ReflectorDirection = pos.GetOrientation().Forward;
            m_light_emmitter.ReflectorUp        = pos.GetOrientation().Up;
            m_light_emmitter.Position           = pos.GetPosition() + pos.GetOrientation().Forward *Light_Offset;

            m_light_emmitter.UpdateLight();
        }
 private static void OnCreatedEntityPositionChanged(MyPositionComponentBase obj)
 {
     if (obj.Container.Entity.Save == false)
     {
         MyEncounterId id;
         if (m_entityToEncounterConversion.TryGetValue(obj.Container.Entity, out id))
         {
             Vector3D newPosition = obj.GetPosition();
             if (Vector3D.Distance(id.PlacePosition, newPosition) > m_minDistanceToRecognizeMovement)
             {
                 m_movedOnlyEncounters[id] = obj.GetPosition();
             }
         }
     }
 }