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); }
/// <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 }
/// <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); }
/// <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 }
/// <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; }