Example #1
0
        public void PlaceInFront(WorldObject obj)
        {
            var pos = m_position;

            pos.Z += 1;
            //m_position.GetPointYX(m_orientation, 5, out pos);
            m_Map.TransferObjectLater(obj, pos);
            obj.Orientation = obj.GetAngleTowards(this);
        }
Example #2
0
        /// <summary>
        /// Returns whether this Object is in front of the given obj
        /// </summary>
        public bool IsInFrontOf(WorldObject obj)
        {
            if (obj == this)
            {
                return(false);
            }

            var angle = Math.Abs(obj.m_orientation - obj.GetAngleTowards(m_position));

            return(angle <= InFrontAngleMax ||
                   angle >= InFrontAngleMin);                           // difference is close to 0 (or 2 pi) if obj is in view field of the other
        }
Example #3
0
        /// <summary>
        /// Returns whether this Object is behind the given obj
        /// </summary>
        public bool IsBehind(WorldObject obj)
        {
            if (obj == this)
            {
                return(false);
            }

            var angle = Math.Abs(obj.m_orientation - obj.GetAngleTowards(m_position));

            return(angle >= BehindAngleMin &&
                   angle <= BehindAngleMax);
        }
Example #4
0
		/// <summary>
		/// Returns whether this Object is in front of the given obj
		/// </summary>
		public bool IsInFrontOf(WorldObject obj)
		{
			if (obj == this)
			{
				return false;
			}

			var angle = Math.Abs(obj.m_orientation - obj.GetAngleTowards(m_position));
			return angle <= InFrontAngleMax ||
				angle >= InFrontAngleMin;		// difference is close to 0 (or 2 pi) if obj is in view field of the other
		}
Example #5
0
		/// <summary>
		/// Returns whether this Object is behind the given obj
		/// </summary>
		public bool IsBehind(WorldObject obj)
		{
			if (obj == this)
			{
				return false;
			}

			var angle = Math.Abs(obj.m_orientation - obj.GetAngleTowards(m_position));
			return angle >= BehindAngleMin &&
				angle <= BehindAngleMax;
		}
Example #6
0
		public void PlaceInFront(WorldObject obj)
		{
			var pos = m_position;
			pos.Z += 1;
			//m_position.GetPointYX(m_orientation, 5, out pos);
			m_Map.TransferObjectLater(obj, pos);
			obj.Orientation = obj.GetAngleTowards(this);
		}