Beispiel #1
0
        /// <summary>
        /// Loads descriptor of the sensor and initialize the sensor
        /// </summary>
        public bool LoadFromDesc(MySensorDesc desc)
        {
            if (m_Inserted)
            {
                return false;
            }

            if(!desc.IsValid())
                return false;
            
            m_Matrix = desc.m_Matrix;
            m_Element = desc.m_Element;

            m_Element.Sensor = this;

            m_SensorEventHandler = desc.m_SensorEventHandler;
            MyCommonDebugUtils.AssertDebug(m_Interactions.Count == 0);
            m_Interactions.Clear();

            m_Guid = GUID_COUNTER;
            if (GUID_COUNTER > ushort.MaxValue)
            {
                GUID_COUNTER = 0;
            }

            GUID_COUNTER++;

            return true;
        }
Beispiel #2
0
        /// <summary>
        /// Loads descriptor of the sensor and initialize the sensor
        /// </summary>
        public bool LoadFromDesc(MySensorDesc desc)
        {
            if (m_Inserted)
            {
                return(false);
            }

            if (!desc.IsValid())
            {
                return(false);
            }

            m_Matrix  = desc.m_Matrix;
            m_Element = desc.m_Element;

            m_Element.Sensor = this;

            m_SensorEventHandler = desc.m_SensorEventHandler;
            MyCommonDebugUtils.AssertDebug(m_Interactions.Count == 0);
            m_Interactions.Clear();

            m_Guid = GUID_COUNTER;
            if (GUID_COUNTER > ushort.MaxValue)
            {
                GUID_COUNTER = 0;
            }

            GUID_COUNTER++;

            return(true);
        }
Beispiel #3
0
        public void Close()
        {
            MyCommonDebugUtils.AssertDebug(m_isMarkedForClose);
            MyCommonDebugUtils.AssertDebug(m_Interactions.Count == 0);

            if (m_Element != null)
            {
                m_Element.Close();
                m_Element = null;
            }

            m_SensorEventHandler = null;

            m_Interactions.Clear();
            m_Interactions = null;

            m_UserData = null;
        }
Beispiel #4
0
        public MySensor()
        {
            m_UserData = null;

            m_Element = null;

            m_SensorEventHandler = null;

            m_Matrix = new Matrix();

            m_Inserted = false;

            m_isMarkedForClose = false;

            m_Interactions = new Dictionary <int, MySensorInteraction>(32);

            m_Guid = GUID_COUNTER;
            if (GUID_COUNTER == ushort.MaxValue)
            {
                GUID_COUNTER = 0;
            }
            GUID_COUNTER++;
        }
Beispiel #5
0
        public MySensor()
        {
            m_UserData = null;

            m_Element = null;

            m_SensorEventHandler = null;

            m_Matrix = new Matrix();

            m_Inserted = false;

            m_isMarkedForClose = false;

            m_Interactions = new Dictionary<int, MySensorInteraction>(32);

            m_Guid = GUID_COUNTER;
            if (GUID_COUNTER == ushort.MaxValue)
            {
                GUID_COUNTER = 0;
            }
            GUID_COUNTER++;
        }
 /// <summary>
 /// default settings
 /// </summary>
 public void SetToDefault()
 {
     m_Matrix             = Matrix.Identity;
     m_SensorEventHandler = null;
 }
 public MySensorDesc()
 {
     m_Matrix             = Matrix.Identity;
     m_SensorEventHandler = null;
     m_Element            = null;
 }
Beispiel #8
0
 /// <summary>
 /// default settings
 /// </summary>
 public void SetToDefault()
 {
     m_Matrix = Matrix.Identity;
     m_SensorEventHandler = null;
 }
Beispiel #9
0
 public MySensorDesc()
 {
     m_Matrix = Matrix.Identity;
     m_SensorEventHandler = null;
     m_Element = null;
 }
Beispiel #10
0
        public void Close() 
        {
            MyCommonDebugUtils.AssertDebug(m_isMarkedForClose);
            MyCommonDebugUtils.AssertDebug(m_Interactions.Count == 0);                        

            if (m_Element != null) 
            {
                m_Element.Close();
                m_Element = null;
            }

            m_SensorEventHandler = null;

            m_Interactions.Clear();
            m_Interactions = null;

            m_UserData = null;
        }